
Nanochat Llm Training
Karpathy's minimal harness for training your own GPT-2 grade model on a single 8×H100 node in about 2 hours for ~$48. The entire pipeline is here: tokenization, pretraining, finetuning, evaluation against DCLM CORE, and a chat UI. The depth dial is clever, one parameter auto-configures width, heads, learning rate, and training horizon for compute-optimal runs. Depth 12 gets you GPT-1 scale in 5 minutes for fast iteration, depth 26 reproduces GPT-2 capability. It's genuinely hackable, explicit dtype management instead of autocast, and the code is readable enough to fork and modify. Good for anyone who wants to understand LLM training end to end without framework abstraction getting in the way.
- skills.sh installs
- 1.3K
- GitHub stars
- 61
- last updated
- Jul 14, 2026
Install
$ npx -y skills add aradotso/trending-skills --skill nanochat-llm-training --agent claude-codeInstalls into .claude/skills of the current project.
Files
nanochat LLM Training
Skill by ara.so — Daily 2026 Skills collection.
nanochat is Karpathy's minimal, hackable harness for training LLMs end-to-end on a single GPU node. It covers tokenization, pretraining, SFT finetuning, RL, evaluation (DCLM CORE score), inference with KV cache, and a ChatGPT-like web UI. A single complexity dial (--depth) auto-configures all other hyperparameters (width, heads, LR, training horizon, weight decay) for compute-optimal training. You can reproduce GPT-2 capability (~$43,000 in 2019) for ~$48 on an 8×H100 node (~2 hours).
Installation
nanochat uses uv for dependency management:
git clone https://github.com/karpathy/nanochat.git
cd nanochat
# Install uv if needed
curl -LsSf https://astral.sh/uv/install.sh | sh
# Create venv and install deps
uv sync
source .venv/bin/activate
Key Commands
Full GPT-2 Speedrun (8×H100 node, ~2–3 hours, ~$48)
# Run the reference pipeline: data download, pretraining, SFT, eval, chat
bash runs/speedrun.sh
Pretraining (distributed)
Sponsors
Details
- Repository
- github.com/aradotso/trending-skills
- Category
- AI & Agent Building
- First seen
- Apr 16, 2026
More from aradotso/trending-skills
All 251- Open Autoglm Phone Agent1.3K
- Openclaw Rl Training1.3K
- Openviking Context Database1.3K
- Picoclaw Ai Assistant1.3K
- Posterskill Academic Posters1.3K
- Tavily Key Generator Proxy1.3K
- Toon Format1.3K
- Translate Book Parallel1.3K
- Trump Code Market Signals1.3K
- Vinext Vite Nextjs1.3K
- Voicebox Voice Synthesis1.3K
- Aracli Deploy Management1.2K
- Codex Autoresearch Loop1.2K
- Fabro Workflow Factory1.2K
- Grimmory Self Hosted Library1.2K
- Keyid Agent Kit Mcp1.2K
- Kimodo Motion Diffusion1.2K
- Nightingale Karaoke1.2K
- Openhanako Personal Ai Agent1.2K
- Slug Font Rendering1.2K
- Taiwan Md Knowledge Base1.2K
- Witr Process Inspector1.2K
- Zeroboot Vm Sandbox1.2K
- Code Review Graph1.1K