nanochat
Full-stack pipeline that trains a ChatGPT-style model end to end for about 100 dollars, by Andrej Karpathy.
About
For roughly the price of a dinner out, nanochat trains a working ChatGPT-style assistant from scratch: Andrej Karpathy's follow-up to nanoGPT covers the entire stack in one clean codebase, from tokenizer training through pretraining, supervised fine-tuning, optional reinforcement learning, evaluation, and an inference server with a web chat UI. The reference speedrun script targets an 8xH100 node and reaches GPT-2 grade capability in roughly 1.5 hours for about 48 dollars, tracked on a time-to-GPT-2 leaderboard in the repository, while the stated goal is the best models reachable end to end on budgets under 1,000 dollars. Setup uses the uv package manager with CUDA as the primary path plus CPU and Apple Silicon fallbacks for tinkering, though real training assumes a multi-GPU node rented by the hour. The code is MIT licensed and deliberately minimal, hackable, and dependency-light. Released in October 2025, it collected more than 56,000 GitHub stars within months and is planned as the capstone project of Karpathy's LLM101n course, making it the standard answer to how to train your own chatbot end to end.
Should you use nanochat?
Pick it when
Pick it when you want to see and run every stage of building a ChatGPT-style assistant, tokenizer to pretraining to SFT to a web chat UI, in one small codebase, and can rent an 8xH100 node for a few hours.
Look elsewhere when
Real training assumes a rented multi-GPU node, and the result is GPT-2 grade, not a production assistant. To adapt an existing strong model to your data, fine-tune with LLaMA-Factory or Unsloth; to study pretraining alone, nanoGPT is smaller.
Alternatives to nanochat
- nanoGPT
Just the pretraining core in two short files, readable in an afternoon, but no tokenizer training, SFT, RL, or chat UI.
- llm.c
Same educational aim pushed down to C and CUDA for understanding kernels, but it covers pretraining only.
- LitGPT
Starts from strong pretrained models like Llama and Qwen and fine-tunes them, a cheaper route to a capable model.
Reviews (0)
Leave a Review
No reviews yet. Be the first to review!
Details
- Category
- Model Training & Fine-Tuning
- Price
- Free
- Platform
- Local/Desktop
- Difficulty
- Intermediate (3/5)
- License
- MIT
- Added
- Jul 29, 2026