Companion page

Large Language Models from the Ground Up

by Waseem Khan — everything the book links to, on one stable page. Bookmark this; the links below are kept current even as the material evolves.

▶ Run the book's code (free, nothing to install)

Every code chapter of the book is also a runnable notebook. Each “Open in Colab” link opens the notebook in Google Colab — press Copy to Drive, then run cells with Shift+Enter. (Free Google account required. Details: book Chapter 15 / Appendix A.)

🚀 Advanced companion notebooks (Parts V–VII)

✨ Interactive animations (Part I of the book)

The book's Part I topics — tokens, embeddings, attention, training, sampling — have animated, playable demos in the free web course: How LLMs Work (18 short lessons).

🧪 Interactive labs (the whole book)

Twenty-four small in-browser demos animate the book's trickiest mechanisms, from Part I's fundamentals to Part VIII's frontier scale — the book's "Watch it move" boxes point at these. Six highlights below; all 24 labs on one page →

🧪 Run Part III's code in the browser — no account at all

Chapters 17–22's NumPy code also runs directly on this site (Pyodide, in your browser): Build an LLM from Scratch — interactive course.

📦 All the source code

GitHub: github.com/wazeemlabs/llm-book-code — notebooks in llm-from-scratch/, one per code chapter. Download ZIP or git clone; local setup instructions are in the book's Appendix A.

🎓 For instructors

The book is written to support four quite different courses, and Appendix G sets out which chapters belong in each, what compute a department has to provide, and how to handle the fact that every ★ and ★★ answer is printed in Appendix B. The materials that can't ship inside a book are here:

Everything except the answer keys is a direct download. For those, email ceo@wazeem.com from an institutional address with a link to your course listing — the keys stay unpublished for the obvious reason. Reports of what worked and what didn't in your classroom are genuinely welcome, and shape the next edition.

✍️ About the author

Waseem Khan is a US Fulbright Scholar with a master's in public policy and data analytics from Carnegie Mellon University — where he made the Heinz College Dean's List — and a master's in computer science from NUST. In nearly two decades as a software and machine-learning engineer he has shipped Android apps with over a million downloads, and as a Deputy Commissioner in Pakistan's Inland Revenue Service built the fraud-detection and analytics systems that raised audit capacity twenty-fold. Today he works inside the LLM industry itself: leading a thirty-person team that creates and audits the training data used to teach frontier AI models to code and reason, and writing the PhD-level research problems used to train their deep-research modes — the very techniques the book explains.

Reach him at linkedin.com/in/wasxxm or ceo@wazeem.com — reader questions and corrections are genuinely welcome.

🐛 Errata & updates

Corrections and updates to the book are listed here as they're found. Spotted a problem? Open an issue: github.com/wazeemlabs/llm-book-code/issues.

No errata yet — this page was last updated for the first edition.