#6868th of 126 in Training and fine-tuning
nanochat
Minimal PyTorch codebase to train and chat with a small GPT-2-class LLM
Run it:Vast.ai ↗ (opens in a new tab)Clore.ai ↗ (opens in a new tab)Affiliate links, no effect on a rank.
Watch puts nanochat on your watch list: its new releases and known problems since your last visit. Kept in this browser, no account.nanochat is on your watch list. Its new releases and problems show there.
- Stars
- 61k
- License
- MIT
- Last commit
- Jul 2026
- Language
- Python
49,428 on 24 Mar 202660,980 on 24 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
- Nanochat Miniseries v1 (opens in a new tab) (21 points, Jan 2026)
- NanoChat – The best ChatGPT that $100 can buy (opens in a new tab) (1523 points, Oct 2025)
Overview
nanochat covers tokenizer training, pretraining, SFT, RL, evaluation and a CLI chat interface in one small Python codebase. A single `--depth` setting derives width, heads, learning rate and training horizon, so one knob produces a compute-optimal model series. The reference speedrun trains a GPT-2-grade model in about 1.65 hours on an 8xH100 node per the leaderboard.
Who it is for: Researchers and engineers learning or experimenting with end-to-end LLM training
Strengths
- Covers tokenizer, pretraining, SFT, RL, eval and inference in one repo
- Single `--depth` dial sets all other hyperparameters automatically
- Public time-to-GPT-2 leaderboard with commits and CORE scores
- Same scripts run on one GPU via gradient accumulation, or on CPU/MPS
Weaknesses
- Reference speedrun needs an 8xH100 node, roughly $48 of rented compute
- Under 80GB VRAM requires manually lowering `--device-batch-size`
- CPU/MPS path only trains a tiny model with weak results
- Chat is CLI-only in the README; resulting model is small and hallucinates
What it needs
- GPU required
- Needs PyTorch, uv, wandb
- Models: nanochat GPT (depth-scaled), bfloat16, float32, float16
Also in Training and fine-tuning
See all 126| Rank | Project | Score |
|---|---|---|
| #66 | lightly-trainPython library for pretraining, distilling and fine-tuning computer vision models | 56 out of 100 |
| #67 | torchdistillYAML-configured PyTorch framework for knowledge distillation experiments | 56 out of 100 |
| #69 | alignment-handbookTraining scripts and YAML recipes for SFT, DPO and ORPO of LLMs | 55 out of 100 |
| #70 | xtunerTraining engine for fine-tuning and RL of large MoE and dense LLMs | 55 out of 100 |
| #71 | reagentArchived Meta platform for offline reinforcement learning on PyTorch | 55 out of 100 |