# The Architecture of AI Agents and LLM Systems

A free, openly licensed engineering book and companion course on building and running large language model systems, covering tokenization, serving and fine-tuning models rather than only calling a hosted API.

The book is organized as a pattern language, with eight parts, twenty-six chapters and five appendices covering roughly 258 printed pages, plus a hands-on companion course. Each significant pattern follows a fixed template covering its context, problem, forces, solution, mechanics, a worked example, the resulting context, when to use it or not, related patterns and sources.

Its stated aim is to move engineers from depending entirely on a hosted model API toward understanding how attention scales, what a KV-cache costs, when retrieval beats fine-tuning, how to serve an open model on their own hardware, and what an evaluation suite needs to prove before a release ships. It is written in English and Russian editions, released under a share-alike license, with a dedicated part of the book devoted to fine-tuning, serving and pre-training models directly.

Website: https://github.com/Drobiazkin/ai-agent-architecture
