← all repositories
bojieli/ai-infra-book

A Quantitative Textbook for the LLM Systems Stack

An open manuscript teaching developers to derive LLM inference and training systems from hardware constraints and first-principle math, not vendor marketing.

2.5k stars Python LearningInference · Serving
ai-infra-book
Collecting fresh signals — velocity needs a few days of history.
collecting data…
star history

What it does

This repository hosts the draft manuscript, PDF build pipeline, and Python calculation tools for a Chinese-language textbook on AI infrastructure. The author walks through twelve chapters—from accelerator architecture to datacenter networks—using back-of-the-envelope estimation to connect model behavior to physical limits like memory bandwidth and interconnect topology. A standalone Python tool lets readers plug in custom model parameters and token counts to reproduce or challenge the book’s resource estimates without needing a GPU.

The interesting bit

The book treats the LLM as the new operating system and AI infrastructure as the new computer architecture, arguing that optimization should start with the physical ceiling—how much data must move and who waits—then work backward to find where current systems leak time. It is the rare technical book that ships its own reproducible arithmetic and structured errata templates for when the math is wrong.

Key highlights

  • Twelve chapters covering the full stack: model architecture, inference optimization, distributed training, supernode scheduling, and edge-cloud tradeoffs.
  • A Python calculation tool using only the standard library, letting readers re-derive FLOP, memory, and bandwidth estimates for custom configs.
  • Chapter-matched experiments and case studies, some with recorded measurements and others runnable on GPU hardware.
  • PDF automatically built from Markdown via XeLaTeX with each source update, because GitHub’s LaTeX rendering is unreliable for dense formulas.
  • Explicitly a work in progress: the author welcomes corrections to arithmetic, skipped derivations, and missing mechanisms.

Caveats

  • The manuscript is currently Chinese-language only; translations are welcomed but not yet available.
  • Some experiments rely on Git LFS-hosted data (~20 GB total), though the text and static calculations do not.
  • The book assumes familiarity with Python, linear algebra, and basic computer systems concepts.

Verdict

Worth bookmarking if you build, tune, or benchmark LLM serving stacks and want a principled way to sanity-check whether your bottleneck is math, memory, or the network. Less useful if you are looking for a quick reference card or a finished, polished text—it is still very much a draft.

Frequently asked

What is bojieli/ai-infra-book?
An open manuscript teaching developers to derive LLM inference and training systems from hardware constraints and first-principle math, not vendor marketing.
Is ai-infra-book open source?
Yes — bojieli/ai-infra-book is open source, released under the Apache-2.0 license.
What language is ai-infra-book written in?
bojieli/ai-infra-book is primarily written in Python.
How popular is ai-infra-book?
bojieli/ai-infra-book has 2.5k stars on GitHub.
Where can I find ai-infra-book?
bojieli/ai-infra-book is on GitHub at https://github.com/bojieli/ai-infra-book.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.