Your LLM feature works on your laptop. Real traffic is about to test every decision.
LLM system design for developers
Architecture, latency, cost, caching, routing, guardrails and observability for AI applications, with Python examples and TypeScript notes
Your LLM feature works on your laptop. Then real traffic shows up, the provider has a bad afternoon, the bill doubles, and someone pastes a prompt that talks your agent into touching things it shouldn't.
That gap, between a call that works and a system you'd trust in production, is what this book is about. It follows one assistant as it grows from a single team to a whole company, and each chapter fixes the next thing that breaks. You'll estimate load on the back of an envelope, budget latency and tokens, decide what's worth caching, add retries and fallbacks that don't make an outage worse, send easy requests to cheaper models, and treat structured output and tool calls as contracts. Later chapters put limits around agents, design against prompt injection instead of filtering for it, trace cost per feature, and wire evaluation into releases. Then comes the old question: hosted API, or run the model yourself?
What is inside.
- What LLM system design is
- From one call to a compound system
- Latency and streaming
- Cost and token budgets
- Caching: prompts, responses and meaning
- Reliability: rate limits, retries and timeouts
- Routing, cascades and fallbacks
- Structured output and tools as contracts
- Agents as a component
- Guardrails
- Security: prompt injection and what the system may touch
- Observability and tracing
- Evaluation in the loop
- Where the model runs: hosted API or self-hosted
- The interview
Choose a format.
- Ebook $9.99
- Paperback $14.99
Read the first chapter first.
Send us an email and we reply with a PDF: the title page, the full table of contents and all of chapter 1.