---
title: "What is nanochat? Andrej Karpathy's full-stack LLM, explained"
canonical_url: "https://cognilium.ai/blogs/introducing-nanochat"
slug: "introducing-nanochat"
section: "blogs"
date_published: "2026-09-10"
date_modified: "2026-09-10"
word_count: 963
reading_time_minutes: 4
author: "Mudassir Marwat"
author_identifier: "0009-0008-1927-2598"
person_same_as:
  - "https://www.linkedin.com/in/mudassir-marwat/"
  - "https://orcid.org/0009-0008-1927-2598"
  - "https://github.com/mudassirmarwat"
  - "https://medium.com/@mudassir-marwat"
  - "https://www.youtube.com/@mudassir-marwat"
  - "https://dev.to/mudassirmarwat"
  - "https://hashnode.com/@mudassirmarwat"
  - "https://huggingface.co/mudassirmarwat"
  - "https://bsky.app/profile/mudassir-marwat.bsky.social"
  - "https://substack.com/@mudassirmarwat"
  - "https://topmate.io/mudassirmarwat"
  - "https://fueler.io/mudassirmarwat"
  - "https://www.instagram.com/mudassirmarwat/"
  - "https://www.facebook.com/mudassir.marwat"
  - "https://www.reddit.com/user/mudassirmarwat/"
  - "https://www.f6s.com/member/mudassir-marwat"
  - "https://cognilium.ai/founder"
entities: []
related:
  - "https://cognilium.ai/blogs/production-llmops-stack"
  - "https://cognilium.ai/blogs/llm-judge-temperature-escalation-retry"
  - "https://cognilium.ai/blogs/smart-category-score-routing-cost"
---
# What is nanochat? Andrej Karpathy's full-stack LLM, explained

nanochat is Andrej Karpathy's minimal end-to-end ChatGPT clone: tokenizer, pretraining, fine-tuning, inference and a web UI in one small codebase you can read.

## Key takeaways

- nanochat is Andrej Karpathy's open-source, end-to-end implementation of a ChatGPT-style model, released October 2025.
- It covers the whole pipeline: tokenizer, pretraining, midtraining, supervised fine-tuning, optional reinforcement learning, inference and a web UI.
- The difference from nanoGPT is scope. nanoGPT stops after pretraining; nanochat goes to something you can talk to.
- The published speedrun target is roughly $100 and about four hours on an 8xH100 node, per the author. It is not a laptop project.
- The output is a demonstration, not a product. Any hosted model you can call is better at being a model.
- The value is that the pipeline is small enough to read, which is rare in published training code.

**nanochat is a complete, minimal implementation of a ChatGPT-style model, written by Andrej Karpathy and released as open source in October 2025.** One repository takes you from raw text to a chat interface you can talk to: tokenizer, pretraining, fine-tuning, inference, and a small web UI.

The point is not the model it produces. A model trained this way is not competitive with anything you would pay for. **The point is that the entire pipeline fits in one codebase small enough to read end to end**, which is a different and rarer thing.

*For engineers deciding whether it is worth their weekend. 7 minute read.*

## What is actually in the repository?

That list is the reason the project exists. Most educational LLM code stops after pretraining, which is the half that is well explained everywhere and the half that produces nothing you can use.

## Who made it, and why does that matter?

Andrej Karpathy: founding member of OpenAI, former director of AI at Tesla, and author of the teaching material a large share of working ML engineers learned from. nanoGPT, his earlier project, is one of the most forked educational repositories in the field.

That matters here for a practical reason rather than a reputational one. **Code written to be read is different from code written to work**, and very little published LLM training code is written to be read. The pedagogical intent is the feature.

## How is nanochat different from nanoGPT?

nanoGPT answers "how is a transformer trained". nanochat answers "how does a trained transformer become a product you can open in a browser", and that second question is where most people's understanding actually stops.

## What hardware does nanochat need?

This is the question most people arrive with, and the honest answer has two halves.

**The published target is a single 8xH100 node.** Karpathy describes a speedrun costing roughly $100 and taking around four hours on that hardware, which is a rented machine for an afternoon rather than a purchase.

**It is not a laptop project.** You can read every line on a laptop, and you can run the inference stage against a small model, but the pretraining stage assumes serious GPUs. Anyone planning to work through it should budget for rented compute rather than expect it to run locally.

Both figures above are the author's, from the project's own announcement. We have not reproduced them, and you should treat any cost quoted for a training run as a function of the hardware market on the day it was measured.

## What is it good for, and what is it not?

**Good for:** understanding the shape of the whole pipeline; seeing where each stage's data comes from; having a reference implementation small enough to modify and observe. If you have ever been unsure what "midtraining" means in practice, the answer is fifty lines here rather than a paper.

**Not good for:** producing a model to put in front of users. The result is a demonstration. Judged as a product it is worse than every free API you could call instead, and it is not trying to be otherwise.

> The value is the readable pipeline, not the weights that fall out of the end of it.

## Why would an engineering team care?

Because the failure modes in production retrieval and agent systems are usually not in the model. They are in the boundaries between stages, and this is the smallest artefact that shows every boundary at once: what the tokenizer decided, what pretraining saw, what fine-tuning changed, what inference does with a KV cache.

A team that has read one full pipeline end to end argues about the right things afterwards. That is worth an afternoon of rented GPUs whether or not you ever train anything again.

## Frequently asked questions

### Is nanochat free to use?

The code is open source. The compute is not. Reading and modifying it costs nothing; running the training pipeline means renting GPUs.

### Can I train nanochat on my own data?

Yes, and that is one of the more instructive things to do with it. The pipeline is small enough that swapping the corpus and observing what changes at each stage is tractable in a way it is not with a larger framework.

### Does nanochat compete with GPT or Claude?

No, and it is not intended to. It is a teaching implementation. The comparison to make is with other educational codebases, not with hosted models.

### What should I read first if I am new to this?

The tokenizer and the data pipeline. They are where most of the confusion about language models actually lives, and they are the stages that get skipped in favour of the model architecture.

---

Canonical HTML: https://cognilium.ai/blogs/introducing-nanochat
