# karpathy/nanochat

The best ChatGPT that $100 can buy.

Repository: https://github.com/karpathy/nanochat
Canonical: https://ross.abutalabs.com/products/nanochat
Language: Python
License: MIT
License Family: permissive
Last push: 2026-08-02T21:05:23+00:00

## Health v2 (maintenance only)
Score: 60/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 95, release rhythm 35, longevity 23
- inputs: {"age_days": 324, "days_push": 31, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 57548, forks 8005 (observed 2026-08-28T04:12:18.550247+00:00)

## What it is
nanochat is a minimal, hackable full-stack LLM training harness that covers tokenization, pretraining, finetuning, evaluation, and inference on a single GPU node. It lets users train GPT-2-capability models for tens of dollars and chat with them via a CLI, with a single complexity dial controlling model scale.

## Use cases
- train my own GPT-2 from scratch on a single GPU node
- learn how LLM pretraining and finetuning work end to end
- run a cheap ChatGPT-like model for under $100
- benchmark how fast I can train a GPT-2 quality model
- experiment with compute-optimal transformer hyperparameters
- fine-tune and evaluate a small language model
- chat with a model I trained myself over a CLI

## When to choose
- you want a minimal, readable codebase covering the full LLM training pipeline
- you have access to a single 8xH100 GPU node and want to train small GPT models cheaply
- you are learning how tokenization, pretraining, SFT, evaluation, and inference fit together
- you want to compete on the GPT-2 speedrun leaderboard

## When to avoid
- you need production-grade distributed training across many nodes
- you want to train frontier-scale models with advanced features like MoE or RLHF pipelines
- you need a polished inference server or managed API
- you have no GPU access, since the whole point is GPU training

## Facets
- artifact type: framework
- maturity: active
- function: llm-training, llm-inference, machine-learning, deep-learning, cli
- domain: large-language-models, deep-learning, machine-learning, artificial-intelligence, developer-tools, education
- platform: python, cli
- tags: gpt-2, speedrun, transformer, pretraining, finetuning, single-node, h100, scaling-laws, chatgpt-clone, educational, tokenization, gpu, linux

## Member repositories
- karpathy/nanochat (main) score 60

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:12:18.550247+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T16:18:30.223811+00:00, confidence not recorded.
  - readme: https://github.com/karpathy/nanochat (fetched 2026-08-28T04:12:18.550247+00:00, sha dacb58ac9a08)
- Data as of 2026-08-30T08:39:29.467469+00:00.
