Back to directory

Hands-On Large Language Models

The official code repository for the O'Reilly book Hands-On Large Language Models, with runnable notebooks for every chapter's examples.

Hands-On Large Language Models

Hands-On Large Language Models is the official code repository for the O'Reilly book of the same name, written by Jay Alammar and Maarten Grootendorst. It contains the notebooks for all of the book's examples, illustrated with close to 300 custom figures.

The twelve chapters cover an introduction to language models, tokens and embeddings, looking inside transformer LLMs, text classification, text clustering and topic modeling, prompt engineering, advanced text generation, semantic search and retrieval-augmented generation, multimodal LLMs, creating text embedding models, and fine-tuning representation and generation models.

The examples are designed to run on Google Colab's free GPU tier, though other cloud providers and a local conda-based setup also work.

More in Books

See all 105
  • A long technical guide to AI agent memory: why stateless LLMs need it, the different memory architectures from vector stores to knowledge graphs, and how Cognee implements one as an open-source memory layer.

  • Samizdat

    rare-books.vercel.app

    A free, curated shelf of rare internal memos, leaked handbooks, and out-of-print books from technology and business history, collected for builders to read or borrow.

  • A free, web-only book that explains AI systems, from raw compute to a deployed and governed behavior, design-first, for a software engineer who knows distributed systems but is new to machine learning.