aradotso avatar

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-code

Installs 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
1quodsoler avatarue-ai-navigationquodsoler/unreal-engine-skillsUse this skill when implementing AI, AIController, behavior tree, blackboard, AI perception, NavMesh, EQS, navigation, pathfinding, State Tree, or Smart Objects1.3Kskills.sh installs
2neolabhq avatarsetup-serena-mcpneolabhq/context-engineering-kitGuide for setup Serena MCP server for semantic code retrieval and editing capabilities1.3Kskills.sh installs
3ruvnet avataragent-spec-mobile-react-nativeruvnet/rufloAgent skill for spec-mobile-react-native - invoke with $agent-spec-mobile-react-native1.3Kskills.sh installs
4ruvnet avataragent-trading-predictorruvnet/rufloAgent skill for trading-predictor - invoke with $agent-trading-predictor1.3Kskills.sh installs
5neolabhq avatarapply-anthropic-skill-best-practicesneolabhq/context-engineering-kitComprehensive guide for skill development based on Anthropic's official best practices - use for complex skills requiring detailed structure1.2Kskills.sh installs
6ruvnet avataragent-analyze-code-qualityruvnet/rufloAgent skill for analyze-code-quality - invoke with $agent-analyze-code-quality1.2Kskills.sh installs