# karpathy/build-nanogpt

Video+code lecture on building nanoGPT from scratch

Repository: https://github.com/karpathy/build-nanogpt
Canonical: https://ross.abutalabs.com/products/build-nanogpt
Language: Python
License Family: other
Last push: 2024-08-13T12:28:52+00:00

## Health v2 (maintenance only)
Score: 24/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 58
- inputs: {"age_days": 815, "days_push": 750, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5461, forks 886 (observed 2026-08-28T04:09:19.458302+00:00)

## What it is
A step-by-step video lecture and companion code repository by Andrej Karpathy that builds a GPT-2 (124M) reproduction from an empty file, with clean git commits documenting each stage. It is an educational resource for learning how transformer language models are implemented and trained, not a production training framework.

## Use cases
- learn how GPT-2 works by building it from scratch
- follow a guided video lecture on training a small language model
- walk through git commits to see a transformer implemented incrementally
- reproduce GPT-2 124M training on a cloud GPU for about $10
- study PyTorch code for transformer training
- prepare for understanding LLM finetuning and SFT

## When to choose
- you want to deeply understand how GPT-style language models are built and trained
- you prefer learning through annotated, incremental code with video explanations
- you want a minimal, readable reference implementation of GPT-2 training

## When to avoid
- you need a production-ready LLM training framework with distributed scaling and finetuning
- you want a chat model - this covers pretraining only, not instruction tuning
- you need maintained software with a license or active feature development

## Facets
- artifact type: learning-resource
- maturity: stable
- function: llm-training, deep-learning, machine-learning
- domain: large-language-models, deep-learning, tutorials, machine-learning
- platform: python, cross-platform
- tags: educational, gpt-2, from-scratch, video-lecture, nanogpt, transformers, gpu

## Member repositories
- karpathy/build-nanogpt (main) score 24

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:19.458302+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-29T17:56:46.560776+00:00, confidence not recorded.
  - readme: https://github.com/karpathy/build-nanogpt (fetched 2026-08-28T04:09:19.458302+00:00, sha 0ecda7cb5690)
- Data as of 2026-08-30T08:39:29.467469+00:00.
