nanochat
A minimal, hackable codebase for training your own small ChatGPT-style model on a single GPU node. It covers tokenizing, pretraining, finetuning, evaluation and chat inference at low cost.
Share on XLicense: MIT
Overview
nanochat is a minimal, hackable harness for training your own small ChatGPT-style language model on a single GPU node. It covers tokenization, pretraining, finetuning, evaluation and inference, and lets you chat with the result through a simple command line interface. One setting, depth, which is the number of transformer layers, drives the other hyperparameters automatically. The README says a GPT-2 level model can be trained for about 48 dollars in roughly two hours on an 8XH100 node.
Key features
- Covers tokenization, pretraining, finetuning, evaluation and inference
- Runs on a single GPU node with minimal code
- One depth setting derives the other hyperparameters
- Chat with the trained model from a simple CLI
Best for
Good for learners and researchers who want to understand and modify the full LLM training pipeline at low cost. It maintains a leaderboard for GPT-2 speedruns.
- Upstream
- karpathy/nanochat
- Fork on GitHub
- Guo-astro/nanochat
- Upstream stars
- 58k
- Category
- AI agents and LLM tools
- Language
- Python
- License
- MIT
- Forked
- 2025-10-14
- Sync status
- In syncLast synced 2026-09-29
More in AI agents and LLM tools
A free desktop app where children in non-English-speaking countries practice English speaking and listening by talking with an AI companion. It can run locally and offline.
Forked 2026-09-28Last synced 2026-09-29License: MITAI agents and LLM toolsGitHub
An agent skill for Chinese patents. It helps find patentable points, write disclosure documents, explain patents in plain language, follow policy changes and assist with examination replies.
Forked 2026-09-28Last synced 2026-09-29License: MITAI agents and LLM toolsGitHub
A minimal Python library from Hugging Face for building AI agents that write and run code to solve tasks. It lets you set up capable agents in a few lines.
Forked 2026-09-28Last synced 2026-09-29License: Apache-2.0AI agents and LLM toolsGitHub
An open-source benchmark that measures how well AI agents handle realistic legal work. It provides tasks and evaluation for improving legal agents.
Forked 2026-09-28Last synced 2026-09-29License: MITAI agents and LLM toolsGitHub