Build Your Own AI From Scratch — Trained on Your Own Texts
A nine-step open-source pipeline trains a small language model from zero on your iMessage history, fully offline on a Mac. It's the cleanest way to build your own AI and finally see how a transformer works.
"Can I create my own AI like ChatGPT?" is one of those questions everyone asks and almost nobody actually tries, because the path looks like a wall of jargon. This repo — texts-to-transformer — is the closest thing to a friendly on-ramp I've found.
It trains a tiny transformer from scratch on one very personal dataset: your own text messages. No fine-tuning someone else's model, no cloud, no API keys. You build the thing from zero and end up chatting with a little model that writes like you.
Source
Doriandarko/texts-to-transformer
★ 324Python
What it does, step by step
The project is a full pipeline — nine steps — and it's honest about every one of them:
- 1Snapshots your Messages database safely (a copy, it doesn't touch the original).
- 2Pseudonymizes contacts so names aren't sitting in your training data.
- 3Trains a custom byte-level BPE tokenizer from your text.
- 4Splits the data cleanly so the model can't just memorize and cheat.
- 5Runs the training loop with Apple MLX, on your Mac.
- 6Exports a model you can chat with right in the terminal.
Most "build your own AI" tutorials have you fine-tune an existing model, which hides how any of it works. Here you build a small language model from scratch — so the tokenizer, the training loop, the whole shape of it stops being a mystery.
Can you really make your own AI without coding?
Not quite — this one asks you to run a Python pipeline, so you'll touch a terminal. But you don't need to write the model; it's all there. If you can follow steps and paste commands, you can get through it. And honestly, doing it this way teaches you more in an afternoon than a month of watching videos about it.
Is it private?
Completely. That's the whole point. Nothing leaves your laptop — not the messages, not the model. For a dataset as personal as your own conversations, that matters a lot, and it's why training locally with MLX is the right call here rather than uploading everything to some service.
What you actually get out of it
Two things. First, a strange little mirror — a model that has picked up your phrasing, your habits, the way you actually type. It's uncanny in a fun way. Second, and more useful: you'll finally understand, from the inside, how a transformer turns text into more text. that understanding transfers to every big model you'll ever use.
How to actually build it
This is the part the title promises, so here's the real path. You need an Apple-Silicon Mac (M1 or newer), macOS 14+, about 16 GB of RAM, and Full Disk Access granted to your terminal.
git clone https://github.com/Doriandarko/texts-to-transformer.git cd texts-to-transformer brew install uv # skip if you already have it uv sync uv run imessage-mlx doctor
The doctor step checks Apple Silicon, MLX, disk space and — importantly — that it can read your Messages database safely before anything touches real data.
uv run imessage-mlx snapshot --config configs/data.yaml uv run imessage-mlx prepare --config configs/data.yaml uv run imessage-mlx privacy-audit
snapshot copies your chat.db in read-only mode (the original is never touched), and the pipeline pseudonymizes contacts before writing anything. Then you train and talk to it:
uv run imessage-mlx train-tokenizer --train work/splits/train.jsonl uv run imessage-mlx train uv run imessage-mlx export uv run imessage-mlx chat --model outputs/final
Exact flags for each step live in the repo's README — I kept the commands here to the core sequence so you can see the whole shape at a glance.
A tiny model — around 1.4M parameters — that writes short replies in your own style, trained end to end on your Mac, with nothing ever leaving it.
324 stars in a week says a lot of people have been quietly curious about a personal AI that knows how they write. If that's you, and you've got a Mac, this is a genuinely great weekend project — build your own AI, from scratch, on data only you have.
Source: github.com
Free course
Stop reading about AI — start building with it
The free Claude Code course: your first site, tool or game — no coding. No upsells, no cross-sells — nothing to buy here.
Start free →▌ Related guides

Author
Evgenii Arsentev
PhD · Chief Executive Officer, digital health
Articles · Latest articles