nanoGPT

Minimal PyTorch codebase for training and fine-tuning medium-sized GPTs, reproducing GPT-2 on OpenWebText.

Open SourceSelf HostedOffline CapableGPU Required
0.0 (0)

About

Two files of about 300 lines each, model.py and train.py, are the entire core of nanoGPT, Andrej Karpathy's minimal codebase for training and fine-tuning medium-sized GPTs. It reproduces the 124M-parameter GPT-2 on OpenWebText in about four days on an 8xA100 40GB node, loads OpenAI's released GPT-2 checkpoints for fine-tuning, and scales down to a character-level Shakespeare model that trains in minutes on a single GPU or even a CPU. Dependencies are just PyTorch, NumPy, transformers, datasets, tiktoken, wandb, and tqdm, with PyTorch 2.0 compilation on by default, and multi-node training works over DDP. The MIT-licensed repository has around 61,700 stars and spawned an active speedrun community that competes on wall-clock time to GPT-2 quality. A README notice added in late 2025 steers newcomers to the full-stack successor nanochat, but nanoGPT remains the standard teaching codebase for LLM pretraining: readable in an afternoon, hackable by design, and the starting point for countless research forks, ports, and educational videos.

Reviews (0)

Leave a Review

No reviews yet. Be the first to review!

Details

Price
Free
Platform
Local/Desktop
Difficulty
Intermediate (3/5)
License
MIT
Added
Jul 29, 2026

Related Tools

Framework for generating synthetic data and AI feedback through composable LLM pipelines.

Open SourceSelf HostedOffline
Intermediate
0.0 (0)

Subject-driven fine-tuning technique for personalizing diffusion models.

Open SourceSelf HostedOfflineGPU 8GB+
Intermediate
0.0 (0)

Video model fine-tuning toolkit by Hugging Face Diffusers team.

Open SourceSelf HostedOfflineGPU 16GB+
Advanced
0.0 (0)

Efficient LLM quantization preserving important weight channels.

Open SourceSelf HostedOfflineGPU 8GB+
Intermediate
0.0 (0)

All-in-one Stable Diffusion fine-tuning tool with intuitive GUI.

Open SourceSelf HostedOfflineGPU 8GB+
Easy
0.0 (0)

No-code tool by Hugging Face for training ML models automatically.

Open SourceSelf HostedOfflineGPU 8GB+
Beginner
0.0 (0)
Browse all Model Training & Fine-Tuning tools