Short answer
Building your own model can mean anything from a free laptop exercise to a run costing hundreds of thousands of dollars, so choose by goal. To learn, train from scratch with nanochat; to get something useful for a task, fine-tune an open-weight model; pretrain a serious model only if you need control over its data, its language or its licence.
Follow-up question Where should you stop climbing?
"My own language model" is a phrase that hides very different projects. A student watching a toy learn spelling, a company teaching an open model its ticket format, and a university training a multilingual model on a national supercomputer are all building their own model. They differ by a factor of about a million in cost.
This page is the map for this series. It shows the levels, the stages every from-scratch model goes through, and the tools for each. A language model, or LLM (large language model), is a program that predicts the next piece of text. Pretraining teaches it that skill from raw text, starting from random numbers. Fine-tuning continues training on an existing model, usually with examples of the behavior you want.
The six levels
Dollar amounts are US dollars. The rented figures use prices read on November 2, 2026; the cost article shows the arithmetic.
| Level | What you do | Example | Machine | About | You end up with |
|---|---|---|---|---|---|
| 1 | Train a character-level toy | nanoGPT's Shakespeare | Laptop | $0 | Shakespeare-shaped nonsense and real intuition |
| 2 | Run the whole pipeline, tiny | nanochat runs/runcpu.sh | Fast laptop, about 40 min | $0 | A weak chat model that may know the capital of France |
| 3 | Fine-tune an open model | LoRA or QLoRA adapter | Free notebook or gaming GPU | $0 to $20 | A model useful for one narrow task |
| 4 | Pretrain to GPT-2 grade | nanochat runs/speedrun.sh | 8 H100 GPUs, about 2 h | $64 | A chat model that writes fluently and invents freely |
| 5 | Pretrain a capable small model | SmolLM3 (3 billion parameters) | 384 H100 GPUs, 24 days | $880,000 at list price | A competitive open model |
| 6 | Train at the frontier | National or lab-scale runs | Thousands of GPUs | Millions and up | A leading model, plus a research team to feed |
Level 3 sits below level 4 on purpose: fine-tuning is cheaper and gives more practical results, while levels 1, 2 and 4 teach how models work. Most people should do level 1 or 2 for understanding and level 3 for use. Levels 1 and 3 already have step-by-step guides here: a tiny model from scratch and fine-tuning a small model.
The stages of a from-scratch model
The nanochat project by the researcher Andrej Karpathy is a useful reference because one short script runs all of these, in order:
- Collect and clean text. The speedrun needs about 150 files holding some 250 million characters each. See how to prepare a dataset.
- Train a tokenizer, the piece that cuts text into numbered tokens. See how to build one.
- Pretrain the model on those tokens. This stage uses most of the money.
- Fine-tune for chat, so that it answers instead of merely continuing your sentence.
- Evaluate it against numbers that mean something. See how to test your model.
- Publish, if you wish, with a licence that matches what you trained on. See publishing and licensing.
The rented-GPU walkthrough goes through stages 1 to 5 with commands.
Which tool does what
| Tool | Use it for | Why |
|---|---|---|
| PyTorch | Everything underneath | The library most of these projects are written in |
| nanochat | Learning the full pipeline, levels 2 and 4 | Readable code, one size setting (--depth), MIT licence |
Hugging Face datasets, tokenizers, Hub | Data, tokenizers, sharing | Common formats that other tools understand |
| Hugging Face TRL and PEFT | Fine-tuning from Python | Direct control, covered in our LoRA guide |
| Unsloth | Fine-tuning on one modest GPU | Lower memory needs, free notebooks, desktop app |
| Axolotl | Repeatable fine-tuning, more GPUs | A YAML file describes the run, and scales to several GPUs |
With Axolotl, a first run is two commands, assuming it is installed. The file names the model, the data and the method:
axolotl fetch examples
axolotl train examples/llama-3/lora-1b.yml
A worked plan
Say you work for a Quebec organization and want an assistant that sorts French-language requests into your categories. A sensible order:
- Spend an afternoon on level 1 so that loss, tokens and overfitting stop being abstract.
- Write 300 French examples of the sorting task and test a plain prompt on them. That score is your baseline.
- If the prompt falls short, fine-tune a small open model that handles French (level 3), and compare on the same examples.
- Skip levels 4 and 5. A GPT-2-grade model trained for $64 will not sort your requests reliably, and $880,000 buys nothing that the fine-tune needs.
Try it: Write down in one sentence why you want your own model, then find your level in the table. If your sentence contains "understand", start at level 1. If it contains a task from your job, start at level 3 with 20 examples.
Where should you stop climbing?
Stop at the first level that delivers your goal, and be honest about which goal it is. If you wanted to understand models, you are done when you can explain why your loss curve flattened. Level 2 can get you there for free, and level 4 adds the experience of paying for compute and seeing a chat model appear from nothing.
If you wanted a tool, stop as soon as a measured test says it beats the prompt-only baseline. Going further costs more without necessarily helping. Many tasks never need more than a prompt, as the guide to choosing between prompts, documents and fine-tuning explains.
Levels 5 and 6 are a different kind of decision, closer to funding a research project than to a weekend build. They make sense when control is the point: a dataset whose licences you can defend, a language the big models serve badly, or a country that wants its own. The comparison with fine-tuning and RAG walks through those cases, and the cost breakdown helps you check whether your budget matches.
Sources
- nanochat README, speedrun script, CPU script and leaderboard notes — Andrej Karpathy (GitHub)
- SmolLM3: smol, multilingual, long-context reasoner — Hugging Face, July 8, 2025
- Quickstart — Axolotl, November 2, 2026
From the Guide to Artificial Intelligence, by Robert Scales, published by Holistic Hybrid Inc. Share and adapt it under CC BY-NC-SA 4.0: credit the guide, link to https://guidetoartificialintelligence.com/en/learn/build-own-llm-roadmap/, no commercial use without permission, and keep the same licence.