Any excellent book to learn LLM Optimization and Serving
Why is it important to learn LLM Optimization?
Large language models (LLMs) are the reasoning engines of modern AI.
Without proper optimization, however, LLMs can be expensive and slow to serve.
So, it is necessary for any one (A/ML Engineers, Data Scientist) working on LLMs or LLM applications to be familiar with LLM optimization and serving techniques.
Hands-On LLM Serving and Optimization Book
This book serves as a comprehensive guide to the complexities of deploying and optimizing LLMs at scale.
This book covers
Chapter 1 — Introduction to Model Serving and Optimization: Anatomy of a model, the model lifecycle, what model serving is and why we optimize it, serving paradigms (edge, single-model, multi-model), and serving platforms.
Chapter 2 — Large Language Model Serving: Inside the transformer, autoregressive generation, decoder-only architecture, attention, the KV cache, prefill and decode, and running LLMs with a serving framework (vLLM).
Chapter 3 — Model-Serving System Design: A Deep Dive: Building online single-model and multi-model serving services from scratch, batching and streaming, NVIDIA Triton, and cost- vs. latency-optimized designs.
Chapter 4 — Model Serving Best Practices: Serving in an agentic world (agents, RAG, CAG), enterprise serving architecture, building with an open source stack or a cloud vendor, build-or-buy strategy, and performance measurement.
Chapter 5 — Challenges When Serving LLMs: Why optimization matters, accelerator chips and GPU specs, model-loading bottlenecks, KV cache sizing, and arithmetic-intensity analysis of prefill and decode.
Chapter 6 — Essential LLM Optimization Techniques: Request batching and scheduling (dynamic, continuous, chunked prefill), scalable attention and kernel fusion, model compression (quantization, distillation, pruning), and prefix caching / RadixAttention.
Chapter 7 — Advanced LLM Optimization Techniques: Speculative decoding, multi-GPU and multinode inference (data/tensor/pipeline/expert parallelism), prefill–decode disaggregation, and advanced KV caching for long-context serving.
Chapter 8 — LLM Serving Frameworks: vLLM internals (architecture, scheduler, layered optimization), TensorRT-LLM, SGLang, llama.cpp, and how to select the right framework.
Chapter 9 — LLM Optimization in Practice: A step-by-step optimization plan for Qwen3-14B with vLLM, from hardware inspection and benchmarking to quantization, distributed serving, and common trade-offs.
Chapter 10 — Advancements in LLM Serving: Semantic caching, performance profiling, multimodal serving, edge AI, multi-LoRA serving, and model serving in reinforcement learning.
Github Repo -