Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Train a tiny Transformer from scratch on your iMessage history, entirely on your Mac.
| Date | Stars |
|---|---|
| 2026-07-24 | 427 |
| 2026-07-25 | 431 |
| 2026-07-28 | 431 |
| 2026-07-30 | 431 |
| 2026-08-06 | 431 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Texts to Transformer
Train a tiny language model from scratch on your iMessage history, entirely on your Mac.
This repository contains the complete pipeline: safe Messages database snapshotting, text
extraction and pseudonymization, leakage-resistant dataset splits, tokenizer training, a custom
decoder-only Transformer, MLX training, evaluation, memorization checks, model export, and a local
terminal chat interface.
Nothing is pretrained. The tokenizer and model both start from zero.
> [!IMPORTANT]
> This builds a small personal style model, not a generally capable assistant. It can learn your
> phrasing, rhythm, slang, and common responses, but it will not reliably reason or answer factual
> questions. The resulting model may memorize private text and must remain private.
## What you will build
The default small preset is a 4-layer, 1.38M-parameter decoder-only Transformer with a custom
4,096-token byte-level BPE tokenizer and a 256-token context window. A larger 6.16M-parameter
preset is included for unusually large message histories.
```mermaid
flowchart LR
A["Messages chat.db"] -->|"read-only SQLite backup"| B["Private snapshot"]
B --> C["Extract + pseudonymize"]
C --> D["Conversation sessions"]
D --> E["Chronological train / validation / test"]
E --> F["Train custom tokenizer"]
F --> G["Initialize Transformer randomly"]
G --> H["Train + evaluate with MLX"]
H --> I["Local reply generator"]
```
An example development run used roughly 8M training tokens and produced a 1.38M-parameter model
that generated short replies in the owner's writing style.
## Safety and privacy
Read [the privacy documentation](docs/privacy.md) before running the data pipeline.
- `~/Library/Messages/chat.db` is opened in SQLite read-only mode and is never modified.
- Processing happens from a consistent private backup under `work/`, never from the live database.
- Attachments are never opened or copied.
- Handles and chat identifiers are replaced with keyed HMAC pseudonyms before JSONL is written.
- URLs, email addresses, and phone-number-shaped strings are redacted by default.
- Raw messages are never printed in normal logs.
- Datasets, tokenizers, checkpoints, and final weights are excluded from Git.
- No command uploads data or sends an iMessage. `chat` only prints a suggestion in the terminal.
Pseudonymization is not anonymization. Keep `work/` and `outputs/` on a FileVault-protected Mac and
never commit, upload, or share them.
## Requirements
- An Apple Silicon Mac (M1 or newer)
- macOS 14 or newer
- At least 16 GB of unified memory recommended
- Enough free disk space for a private copy of `chat.db` and training artifacts
- [Homebrew](https://brew.sh/) or another way to install `uv`
- Full Disk Access for Terminal, Codex, or whichever app runs the snapshot command
The project uses Python 3.11 and pins MLX 0.32.0. It does not require PyTorch.
## Install
```bash
git clone https://github.com/Doriandarko/texts-to-transformer.git
cd texts-to-transformer
# Skip this if uv is already installed.
brew install uv
uv sync
uv run imessage-mlx doctor
```
`doctor` verifies Apple Silicon, MLX Metal support, disk space, Git ignore coverage, private
directory permissions, and read-only access to the Messages database.
### Grant Full Disk Access
If `safe_to_snapshot_real_data` is `false`, open:
```text
System Settings → Privacy & Security → Full Disk Access
```
Enable the application running the command, completely restart that application, and rerun:
```bash
uv run imessage-mlx doctor
```
Do not copy the live database manually or change its permissions as a workaround.
## Train your model
Run these commands from the repository root. The commands print aggregate counts and metrics, not
message text.
### 1. Create a safe database snapshot
```bash
uv run imessage-mlx snapshot --config configs/data.yaml
```
This uses SQLite's online backup API, writes `work/snapshot/chat.db`, hashes the snapshot, and rExcerpt of 10,697 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:d69aef2ea38dd01e, topic:transformer