Hands-On-Large-Language-Models

HandsOnLLM/Hands-On-Large-Language-Models

Code repository for Hands-On Large Language Models

27k
Stars
6.4k
Forks
37
Open issues
276
Watchers
Jupyter Notebook Apache-2.0Last pushed Apr 24, 2026

Overview

This repository contains the code and Jupyter Notebook examples from Jay Alammar and Maarten Grootendorst’s O'Reilly publication 'Hands-On Large Language Models', providing practical insights into using Large Language Models.

Categories

Tags

Similar tools

Install

git clone https://github.com/HandsOnLLM/Hands-On-Large-Language-Models

README

Hands-On Large Language Models

Welcome! In this repository you will find the code for all examples throughout the book Hands-On Large Language Models written by Jay Alammar and Maarten Grootendorst which we playfully dubbed:

"The Illustrated LLM Book"

Through the visually educational nature of this book and with almost 300 custom made figures, learn the practical tools and concepts you need to use Large Language Models today!


The book is available on:

Table of Contents

We advise to run all examples through Google Colab for the easiest setup. Google Colab allows you to use a T4 GPU with 16GB of VRAM for free. All examples were mainly built and tested using Google Colab, so it should be the most stable platform. However, any other cloud provider should work.

ChapterNotebook
Chapter 1: Introduction to Language Models
Chapter 2: Tokens and Embeddings
Chapter 3: Looking Inside Transformer LLMs
Chapter 4: Text Classification
Chapter 5: Text Clustering and Topic Modeling
Chapter 6: Prompt Engineering
Chapter 7: Advanced Text Generation Techniques and Tools
Chapter 8: Semantic Search and Retrieval-Augmented Generation
Chapter 9: Multimodal Large Language Models
Chapter 10: Creat