karpathy

    karpathy/nanoGPT

    The simplest, fastest repository for training/finetuning medium-sized GPTs.

    64.9K stars
    11.2K forks
    540 GitHub watchers
    Updated Nov 18, 2026
    View on GitHub

    Build with Backblaze B2

    SDKs, agent skills, IDE extensions, and reference pipelines from Backblaze Labs. All open source.

    Explore Backblaze Labs

    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.py reproduces 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.py is a ~300-line boilerplate training loop and model.py a ~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).

    Excerpt from the karpathy/nanoGPT README on GitHub (MIT license). © its authors.Read the full README on GitHub

    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

    karpathy/nanoGPT compared with Machine Learning repositories by stars, 7-day star growth, health score and last release
    RepositoryStars+7dHealthLast release
    karpathy/nanoGPT64.9K—27—
    harvard-edge/cs249r_book30.2K—659 days ago
    verl-project/verl24.2K—5752 days ago
    onnx/onnx21.7K—6343 days ago
    lukas-blecher/LaTeX-OCR16.6K—18—
    strands-agents/harness-sdk9.2K—45today
    Category median21.7K—57—

    Also by karpathy

    Other repositories from this maintainer that GStars tracks

    Discover Repositories

    Search across tracked repositories by name or description