Find tools › Open-source projects › Write code faster

nanochat

Open-source project · by karpathy

A simple codebase to build, train, and chat with your own AI model from scratch using graphics cards.

For developersVery popular

What it costs

Free and open source; you may pay for the AI model it uses.

Use it to

  • Train a custom GPT-2 grade model from scratch
  • Experiment with transformer scaling laws using depth settings
  • Chat with your self-trained AI model in the terminal

How to start

  1. Install dependencies using uv with uv sync --extra gpu or CPU mode.

  2. Activate your Python virtual environment using source .venv/bin/activate.

  3. Run the automated training speedrun script with bash runs/speedrun.sh.

  4. Chat with your trained model by running python -m scripts.chat_cli.

Good to know. Requires powerful hardware such as multi-GPU (8xH100 or 8xA100) clusters with substantial VRAM (80GB) to train GPT-2 sized models effectively; running on CPU or laptops produces severely limited models.

Before you install

  • Found automaticallyNot reviewed by a person yet. Check it before installing.
  • License: MITYou are allowed to use it under these terms.
  • Last updated 2026-09-07

More detail

A minimal, hackable experimental harness for training, evaluating, and chatting with custom language models on a single computer node.

Standard training codebases are complex and expensive; nanochat lets developers and researchers train a GPT-2 level model from scratch for under $50 in about two hours.

Similar tools

Descriptions are written in plain English from each project's own documentation and refreshed by our agent; this one was last checked 2026-11-02. Spotted a mistake? · Open in Find tools · © 2026 Which AI Map