karpathy/nanoGPT
The simplest, fastest repository for training/finetuning medium-sized GPTs.
Build with Backblaze B2
SDKs, agent skills, IDE extensions, and reference pipelines from Backblaze Labs. All open source.
Loading star history...
Where it stands
Rank, growth pace and release cadence relative to everything GStars tracks.
The project lists 36 contributors on GitHub.
Peaked at #9 in the weekly ranking the week of Oct 26, its best in the past year.
Use Cases & Benefits
- Provides a minimal and efficient codebase for training and finetuning medium-sized GPT language models.
- Offers a simple, readable implementation that enables quick experimentation and customization with minimal dependencies.
- Use for training character-level GPT models on small datasets quickly on a single GPU or CPU.
- Use for reproducing GPT-2 scale models on large datasets using multi-GPU or multi-node distributed training.
- Use for finetuning pretrained GPT-2 models on custom text datasets to adapt language generation to specific domains.
Should you depend on it?
License terms, project hygiene and risks, from GitHub metadata and GStars' snapshots.
License
MIT
Permissive: commercial use, modification and redistribution are allowed with attribution.
Community files
- README: present
Watch-outs
- Warning: No commits in over a year (last push Nov 2025).
- No GitHub releases; pin a commit or tag instead of a release.
General guidance from repository metadata, not legal advice. How we score
From the README
The simplest, fastest repository for training/finetuning medium-sized GPTs. It is a rewrite of minGPT that prioritizes teeth over education. Still under active development, but currently the file
train.pyreproduces GPT-2 (124M) on OpenWebText, running on a single 8XA100 40GB node in about 4 days of training. The code itself is plain and readable:train.pyis a ~300-line boilerplate training loop andmodel.pya ~300-line GPT model definition, which can optionally load the GPT-2 weights from OpenAI. That's it.Because the code is so simple, it is very easy to hack to your needs, train new models from scratch, or finetune pretrained checkpoints (e.g. biggest one currently available as a starting point would be the GPT-2 1.3B model from OpenAI).
Daily snapshots
Stars gained per day, and how forks and open issues moved, from GStars' daily snapshots
Forks
11.2K+391
Open issues
367+16
Compared with peers in Machine Learning
Fastest-growing repositories GStars tracks in this cohort for the week of Nov 22, by 7-day star growth
| Repository | Stars | +7d | Health | Last release |
|---|---|---|---|---|
| karpathy/nanoGPT | 64.9K | — | 27 | — |
| harvard-edge/cs249r_book | 30.2K | — | 65 | 9 days ago |
| verl-project/verl | 24.2K | — | 57 | 52 days ago |
| onnx/onnx | 21.7K | — | 63 | 43 days ago |
| lukas-blecher/LaTeX-OCR | 16.6K | — | 18 | — |
| strands-agents/harness-sdk | 9.2K | — | 45 | today |
| Category median | 21.7K | — | 57 | — |
Also by karpathy
Other repositories from this maintainer that GStars tracks
- Python100.4K stars
autoresearch
AI agents running research on single-GPU nanochat training automatically
- Python60.5K stars
nanochat
The best ChatGPT that $100 can buy.
- Jupyter Notebook25.9K stars
nn-zero-to-hero
Neural Networks: Zero to Hero
- Python25.0K stars
minGPT
A minimal PyTorch re-implementation of the OpenAI GPT (Generative Pretrained Transformer) training
- Jupyter Notebook18.8K stars
micrograd
A tiny scalar-valued autograd engine and a neural net library on top of it with PyTorch-like API
Discover Repositories
Search across tracked repositories by name or description