ランキングに戻る

HandsOnLLM/Hands-On-Large-Language-Models

Jupyter Notebookllm-book.com

Official code repo for the O'Reilly Book - "Hands-On Large Language Models"

artificial-intelligencebooklarge-language-modelsllmllmsoreillyoreilly-books
スター成長
スター
27.7k
フォーク
6.4k
週間成長
Issue
23
10k20k
25年9月25年12月26年4月26年7月
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.

Chapter Notebook
Chapter 1: Introduction to Language Models Open In Colab
Chapter 2: Tokens and Embeddings Open In Colab
Chapter 3: Looking Inside Transformer LLMs Open In Colab
Chapter 4: Text Classification Open In Colab
Chapter 5: Text Clustering and Topic Modeling Open In Colab
Chapter 6: Prompt Engineering Open In Colab
Chapter 7: Advanced Text Generation Techniques and Tools Open In Colab
Chapter 8: Semantic Search and Retrieval-Augmented Generation Open In Colab
Chapter 9: Multimodal Large Language Models Open In Colab
Chapter 10: Creating Text Embedding Models Open In Colab
Chapter 11: Fine-tuning Representation Models for Classification Open In Colab
Chapter 12: Fine-tuning Generation Models Open In Colab

[!TIP] You can check the setup folder for a quick-start guide to install all packages locally and you can check the conda folder for a complete guide on how to setup your environment, including conda and PyTorch installation. Note that the depending on your OS, Python version, and dependencies your results might be slightly differ. However, they should this be similar to the examples in the book.

Reviews

"Jay and Maarten have continued their tradition of providing beautifully illustrated and insightful descriptions of complex topics in their new book. Bolstered with working code, timelines, and references to key papers, their book is a valuable resource for anyone looking to understand the main techniques behind how Large Language Models are built."

Andrew Ng - founder of DeepLearning.AI


"This is an exceptional guide to the world of language models and their practical applications in industry. Its highly-visual coverage of generative, representational, and retrieval applications of language models empowers readers to quickly understand, use, and refine LLMs. Highly recommended!"

Nils Reimers - Director of Machine Learning at Cohere | creator of sentence-transformers


"I can’t think of another book that is more important to read right now. On every single page, I learned something that is critical to success in this era of language models."

Josh Starmer - StatQuest


"If you’re looking to get up to speed in everything regarding LLMs, look no further! In this wonderful book, Jay and Maarten will take you from zero to expert in the history and latest advances in large language models. With very intuitive explanations, great real-life examples, clear illustrations, and comprehensive code labs, this book lifts the curtain on the complexities of transformer models, tokenizers, semantic search, RAG, and many other cutting-edge technologies. A must read for anyone interested in the latest AI technology!"

Luis Serrano, PhD - Founder and CEO of Serrano Academy


"Hands-On Large Language Models brings clarity and practical examples to cut through the hype of AI. It provides a wealth of great diagrams and visual aids to supplement the clear explanations. The worked examples and code make concrete what other books leave abstract. The book starts with simple introductory beginnings, and steadily builds in scope. By the final chapters, you will be fine-tuning and building your own large language models with confidence."

Leland McInnes - Researcher at the Tutte Institute for Mathematics and Computing | creator of UMAP and HDBSCAN


Bonus content!

We attempted to put as much information into the book without it being overwhelming. However, even with a 400-page book there is still much to discover!

We continue to create more guides that compliment the book and go more in-depth into new and exciting topics:

A Visual Guide to Mamba A Visual Guide to Quantization The Illustrated Stable Diffusion
A Visual Guide to Mixture of Experts A Visual Guide to Reasoning LLMs The Illustrated DeepSeek-R1

Citation

Please consider citing the book if you consider it useful for your research:

@book{hands-on-llms-book,
  author       = {Jay Alammar and Maarten Grootendorst},
  title        = {Hands-On Large Language Models},
  publisher    = {O'Reilly},
  year         = {2024},
  isbn         = {978-1098150969},
  url          = {https://www.oreilly.com/library/view/hands-on-large-language/9781098150952/},
  github       = {https://github.com/HandsOnLLM/Hands-On-Large-Language-Models}
}
関連リポジトリ
Significant-Gravitas/AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

PythonPyPIOtheraiopenai
agpt.co
185.6k46.1k
f/prompts.chat

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

HTMLOtherchatgptai
prompts.chat
166.1k21.5k
rasbt/LLMs-from-scratch

Implement a ChatGPT-like LLM in PyTorch from scratch, step by step

Jupyter NotebookOthergptlarge-language-models
amzn.to/4fqvn0D
99.5k15.3k
hacksider/Deep-Live-Cam

real time face swap and one-click video deepfake with only a single image

PythonPyPIGNU Affero General Public License v3.0ai-facedeepfake
deeplivecam.net
95k13.8k
thedotmack/claude-mem

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

JavaScriptnpmApache License 2.0aiai-agents
claude-mem.ai
88k7.6k
OpenHands/OpenHands

🙌 OpenHands: AI-Driven Development

PythonPyPIOtheragentartificial-intelligence
openhands.dev
81.4k10.4k
FlowiseAI/Flowise

Build AI Agents, Visually

TypeScriptnpmOtherartificial-intelligencechatgpt
flowiseai.com
54.8k24.7k
jingyaogong/minimind

🧠「大模型」2小时完全从0训练64M的小参数LLM!Train a 64M-parameter LLM from scratch in just 2h!

PythonPyPIApache License 2.0artificial-intelligencelarge-language-model
jingyaogong.github.io/minimind
53.7k7k
microsoft/AI-For-Beginners

12 Weeks, 24 Lessons, AI for All!

Jupyter NotebookMIT Licensedeep-learningartificial-intelligence
52.5k10.6k
All-Hands-AI/OpenHands

🙌 OpenHands: Code Less, Make More

PythonPyPIMIT Licenseagentartificial-intelligence
all-hands.dev
49.7k5.5k
Kong/kong

🦍 The API and AI Gateway

LuaApache License 2.0api-gatewaymicroservices
konghq.com/install/
43.8k5.2k
usestrix/strix

Open-source AI penetration testing tool to find and fix your app’s vulnerabilities.

PythonPyPIApache License 2.0agentsartificial-intelligence
strix.ai
43k4.4k