llm-101

LLM 101

LLM 101 is a visual, practical introduction to how large language models work.

Read the tutorial online:

Open LLM 101

What you will learn

The tutorial follows the path from a first language model to training a GPT:

The explanations are supported by small Python examples, real intermediate outputs, formulas, and visual diagrams. The goal is to make each step understandable before moving to the next one.

Who this is for

This tutorial is intended for readers who want an intuitive and implementation-oriented introduction to language models. Basic Python and linear algebra are helpful, but the material is introduced from first principles.

Start reading

Begin with Chapter 1: Building the Dataset, or use the navigation on the website to move through the chapters in order.

The source is available on GitHub.

Search indexing

The two title-only placeholders (Part 2, Chapters 15 and 16) use noindex, follow and are automatically excluded from the sitemap. Remove their indexing exclusion when adding substantive chapter content.

Deployment

The production site is hosted on Cloudflare Pages at the address above, with the site served from /. Connect the GitHub repository to Pages, select main as the production branch, set the build command to npm run build, and set the build output directory to build. Use Node.js 22 for builds. GitHub Pages deployment is no longer configured.

The optional page-view counter is a separate Worker. Its SITE_ORIGIN matches the production site; redeploy that Worker after changing its configuration. Set PAGE_VIEW_COUNTER_URL in the website build environment to enable the counter.