← all repositories
HandsOnLLM/Hands-On-Large-Language-Models

26K stars for a book that draws you pictures of transformers

The official repo for the O'Reilly "Illustrated LLM Book" — 300 custom figures and runnable notebooks for every chapter.

26.8k stars Jupyter Notebook Learning
Hands-On-Large-Language-Models
Velocity · 7d
+38
★ / day
Trend
steady
star history

What it does This repository houses the code companion to Jay Alammar and Maarten Grootendorst’s O’Reilly book. Twelve Jupyter notebooks cover the full arc from token embeddings and transformer internals through prompt engineering, RAG, multimodal models, and fine-tuning both representation and generation models. Each chapter opens directly in Google Colab with one click.

The interesting bit The authors call it “The Illustrated LLM Book” for a reason — nearly 300 hand-crafted figures attempt to make attention mechanisms and state-space models visually legible. In a field drowning in arXiv papers, the bet is that a well-drawn diagram beats a wall of equations.

Key highlights

  • 12 chapter notebooks, Colab-ready, tested on free T4 GPUs
  • Covers embeddings, classification, clustering, semantic search, RAG, multimodal LLMs, and fine-tuning BERT / generation models
  • Bonus visual guides post-publication: Mamba, quantization, Mixture of Experts, reasoning LLMs, DeepSeek-R1
  • Local setup guides included (conda, PyTorch)
  • Endorsements from Andrew Ng, Nils Reimers, and the creator of UMAP

Caveats

  • Results may vary slightly by OS, Python version, and dependency drift; the authors flag this explicitly
  • “All examples were mainly built and tested using Google Colab” — your local mileage may vary

Verdict Worth bookmarking if you’re teaching yourself LLMs or need explainable code to pair with theory. Skip it if you already live in the Hugging Face ecosystem and want production patterns, not pedagogy.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.