From Tokenizers to Fine-Tuning, Drawn and Coded
Companion notebooks that turn a visual LLM textbook into runnable Python, chapter by chapter.

What it does This repository holds the official Jupyter notebooks for Hands-On Large Language Models, the O’Reilly guide by Jay Alammar and Maarten Grootendorst. The twelve chapters walk from tokenization and transformer internals through text classification, semantic search, RAG, multimodal models, and fine-tuning—each paired with almost 300 custom figures designed to make the mechanics visible.
The interesting bit The authors treat visualization as a first-class teaching tool, not decoration. The repo also extends the 400-page book with bonus visual guides to post-publication topics like Mamba, Mixture of Experts, and DeepSeek-R1—content that literally wouldn’t fit between the covers.
Key highlights
- Twelve chapter notebooks covering the full LLM lifecycle, from embeddings to generation-model fine-tuning
- Nearly 300 custom figures meant to illustrate transformer mechanics and practical pipelines
- Optimized for Google Colab free-tier T4 GPUs, with local setup guides available
- Bonus illustrated guides to quantization, reasoning LLMs, and recent architectures
Caveats
- Results can drift slightly depending on your OS, Python version, and dependency stack
- Notebooks are built and tested primarily on Google Colab; other providers should work but are not the stable target
Verdict Worth bookmarking if you learn best by combining diagrams with live experiments. If you already ship production LLM pipelines and rarely need to explain attention heads to anyone, it is probably too introductory.
Frequently asked
- What is HandsOnLLM/Hands-On-Large-Language-Models?
- Companion notebooks that turn a visual LLM textbook into runnable Python, chapter by chapter.
- Is Hands-On-Large-Language-Models open source?
- Yes — HandsOnLLM/Hands-On-Large-Language-Models is open source, released under the Apache-2.0 license.
- What language is Hands-On-Large-Language-Models written in?
- HandsOnLLM/Hands-On-Large-Language-Models is primarily written in Jupyter Notebook.
- How popular is Hands-On-Large-Language-Models?
- HandsOnLLM/Hands-On-Large-Language-Models has 27.7k stars on GitHub and is currently cooling off.
- Where can I find Hands-On-Large-Language-Models?
- HandsOnLLM/Hands-On-Large-Language-Models is on GitHub at https://github.com/HandsOnLLM/Hands-On-Large-Language-Models.