New advertisers: 50% off your first month with code FIRSTMONTHSee slots
reason-machines avatar

Nanochat Llm Training

Train a GPT-2-class LLM for about $48 with nanochat's minimal, hackable end-to-end harness.

skills.sh installs
1.3K
GitHub stars
98
last updated
Jul 14, 2026
View on GitHub

What it does

  • Covers tokenization, pretraining, SFT finetuning, RL, DCLM CORE evaluation, KV-cache inference, and a chat UI
  • Uses a single --depth dial that auto-derives width, heads, learning rate, training horizon, and weight decay
  • Provides runs/speedrun.sh for the 8×H100 reference pipeline, plus CPU/Apple Silicon and single-GPU paths
  • Designed for researchers and hobbyists who want a readable training stack they can modify and reproduce

Install

$ npx -y skills add reason-machines/trending-skills --skill nanochat-llm-training -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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)

Details

Repository
github.com/reason-machines/trending-skills
Categories
AI Agents & LLM Apps, Data Science & Analytics
First seen
Apr 16, 2026

More from reason-machines/trending-skills

All 163

Similar to Nanochat Llm Training

More AI Agents & LLM Apps