Repository:karpathy/nanoGPT
nanoGPT: Minimalist Repository for Training and Fine-Tuning GPTs
nanoGPT by Andrej Karpathy is a lean and fast codebase designed for training and fine-tuning medium-sized GPT models in PyTorch. Developed as a rewrite of minGPT, it can reproduce GPT-2 (124M). As of November 2025, the repository is officially marked as deprecated by the author, who recommends nanochat instead.
62.8kstarsPython
From X post: Weekend Project: Training a GPT-2-Level Model from Scratch
