Inference Engineering in Practice: Serving LLMs Fast and Cheap: Batching, KV Cache, Quantization, and the Cost of Every Token
Paperback
Series: The AI Engineer's Library, Book 3
Publisher: Independently Published
Published: Sep 20 2026
Pages: 460
Weight: 1.34
Height: 0.93 Width: 6.00 Depth: 9.00
Language: English
Sooner or later the question arrives in a thread somebody added you to on a Friday afternoon: could we serve this model ourselves, and what would it cost?
The honest answer is arithmetic, and it needs four things the question never supplies - which tokens you are counting, at what latency bound, at what utilization, and a throughput number that belongs to your hardware rather than to a launch blog. Leave one of them unstated and two competent engineers will price the same model a factor of ten apart, each correct about the number they actually computed.
Inference Engineering in Practice is that arithmetic, and the machinery underneath it: nineteen chapters for the engineer who owns an inference budget and a pager, and has to decide rather than admire.
The argument, in one paragraph. Inference is a budget with two currencies, latency and money, and every serving decision picks an operating point on the frontier between throughput per accelerator and speed per user. Some levers trade one currency for the other. Others push the frontier outward and charge you in a third - memory, accuracy, operational risk, or the chance that the answer quietly changes. Knowing which kind of lever is in your hand before you pull it is the job.
Six parts, in the order the work has to be done:
- The numbers that decide - what a served token costs, why decode is slow for reasons you can read off a datasheet, SLOs for a token stream, and a benchmark that will not flatter you.
- The economics - cost per million tokens and its three traps, the self-host-or-API break-even and what keeps moving it, and sizing a fleet from a traffic forecast.
- The scheduler's levers - continuous batching and the knee where it stops paying, the KV cache as a budget you can overdraw, and prefix caching.
- The model's levers - quantization behind an accuracy gate you built yourself, speculative decoding and the concurrency where it collapses, and what changes once one GPU is not enough.
- Running the fleet - routing for the cache, the adapter and the tenant; the serving signals that lie to you; autoscaling, cold starts and overload.
- Keeping the answer right - the endpoint contract, release gates, determinism and what it costs, and what to do when an accelerator fails.
The last chapter turns all of it into a worksheet that produces a written inference plan you can defend line by line.
The rule that shapes every number in it. This book prints no GPU measurement of its own. Every hardware-bound figure is a published benchmark, a vendor datasheet, or arithmetic on one of those with the arithmetic shown; every measured number came off a 16 GB laptop and says so. So every GPU figure is a published benchmark you can check at its source, and every lab re-runs on your own laptop for nothing with a single command. A free public companion repository carries one runnable lab per chapter, pinned to exact versions.
Who it is for. Backend and platform engineers who ship production services, read Python, have carried a pager, and have been handed a model or a model's monthly invoice. Not a book about model architecture, training, fine-tuning, prompting or retrieval, and it will not teach you to write kernels.
Vendor-neutral on purpose: every mechanism is explained in words that survive an interface change, and only then is the current flag named, with its version and its date.
Volume 3 of The AI Engineer's Library, after Observability for LLM Applications and Agents in Production. Nineteen chapters, about 86,000 words, 50 figures and screenshots.
Also from
Anhaia, Gabriel
TypeScript Esencial: De Desarrollador en Activo a TypeScript con Soltura, en Node, Bun, Deno y el Navegador
Anhaia, Gabriel
Paperback
Spaced Repetition: Warum KI jede Lernkarte erstellen kann, aber dich nichts behalten lässt
Anhaia, Gabriel
Paperback
Observability for LLM Applications: Tracing, Evals, and Shipping AI You Can Trust
Anhaia, Gabriel
Paperback
Regex Pocket Guide: Quick Reference to Regular Expressions for Developers & Tech Professionals
Anhaia, Gabriel
Paperback
Agentes en Producción: Construir, tracing y deploy de IA multipaso en la que puedes confiar
Anhaia, Gabriel
Paperback
Event-Driven Architecture Pocket Guide: Saga, CQRS, Outbox, and the Traps Nobody Warns You About
Anhaia, Gabriel
Paperback
Agents in Production: Building, Tracing, and Shipping Multi-Step AI You Can Trust
Anhaia, Gabriel
Paperback
System Design Pocket Guide: Interviews: 15 Real System Designs, Step by Step
Anhaia, Gabriel
Paperback
Guía de bolsillo de agentes de IA: Patrones para construir sistemas autónomos con LLMs
Anhaia, Gabriel
Paperback
Observability para LLM Applications: Tracing, evals y deploy de IA en la que puedes confiar
Anhaia, Gabriel
Paperback
KI-Agenten - Das Pocket-Handbuch: Patterns für den Bau autonomer Systeme mit LLMs
Anhaia, Gabriel
Paperback
LLM Observability Pocket Guide: Picking the Right Tracing & Evals Tools for Your Team
Anhaia, Gabriel
Paperback
Observability for LLM Applications: Tracing, Evals, and Shipping AI You Can Trust
Anhaia, Gabriel
Paperback
TypeScript in Production: Tooling, Build, and Library Authoring Across Runtimes
Anhaia, Gabriel
Paperback
Decoupled PHP: Clean and Hexagonal Architecture for Applications That Outlive the Framework
Anhaia, Gabriel
Paperback
PHP entkoppeln: Clean Architecture und Hexagonale Architektur für Anwendungen, die das Framework überleben
Anhaia, Gabriel
Paperback
Reading That Sticks: Why AI Can Summarize Any Book but Can't Make You Smarter
Anhaia, Gabriel
Paperback
Deep Focus: Warum KI jede Frage beantworten kann, aber dich nicht konzentrieren lässt
Anhaia, Gabriel
Paperback
Black Mamba, Sasha Fierce, Ziggy Stardust: The Alter Ego Secret of Greatness - and How to Build Your Own
Anhaia, Gabriel
Paperback
Also in
General Computers
All Data Are Local: Thinking Critically in a Data-Driven Society
Loukissas, Yanni Alexander
Paperback
Comptia Network+ Certmike: Prepare. Practice. Pass the Test! Get Certified!: Exam N10-008
Zacker, Craig
Chapple, Mike
Paperback
Interactive Theorem Proving and Program Development: Coq'art: The Calculus of Inductive Constructions
Bertot, Yves
Castéran, Pierre
Hardcover
R for Data Science: Import, Tidy, Transform, Visualize, and Model Data
Grolemund, Garrett
Wickham, Hadley
Paperback
The Reverse Centaur's Guide to Life After AI: How to Think about Artificial Intelligence--Before It's Too Late
Doctorow, Cory
Paperback
Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems
Kleppmann, Martin
Riccomini, Chris
Paperback
The Agi Chronicles: The Inside Story of the Race to Create an Artificial Superintelligence
Roose, Kevin
Hardcover
The Year in Tech, 2027: The Insights You Need from Harvard Business Review
Davenport, Thomas H.
Chamorro-Premuzic, Tomas
Review, Harvard Business
Paperback
If Anyone Builds It, Everyone Dies: Why Superhuman AI Would Kill Us All
Soares, Nate
Yudkowsky, Eliezer
Hardcover
AI for Good: How Real People Are Using Artificial Intelligence to Fix Things That Matter
Tyrangiel, Josh
Hardcover
Human Raised: Nurturing Connection, Curiosity & Lifelong Learning in the Age of AI
Suskind, Dana, MD
Hardcover
The Eureka Machine: Why AI Is the Key to Unlocking a New Era of Scientific Discoveries
Socher, Richard
Hardcover
The Year in Tech, 2026: The Insights You Need from Harvard Business Review
Anthony, Scott D.
Webb, Amy
Review, Harvard Business
Paperback
Hbr's 10 Must Reads on AI (with Bonus Article How to Win with Machine Learning by Ajay Agrawal, Joshua Gans, and AVI Goldfarb)
Review, Harvard Business
Davenport, Thomas H.
Iansiti, Marco
Paperback
The AI Con: How to Fight Big Tech's Hype and Create the Future We Want
Hanna, Alex
Bender, Emily M.
Hardcover
Fans First: Change The Game, Break the Rules & Create an Unforgettable Experience
Cole, Jesse
Paperback
CompTIA Network+ Certification All-in-One Exam Guide, Ninth Edition (Exam N10-009)
Weissman, Jonathan S.
Paperback
Generative Ai: The Insights You Need from Harvard Business Review
Mollick, Ethan
Cremer, David De
Review, Harvard Business
Paperback
A Giant Leap: How AI Is Transforming Healthcare and What That Means for Our Future
Wachter, Robert
Hardcover
AI Literacy in Any Class: Preparing Students to Thrive in an AI Future in Any Grade Level or Content Area
Miller, Matt
Paperback
Fundamentals of Data Engineering: Plan and Build Robust Data Systems
Housley, Matt
Reis, Joe
Paperback
Obsolete: The AI Industry's Trillion Dollar Race to Replace Us--And How to Stop It
Lovely, Garrison
Paperback
Minecraft: Guide Collection 4-Book Boxed Set (Updated): Survival (Updated), Creative (Updated), Redstone (Updated), Combat
Mojang Ab
The Official Minecraft Team
Hardcover
Atlas of AI: Power, Politics, and the Planetary Costs of Artificial Intelligence
Crawford, Kate
Paperback
Love Machines: How Artificial Intelligence Is Transforming Our Relationships
Muldoon, James
Hardcover
AI Snake Oil: What Artificial Intelligence Can Do, What It Can't, and How to Tell the Difference
Narayanan, Arvind
Kapoor, Sayash
Paperback
AI with Intention: Principles and Action Steps for Teachers and School Leaders
Frontier, Tony
Paperback
Python Crash Course, 3rd Edition: A Hands-On, Project-Based Introduction to Programming
Matthes, Eric
Paperback
We Are as Gods: A Survival Guide for the Age of Abundance
Diamandis, Peter H.
Kotler, Steven
Hardcover
The Thinking Machine: Jensen Huang, Nvidia, and the World's Most Coveted Microchip
Witt, Stephen
Hardcover
AP Computer Science Principles Premium, 2027: 6 Practice Tests + Comprehensive Review + Online Practice
Reichelson, Seth
Paperback
Hands-On Machine Learning with Scikit-Learn and Pytorch: Concepts, Tools, and Techniques to Build Intelligent Systems
Géron, Aurélien
Paperback
The Black Swan: Second Edition: The Impact of the Highly Improbable: With a New Section: On Robustness and Fragility
Taleb, Nassim Nicholas
Paperback
An Illustrated Guide to AI Agents: Concepts and Code for Building Agents with Llms, Tools, and Memory
Grootendorst, Maarten
Alammar, Jay
Paperback
Embedded Systems with ARM Cortex-M Microcontrollers in Assembly Language and C: Fourth Edition
Zhu, Yifeng
Paperback
Artificial Intelligence: A Guide for Thinking Humans (with a New Preface)
Mitchell, Melanie
Paperback
AP Computer Science a Premium, 13th Edition: Prep Book with 6 Practice Tests + Comprehensive Review + Online Practice (2026)
Carman, Chris
Teukolsky, Roselyn, M. S.
Paperback
Hands-On Large Language Models: Language Understanding and Generation
Alammar, Jay
Grootendorst, Maarten
Paperback
Hbr's 10 Must Reads on Artificial Intelligence, Updated and Expanded (Featuring How AI Can Help Managers Think Through Problems by Elisa Farri and Gab
Agrawal, Ajay
Review, Harvard Business
Davenport, Thomas H.
Paperback
CompTIA Tech+ Certification All-in-One Exam Guide, Third Edition (Exam FC0-U71)
Wempen, Faithe
Paperback
Human + Machine, Updated and Expanded: Reimagining Work in the Age of AI
Wilson, H. James
Daugherty, Paul R.
Hardcover
The Empty Center: Permission, Connection, and What We Build When the Future is Uncertain
Drumwright, Hayes
Hardcover
Power and Prediction: The Disruptive Economics of Artificial Intelligence
Goldfarb, Avi
Agrawal, Ajay
Gans, Joshua
Hardcover
Fundamentals of Software Architecture: A Modern Engineering Approach
Richards, Mark
Ford, Neal
Paperback
Tubes: A Journey to the Center of the Internet with a New Introduction by the Author
Blum, Andrew
Paperback
AI Projects with Raspberry Pi: High-Performance Artificial Intelligence for Robotics, Security, Home Automation, and Vision
Hattersley, Lucy
Jepson, Brian
Paperback
Minecraft: Exploded Builds: Medieval Fortress: An Official Mojang Book
Mojang Ab
The Official Minecraft Team
Paperback
Guilty Pleasure: The Pornification of the Internet, the Economy, and Everything Else
Nilsson, Patricia
Hardcover
The Problem with Personalization: How Advertisers Learned to Make and Break Us from Ancient Times to the AI Age
Turow, Joseph
Hardcover
RHCSA Red Hat Enterprise Linux 10: Training and Exam Preparation Guide (EX200), Fourth Edition
Ghori, Asghar
Paperback
The Empty Center: Permission, Connection, and What We Build When the Future is Uncertain
Drumwright, Hayes
Paperback
You Look Like a Thing and I Love You: How Artificial Intelligence Works and Why It's Making the World a Weirder Place
Shane, Janelle
Paperback
The Coming Wave: Technology, Power, and the Twenty-First Century's Greatest Dilemma
Suleyman, Mustafa
Hardcover
AI Snake Oil: What Artificial Intelligence Can Do, What It Can't, and How to Tell the Difference
Kapoor, Sayash
Narayanan, Arvind
Hardcover
Designing Machine Learning Systems: An Iterative Process for Production-Ready Applications
Huyen, Chip
Paperback
Artificial Intelligence All-In-One for Dummies
Minnick, Chris
Mueller, John Paul
Massaron, Luca
Paperback
The Return on AI: From Promise to Profit in the Age of Intelligent Business
Sawhney, Mohanbir
Mittal, Ashwin
Paperback
Graphic Artists Guild Handbook, 17th Edition: Pricing & Ethical Guidelines
The Graphic Artists Guild
Paperback
The Devops Handbook, 2nd Edition: How to Create World-Class Agility, Reliability, & Security in Technology Organizations
Humble, Jez
Debois, Patrick
Kim, Gene
Paperback
The Death of Expertise: The Campaign Against Established Knowledge and Why It Matters
Nichols, Tom
Paperback
Minecraft: Roll for Adventure: The Temple of the Charged Creeper
Forbeck, Marty
Forbeck, Matt
Hardcover
Navigeren door het labyrint: Een handleiding voor het beheer van data
Sebastian-Coleman, Laura
Paperback
Comptia A+ Complete Study Guide, 2-Volume Set: Volume 1 Core 1 Exam 220-1201 and Volume 2 Core 2 Exam 220-1202
Buhagiar, Jon
Docter, Quentin
Paperback
AI for Educators: Learning Strategies, Teacher Efficiencies, and a Vision for an Artificial Intelligence Future
Miller, Matt
Paperback
R for Data Science: Import, Tidy, Transform, Visualize, and Model Data
Grolemund, Garrett
Cetinkaya-Rundel, Mine
Wickham, Hadley
Paperback
Microsoft 365 Excel All-In-One for Dummies
Ringstrom, David H.
Alexander, Michael
Kusleika, Dick
Paperback
The AI Ultimatum: Preparing for a World of Intelligent Machines and Radical Transformation
Hill, Paul
Brown, Steve
Paperback
Building Applications with AI Agents: Designing and Implementing Multiagent Systems
Albada, Michael
Paperback
Cloud Finops: Collaborative, Real-Time Cloud Value Decision Making
Storment, J. R.
Fuller, Mike
Paperback
The Fourth Intelligence Revolution: The Future of Espionage and the Battle to Save America
Vinci, Anthony
Hardcover
What Is Intelligence?: Lessons from AI about Evolution, Computing, and Minds
Aguera Y. Arcas, Blaise
Paperback
More Human: How the Power of AI Can Transform the Way You Lead
Hougaard, Rasmus
Carter, Jacqueline
Hardcover
The Technological Republic: Hard Power, Soft Belief, and the Future of the West
Karp, Alexander C.
Zamiska, Nicholas W.
Hardcover
