nanochat
Source
- Source kind:
github-repository - URL: https://github.com/karpathy/nanochat
- Discovery source: https://github.com/karpathy/nanochat
- License:
MIT - Distribution policy:
public-summary-plus-license-aware-excerpts - Public mirror status:
partial excerpt - Content hash:
8af3544b26ed787f1f0a3c2dec602e7b606331727f2f03b2377984c79555a817 - First seen: 2026-05-15
- Last changed: 2026-05-15
Classification
- Primary category: LLM training and inference systems
- Corpus source note: 2026-05-15-karpathy-public-corpus
- Project taxonomy: karpathy-project-taxonomy
- Idea map: karpathy-idea-map
- Topic hub: karpathy-public-work
Summary
nanochat !1 nanochat is the simplest experimental harness for training LLMs. It is designed to run on a single GPU node, the code is minimal/hackable, and it covers all major LLM stages including tokenization, pretraining, finetuning, evaluation, inference, and a chat UI. For example, you can train your own GPT-2 capability LLM (which cost ~48 (~2 hours of 8XH100 GPU node) and then talk to it in a familiar ChatGPT-like web UI. On a spot instance, the total cost can be closer to ~$15. More generally, nanochat is configured out of the box to train an entire miniseries of com…
What This Teaches
- How modern LLM training or inference can be reduced to compact, inspectable systems.
- Useful as a reference for building mental models of GPT-style models without hiding behind framework scale.
Why It Matters
This is high-priority for Vipin because it connects directly to LLM systems, evaluation, and research implementation judgment.
Repository Snapshot
- Full name:
karpathy/nanochat - Default branch:
master - HEAD:
dc54a1a3077cab11d68fac4c5d1cd5c51f5d8c7a - Stars at crawl: 53492
- Forks at crawl: 7192
- File count: 56
- README path:
README.md - License path:
LICENSE - Created: 2025-10-13T13:46:35Z
- Updated: 2026-05-15T21:47:22Z
- Pushed: 2026-05-05T03:17:23Z
Top-Level Structure
nanochat: 17dev: 9scripts: 9tasks: 8[root]: 6runs: 4tests: 2.claude: 1
File Extension Profile
.py: 36.md: 4.sh: 4.html: 2.ipynb: 2.png: 2.gitignore: 1.lock: 1.python-version: 1.svg: 1.toml: 1[none]: 1
Tags / Release-Like Markers
- No git tags found in the shallow local clone.
Sample File Tree
.claude/skills/read-arxiv-paper/SKILL.md.gitignore.python-versiondev/estimate_gpt3_core.ipynbdev/gen_synthetic_data.pydev/generate_logo.htmldev/LEADERBOARD.mddev/LOG.mddev/nanochat.pngdev/repackage_data_reference.pydev/scaling_analysis.ipynbdev/scaling_laws_jan26.pngLICENSEnanochat/__init__.pynanochat/checkpoint_manager.pynanochat/common.pynanochat/core_eval.pynanochat/dataloader.pynanochat/dataset.pynanochat/engine.pynanochat/execution.pynanochat/flash_attention.pynanochat/fp8.pynanochat/gpt.pynanochat/logo.svgnanochat/loss_eval.pynanochat/optim.pynanochat/report.pynanochat/tokenizer.pynanochat/ui.htmlpyproject.tomlREADME.mdruns/miniseries.shruns/runcpu.shruns/scaling_laws.shruns/speedrun.shscripts/base_eval.pyscripts/base_train.pyscripts/chat_cli.pyscripts/chat_eval.pyscripts/chat_rl.pyscripts/chat_sft.pyscripts/chat_web.pyscripts/tok_eval.pyscripts/tok_train.pytasks/arc.pytasks/common.pytasks/customjson.pytasks/gsm8k.pytasks/humaneval.pytasks/mmlu.pytasks/smoltalk.pytasks/spellingbee.pytests/test_attention_fallback.pytests/test_engine.pyuv.lock
Public Handling Notes
- EXTRACTED: This page records public metadata and a source-grounded summary.
- INFERRED: Full local preservation, when available, is for private/local use unless a license or explicit source policy makes public redistribution safe.
- Do not treat this page as permission to republish unlicensed source text or code wholesale.