i ideas / repo launcher
karpathy avatar

karpathy/nanochat

★ 60,458PythonMIT75

The best ChatGPT that $100 can buy.

What it is

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, and inference. For example, you can train your own GPT-2 capability LLM (which cost $43,000 to train in 2019) for only $48 (2 hours of 8XH100 GPU node) and then talk to it over a simple CLI. 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 compute-optimal models by setting one single complexity dial: --depth, the number of layers in the GPT transformer model (GPT-2…

When to use it

Reach for nanochat when you need to call, serve, run locally, fine-tune or chat with a language model — it's written in Python and fits stacks tagged openai.

Category
LLM & Inference
Also in
—
Stars
60,458
Forks
8,477
Last push
2 months ago
Created
2025-10-13
Open issues
137
Website
—

Quick start

$ git clone https://github.com/karpathy/nanochat.git

Hand it to your AI

Read https://ideas.asveas.com/r/karpathy/nanochat.md and help me add karpathy/nanochat to my project. Explain the setup steps for my stack and show the minimal code to get it working.

Alternatives to nanochat

All LLM & Inference →

Pairs well with

FAQ

What is nanochat?

karpathy/nanochat is a LLM tool on GitHub: The best ChatGPT that $100 can buy. nanochat is the simplest experimental harness for training LLMs.

When should I use nanochat?

Reach for nanochat when you need to call, serve, run locally, fine-tune or chat with a language model — it's written in Python and fits stacks tagged openai.

What are the best alternatives to nanochat?

Popular alternatives in LLM & Inference: ollama/ollama (187k★), huggingface/transformers (169k★), open-webui/open-webui (158k★), langflow-ai/langflow (157k★), vllm-project/vllm (96.8k★).

Is nanochat actively maintained?

karpathy/nanochat looks actively maintained: the last push was 2 months ago (2026-09-07), with 60,458 stars and 137 open issues.

What license does nanochat use?

karpathy/nanochat is published under the MIT license. Check the repository's LICENSE file before commercial use.