Downloads · 30 days
0
sdobson/nanochat
nanochat is a text generation model from sdobson. Use it when you need the model to write or continue text. The card lists the license as mit.
nanochat is a 561M parameter transformer language model trained for conversational AI tasks. This model demonstrates that capable chat models can be trained efficiently on modest hardware budgets (~$100 on 8x H100 GPUs).
Downloads · 30 days
0
Access
Public
Updated Oct 15, 2025
Repo size
2.1 GB
Likes
30
Public
Click a slice to open those files.
.pt2.1 GB · 100%
From the Hugging Face model README
nanochat is a 561M parameter transformer language model trained for conversational AI tasks. This model demonstrates that capable chat models can be trained efficiently on modest hardware budgets (~$100 on 8x H100 GPUs).
Read about the process at https://samdobson.uk/posts/training-a-chatgpt-clone-for-cheap/
Chat with the model at https://huggingface.co/spaces/sdobson/nanochat
nanochat was trained in multiple stages:
The model was trained in three stages:
| Benchmark | Score | Description |
|---|---|---|
| MMLU | 23.99% | Multitask language understanding |
| GSM8K | 4.47% | Grade school math problems |
| HumanEval | 6.71% | Python code generation |
| ARC-Easy | 24.79% | Science questions (easy) |
| ARC-Challenge | 24.32% | Science questions (hard) |
| ChatCORE | 1.73% | Conversational reasoning |
nanochat is designed for:
The model can be fine-tuned for specific conversational tasks or used as a base model for further domain adaptation.
Simon Willison created a script to allow this to run on CPU on MacOS:
cd /tmp
git clone https://huggingface.co/sdobson/nanochat
uv run https://gist.githubusercontent.com/simonw/912623bf00d6c13cc0211508969a100a/raw/80f79c6a6f1e1b5d4485368ef3ddafa5ce853131/generate_cpu.py \
--model-dir /tmp/nanochat \
--prompt "Tell me about dogs."
Otherwise you can:
tokenizer.pkl and token_bytes.pt in ~/.cache/nanochat/tokenizermodel_000650.pt and meta_000650.json in ~/.cache/nanochat/chatsft_checkpoints/d20uv sync followed by uv run python -m scripts.chat_webRepository: github.com/karpathy/nanochat
@software{nanochat2025,
author = {Karpathy, Andrej},
title = {nanochat: A 561M parameter conversational language model},
year = {2025},
url = {https://github.com/karpathy/nanochat}
}
Sam Dobson