Product Information
What is Nanogpt?
The simplest and fastest repository for training/finetuning medium-sized GPTs. This is a rewrite of MinGPT that prioritizes teeth over education. Still under active development, but currently, train.py reproduces GPT-2 (124M) on OpenWebText in about 4 days of training on a single 8xA100 40GB node. The code itself is simple and readable: train.py is a ~300-line boilerplate training loop, and model.py is a ~300-line GPT model definition that optionally loads OpenAI’s GPT-2 weights. That’s it. Since the code is so simple, it’s easy to hack to your needs, train new models from scratch, or checkpoint budgets (e.g., currently, the largest model available as a starting point is OpenAI’s GPT-2 1.3B model).
How to use Nanogpt?
nanoGPT is a concise and fast code library specifically designed for training and fine-tuning medium-sized GPT models. It provides an easy-to-modify platform to help users train new models from scratch or fine-tune pre-trained models.
Core Functions of Nanogpt
Python-based, AI-driven
Usage Scenarios of Nanogpt
- Train or fine-tune medium-sized GPT models.
- Reproduce the training of GPT-2 models (e.g., the 124M version) on the OpenWebText dataset.
- Train new language models from scratch.
- Fine-tune pre-trained GPT model checkpoints, such as OpenAI's GPT-2 1.3B model.
Common Questions about Nanogpt
What does nanoGPT do?
How do I use nanoGPT?
What are the core features of nanoGPT?
What are the use cases for nanoGPT?



















