# nanochat

> The best ChatGPT that $100 can buy

Source: https://talira.ai/catalog/nanochat-cm4xw7vw
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Framework, Command-line tool
- Categories: [ai / ml / distributed training](https://talira.ai/categories/ai/ml/distributed-training), [ai / ml / fine tuning](https://talira.ai/categories/ai/ml/fine-tuning), [languages / python](https://talira.ai/categories/languages/python)
- Licence: MIT[^2]
- Pricing: Free and open source[^2]
- Free tier: yes[^2]
- Backed by: [Andrej Karpathy](https://talira.ai/orgs/andrej-karpathy.md)

nanochat is a minimal, hackable harness from Andrej Karpathy for training a small language model end to end on a single GPU node: tokenization, pretraining, finetuning, evaluation and inference, then chatting with the result from a command line. One setting, the transformer's depth, sets every other hyperparameter so each model comes out compute-optimal, and its speedrun script trains a GPT-2-capability model in about two hours on an 8×H100 node. It runs on a single GPU too, more slowly, and the project keeps a public leaderboard of time to GPT-2.

## Links

- GitHub: https://github.com/karpathy/nanochat

## Problems it solves

- train my own small ChatGPT-style model from scratch on a budget
- learn how a language model is pretrained and finetuned end to end with readable code
- reproduce GPT-2 level training on a single GPU node

## Features

- Tokenization, pretraining, finetuning, evaluation and inference in one codebase
- One --depth setting derives every other hyperparameter
- Speedrun script for a GPT-2-capability model on one 8×H100 node
- Chat with the trained model from the command line
- Runs on a single GPU with gradient accumulation

## Limitations

- Built for 80 GB GPUs: smaller cards need the device batch size lowered to avoid running out of memory[^1]

## Trust

Overall: 0.50 out of 1.
Signals: maintenance 0.27, adoption 0.96, momentum 1.00, community 0.70, backing 0.30, extensibility 0.00.

- 60.9k GitHub stars
- 56 contributors
- backed by Andrej Karpathy

Warnings:

- last commit 4 months ago

## Related

- Successor of [nanoGPT](https://talira.ai/catalog/nanogpt-yz7a3e6v.md)

## Alternatives

- [MiniMind](https://talira.ai/catalog/minimind-7eb46pp5.md): Train a 64M-parameter language model from scratch in about two hours
- [Colossal-AI](https://talira.ai/catalog/colossal-ai-gk5zdz5s.md): PyTorch library for distributed training, fine-tuning and inference of large AI models

## Sources

[^1]: https://github.com/karpathy/nanochat/blob/master/README.md (checked 27 Nov 2026)
[^2]: https://github.com/karpathy/nanochat/blob/master/LICENSE (checked 27 Nov 2026)
