{
 "schema_version": 1,
 "generated": "2026-11-09",
 "repo": "karpathy/nanochat",
 "name": "nanochat",
 "owner": "karpathy",
 "slug": "karpathy-nanochat",
 "github": "https://github.com/karpathy/nanochat",
 "what": "nanochat is the simplest experimental harness for training LLMs on a single GPU node. Its minimal, hackable code covers tokenization, pretraining, finetuning, evaluation and inference, so you can train a GPT-2 capability model in about 2 hours on an 8XH100 node and talk to it over a CLI. One dial, --depth, sets the model size and every other hyperparameter is derived from it.",
 "why": "60k stars, talked about in 2 AI sources we track",
 "language": "Python",
 "requirements": [
  "uv",
  "An 8XH100 or 8XA100 node for the speedrun (a single GPU works, 8 times slower)",
  "CPU or Apple Silicon only for the tiny runcpu example"
 ],
 "audience_note": "ML engineers, students and researchers who want to train a small LLM end to end and understand every stage.",
 "risk": "none",
 "section": "earlier",
 "weekly_rank": null,
 "category": "Research",
 "url": "https://dedupedai.com/use-cases/karpathy-nanochat/",
 "use_case_count": 3,
 "use_cases": [
  {
   "id": "karpathy-nanochat--train-your-own-gpt-2-in-two-hours",
   "title": "Train a GPT-2 class chat model end to end and talk to it",
   "best": true,
   "url": "https://dedupedai.com/use-cases/karpathy-nanochat/train-your-own-gpt-2-in-two-hours/",
   "json": "https://dedupedai.com/use-cases/u/karpathy-nanochat/train-your-own-gpt-2-in-two-hours.json"
  },
  {
   "id": "karpathy-nanochat--sweep-model-size-with-one-depth-dial",
   "title": "Train a compute-optimal miniseries by changing one depth dial",
   "best": false,
   "url": "https://dedupedai.com/use-cases/karpathy-nanochat/sweep-model-size-with-one-depth-dial/",
   "json": "https://dedupedai.com/use-cases/u/karpathy-nanochat/sweep-model-size-with-one-depth-dial.json"
  },
  {
   "id": "karpathy-nanochat--try-nanochat-on-a-laptop",
   "title": "Run a tiny Nanochat training on CPU or Apple Silicon",
   "best": false,
   "url": "https://dedupedai.com/use-cases/karpathy-nanochat/try-nanochat-on-a-laptop/",
   "json": "https://dedupedai.com/use-cases/u/karpathy-nanochat/try-nanochat-on-a-laptop.json"
  }
 ],
 "disclaimer": "Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk."
}
