#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.

Stars
61k
License
MIT
Last commit
Jul 2026
Language
Python
Stars, last 35 weeks+11,552
24 Mar 2026: 49,428 stars31 Mar 2026: 50,034 stars7 Apr 2026: 50,642 stars14 Apr 2026: 51,196 stars21 Apr 2026: 51,645 stars28 Apr 2026: 52,037 stars5 May 2026: 52,380 stars12 May 2026: 52,788 stars19 May 2026: 53,207 stars26 May 2026: 53,724 stars2 Jun 2026: 54,035 stars9 Jun 2026: 54,342 stars16 Jun 2026: 54,679 stars23 Jun 2026: 54,933 stars30 Jun 2026: 55,239 stars7 Jul 2026: 55,641 stars14 Jul 2026: 55,907 stars21 Jul 2026: 56,181 stars28 Jul 2026: 56,434 stars4 Aug 2026: 56,682 stars11 Aug 2026: 56,868 stars18 Aug 2026: 57,064 stars25 Aug 2026: 57,296 stars1 Sept 2026: 57,529 stars8 Sept 2026: 57,703 stars15 Sept 2026: 57,900 stars22 Sept 2026: 58,090 stars29 Sept 2026: 58,239 stars6 Oct 2026: 58,380 stars13 Oct 2026: 58,579 stars20 Oct 2026: 58,809 stars27 Oct 2026: 59,070 stars3 Nov 2026: 60,262 stars10 Nov 2026: 60,508 stars17 Nov 2026: 60,748 stars24 Nov 2026: 60,980 stars

49,428 on 24 Mar 202660,980 on 24 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

On Hacker NewsRead 29 Nov 2026 from Hacker News search.

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
Also in Training and fine-tuning
RankProjectScore
#66lightly-trainPython library for pretraining, distilling and fine-tuning computer vision models1.7k starsAGPL-3.056 out of 100
#67torchdistillYAML-configured PyTorch framework for knowledge distillation experiments Live demo ↗ (opens in a new tab)1.6k starsMIT56 out of 100
#69alignment-handbookTraining scripts and YAML recipes for SFT, DPO and ORPO of LLMs5.7k starsApache-2.055 out of 100
#70xtunerTraining engine for fine-tuning and RL of large MoE and dense LLMs5.2k starsApache-2.055 out of 100
#71reagentArchived Meta platform for offline reinforcement learning on PyTorch3.7k starsBSD-3-Clause55 out of 100