karpathy/minGPT
A minimal PyTorch re-implementation of the OpenAI GPT (Generative Pretrained Transformer) training
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 11 contributors on GitHub.
Use Cases & Benefits
- Implements a minimal, clean PyTorch version of the GPT transformer model for both training and inference.
- Offers a compact, interpretable, and educational codebase around 300 lines, simplifying understanding and customization of GPT.
- Use for learning and experimenting with transformer-based language models in a straightforward, minimal environment.
- Use for training custom GPT models on specific datasets with easy-to-adapt PyTorch training boilerplate.
- Use for prototyping character-level or token-level language modeling projects with minimal dependencies and complexity.
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 Aug 2024).
- 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
A PyTorch re-implementation of GPT, both training and inference. minGPT tries to be small, clean, interpretable and educational, as most of the currently available GPT model implementations can a bit sprawling. GPT is not a complicated model and this implementation is appropriately about 300 lines of code (see mingpt/model.py). All that's going on is that a sequence of indices feeds into a Transformer, and a probability distribution over the next index in the sequence comes out. The majority of the complexity is just being clever with batching (both across examples and over sequence length) for efficiency.
note (Jan 2023): though I may continue to accept and change some details, minGPT is in a semi-archived state. For more recent developments see my rewrite nanoGPT. Basically, minGPT became referenced across a wide variety of places (notebooks, blogs, courses, books, etc.) which made me less willing to make the bigger changes I wanted to make to move the code forward. I also wanted to change the direction a bit, from a sole focus on education to something that is still simple and hackable but has teeth (reproduces medium-sized industry benchmarks, accepts some tradeoffs to gain runtime efficiency, etc).
Daily snapshots
Stars gained per day, and how forks and open issues moved, from GStars' daily snapshots
Forks
3.3K+12
Open issues
82-1
Compared with peers in LLM
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 |
|---|---|---|---|---|
| firecrawl/firecrawl | 207.0K | +5.5K | 51 | 156 days ago |
| DietrichGebert/ponytail | 196.9K | +5.2K | 59 | 24 days ago |
| affaan-m/ECC | 309.0K | +5.1K | 62 | 52 days ago |
| Tencent/LoopForge | 5.7K | +4.2K | 65 | 2 days ago |
| tashfeenahmed/freellmapi | 56.7K | +3.8K | 45 | today |
| karpathy/minGPT | 25.0K | — | 12 | — |
| Category median | 196.9K | +5.1K | 59 | — |
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
- Python64.9K stars
nanoGPT
The simplest, fastest repository for training/finetuning medium-sized GPTs.
- Python60.5K stars
nanochat
The best ChatGPT that $100 can buy.
- Jupyter Notebook25.9K stars
nn-zero-to-hero
Neural Networks: Zero to Hero
- 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