Learn AI with Karpathy’s open-source projects
A practical path from neural networks and tokenization to language-model training and AI-assisted experiments.
Before you start
These are learning resources and research code, not assistant plugins. The commands below clone the source in a terminal; read each README for installation, data and runtime requirements before running anything. Training may require a GPU and cloud computing can cost money.
1. micrograd
A small Python automatic differentiation engine and neural-network library. Study backpropagation; the README also documents pip install micrograd.
git clone https://github.com/karpathy/micrograd.git
cd micrograd2. nn-zero-to-hero
A video course with notebooks and exercises, starting with Python and basic calculus. Start with the first lecture in the README; cloning the notebooks is optional.
git clone https://github.com/karpathy/nn-zero-to-hero.git
cd nn-zero-to-hero3. minbpe
A minimal implementation of byte-pair encoding for understanding tokenizers. Read the examples and exercise; some examples need additional Python packages.
git clone https://github.com/karpathy/minbpe.git
cd minbpe4. nanoGPT
A GPT training and fine-tuning codebase. The author calls it old and deprecated and points readers to nanochat; use it as a historical learning reference.
git clone https://github.com/karpathy/nanoGPT.git
cd nanoGPT5. llm.c
Language-model training implemented in C and CUDA. Read the README for CPU and GPU paths; GPU examples require suitable NVIDIA and CUDA tooling.
git clone https://github.com/karpathy/llm.c.git
cd llm.c6. nanochat
An experimental language-model workflow covering tokenization, training, evaluation and inference. The documented full training example uses substantial GPU resources; see the README for CPU options and hardware requirements.
git clone https://github.com/karpathy/nanochat.git
cd nanochat7. autoresearch
AI-agent experiments that modify and test a training program. The official implementation requires a single NVIDIA GPU and lists Python and uv requirements; model usage and compute can incur costs.
git clone https://github.com/karpathy/autoresearch.git
cd autoresearch