• Picks
  • Discover
  • Alternatives
  • About

© 2026 Willet

  • Newsletter
  • About
  • FAQ
  • Terms
  • Privacy & Cookies
Join the Discord (opens in a new tab)
Andrej avatar

nanochat

Minimal codebase for training a small chat LLM end to end on one GPU node

  • AI models and runtimes
  • Education
View on GitHub

What it is

A compact, hackable PyTorch project that walks through every stage of building a chat model: tokenizer training, pretraining, finetuning, evaluation, and inference with a simple CLI or web chat. A single depth setting scales the model, with other hyperparameters derived automatically, and a reference script trains a GPT-2 grade model in about two hours on an 8xH100 node. Researchers and learners use it to study LLM training, run scaling experiments, and compete on a time-to-GPT-2 leaderboard.

Images

Facts

Stars
58,795 GitHub stars.
58,795

Forks
8,229
Commits
441
Contributors
51
Language
Python
License
MIT
Last commit
Jul 3, 2026
On GitHub since
October 2025
Platforms
Linux, CLI
Self-hostable
No
Author
Andrej
Tags
  • model-training
  • machine-learning
  • llm-inference
  • gpu-computing
  • llm-evaluation
  • fine-tuning

Last synced from GitHub on Oct 20, 2026

The 10 best overlooked open-source projects, every Monday.

Share and more

Comments

No comments yet. Start the conversation.

Similar projects

  • Keller Jordan avatar

    Modded-NanoGPT

    Community speedrun for training a GPT-2-scale model as fast as possible

    6k
  • Alpamys Makazhan avatar

    Soup

    YAML-driven CLI for fine-tuning LLMs on consumer GPUs

    9.5k

What people are saying

Updated Oct 21, 2026
  • Hacker NewsNanoChat – The best ChatGPT that $100 can buyOct 13, 2025 · 1,523 points · 308 comments (opens Hacker News in a new tab)
  • Hacker NewsNanochat Miniseries v1Jan 7, 2026 · 21 points · 0 comments (opens Hacker News in a new tab)
  • Hacker NewsBeating GPT-2 for less than $100 – Andrej KarpathyFeb 17, 2026 · 4 points · 0 comments (opens Hacker News in a new tab)
  • Hacker NewsNanochat d34 model (~$2,500)Nov 20, 2025 · 3 points · 0 comments (opens Hacker News in a new tab)
  • Bluesky“If you have a good card you can Already the basis for three different models trained on historical data”Jun 11, 2026 · 2 likes · 0 replies (opens Bluesky in a new tab)
  • Bluesky“One could perhaps try to construct such a simple letter-counting model for a small compute cost with sythetic training data, using a slight adaption of this.”May 28, 2026 · 1 like · 1 reply (opens Bluesky in a new tab)
  • Hacker NewsCounting R in strawberry – nanochat guideOct 24, 2025 · 2 points · 0 comments (opens Hacker News in a new tab)
  • Bluesky“ehhhh I mean yeah, for trillion-y frontier models and all that, but, you know, things like or some such”Oct 17, 2025 · 1 like · 1 reply (opens Bluesky in a new tab)
  • Bluesky“🔗 karpathy/nanochat”Nov 1, 2025 · 1 like · 0 replies (opens Bluesky in a new tab)
  • Bluesky“nanochat The best ChatGPT that $100 can buy.”Oct 21, 2025 · 1 like · 0 replies (opens Bluesky in a new tab)
  • Bluesky“I'd be remiss if I didn't include this one as well: Very readable :)”Oct 18, 2025 · 1 like · 0 replies (opens Bluesky in a new tab)
  • Bluesky“GitHub - karpathy/nanochat: The best ChatGPT that $100 can buy.”Oct 16, 2025 · 1 like · 0 replies (opens Bluesky in a new tab)
  • Bluesky“idk, it's possible to train a GPT-2 class model from scratch on consumer hardware or around $15 of rented GPU time but that's quite primitive by today's…”Sep 16, 2026 · 0 likes · 0 replies (opens Bluesky in a new tab)
  • Bluesky“Create your own LLM for less than $100, end to end. Even if you don’t, a great description for how it is done.”Jun 13, 2026 · 0 likes · 0 replies (opens Bluesky in a new tab)
  • Bluesky“karpathy/nanochat The best ChatGPT that $100 can buy. nanochat nanochat is the simplest experimental harness for training LLMs. It is designed to run on a…”Mar 10, 2026 · 0 likes · 0 replies (opens Bluesky in a new tab)
  • Bluesky“You *can* indeed train nanochat ( under $100! see the post by Marouane Khoukh Done on @nebiusai 💪”Oct 22, 2025 · 0 likes · 0 replies (opens Bluesky in a new tab)
  • Bluesky“Anyone able to get #nanochat running on a single #A100? #Karpathy's clone of ChatGPT (w/ tokenizing, training, inference & ui interface) was launched a few…”Oct 16, 2025 · 0 likes · 0 replies (opens Bluesky in a new tab)