LLM Inference Optimization and Serving
Parent: LLM Models and APIs · Published reference · snapshot 2026-09-08 · skill ai-llm-model-layer/references/llm-inference-serving.md
↓ Facts as markdownall context files
PROVENANCE: This reference is part of the ai-agent-engineering hub.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Overview
- <!-- PROVENANCE: This reference is part of the ai-agent-engineering hub. Source: /dr deep-research run, 2026-05-31. Topic - LLM inference optimization & serving (2024-2026). Routed as a hub reference (not a standalone top-level skill) per hub-and-spoke strategy. Owns the LLM serving / inference-runtime layer. Boundaries: [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#overview]
- Weight-quantization METHODS (GPTQ/AWQ/GGUF/FP8/INT4 algorithms) → model-compression skill / da-7-machine-learning. Here we only cover how a SERVER consumes a quantized model. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#overview]
- Multi-LoRA adapter DECISIONS (merge vs swap, add_weighted_adapter combination math, which adapters to serve) → llm-fine-tuning-peft. Here we only cover the serving-runtime side of hosting many adapters (S-LoRA/Punica-style paging and batched kernels). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#overview]
- Attention INTERNALS (FlashAttention math, GQA/MQA derivation) → model-architecture reference / da-7-machine-learning. Here we only cover how the SERVER's attention kernel reads a paged KV cache. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#overview]
- Managed AWS inference (Bedrock/SageMaker endpoints) → aws-ai-ml. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#overview]
- Production observability of a running endpoint (tracing, eval, drift) → llm-observability reference. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#overview]
- LLM model landscape / selection → llm-models reference. --> [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#overview]
LLM Inference Optimization & Serving
- Self-hosting an LLM means running an inference server: a long-lived process that loads model weights onto GPU(s) and turns a stream of incoming requests into generated tokens as fast and cheaply as possible. This reference covers the serving-engine landscape and the optimization techniques (2024–2026 SOTA) that separate a toy model.generate() loop from a production endpoint serving thousands of concurrent users. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#llm-inference-optimization-serving]
- The one mental model that unlocks everything here: LLM inference has two phases with opposite hardware profiles. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#llm-inference-optimization-serving]
- Prefill (process the prompt): one big matrix-multiply over all prompt tokens at once. Compute-bound - saturates GPU FLOPs. Determines Time To First Token (TTFT). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#llm-inference-optimization-serving]
- Decode (generate output): one token at a time, each step reloading the entire model weights + KV cache from HBM to do tiny matmuls. Memory-bandwidth-bound - GPU FLOPs sit mostly idle. Determines Time Per Output Token (TPOT). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#llm-inference-optimization-serving]
- Almost every technique below - continuous batching, PagedAttention, chunked prefill, disaggregation, speculative decoding - is an attempt to keep both the FLOP units and the memory bus busy despite this mismatch. Hold that tension in mind and the whole field becomes legible. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#llm-inference-optimization-serving]
- > Scope guard: this file is about the serving runtime. For the algorithms that shrink weights (GPTQ/AWQ/FP8/INT4), see the model-compression material (da-7-machine-learning); we only describe how a server consumes a quantized checkpoint. For attention math (FlashAttention, GQA), see the model-architecture material; we only describe how the server's attention kernel reads a paged KV cache. For managed AWS endpoints, see aws-ai-ml. For observing a running endpoint, see the llm-observability reference. For single-machine LOCAL serving on a laptop/desktop/phone/browser (Ollama, llama.cpp llama-server, LM Studio, MLX-LM, WebLLM) and which local runtime to pick, see on-device-local-llm-runtimes - datacenter throughput is here, the localhost dev-experience is there. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#llm-inference-optimization-serving]
1. The serving-engine landscape (and how to choose)
- A serving engine bundles: a scheduler (which requests run this step), a KV-cache memory manager, optimized attention/GEMM kernels, an API server (usually OpenAI-compatible /v1/chat/completions), and increasingly multi-node orchestration. The 2024–2026 field consolidated around a handful. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#1-the-serving-engine-landscape-and-how-to-choose]
- Datacenter-scale orchestration layer (2025+): NVIDIA Dynamo (announced GTC 2025) sits above a single engine to coordinate large GPU fleets - disaggregated prefill/decode, KV-aware routing, and KV offloading via its NIXL transfer library and KVBM (KV Block Manager). LMCache is a complementary cross-engine KV layer giving "prefill-once, reuse-everywhere" semantics (offload KV to CPU/disk and share it across instances). These are not replacements for vLLM/SGLang/TRT-LLM - they wrap them. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#1-the-serving-engine-landscape-and-how-to-choose]
- Choosing heuristics: [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#1-the-serving-engine-landscape-and-how-to-choose]
- Start with vLLM unless you have a specific reason not to - best balance of throughput, TTFT, and model/hardware coverage. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#1-the-serving-engine-landscape-and-how-to-choose]
- Prefix-heavy or agentic/multi-turn workload → SGLang (RadixAttention) often wins on TTFT and throughput. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#1-the-serving-engine-landscape-and-how-to-choose]
- All-NVIDIA, latency-critical, and a compile step is acceptable → TensorRT-LLM. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#1-the-serving-engine-landscape-and-how-to-choose]
- Deep in the HF stack or serving long chat histories → TGI (v3). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#1-the-serving-engine-landscape-and-how-to-choose]
- Squeeze a quantized model onto the fewest GPUs → LMDeploy/TurboMind. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#1-the-serving-engine-landscape-and-how-to-choose]
- Multi-node, reasoning-model, or disaggregated fleet → put Dynamo (and/or LMCache) on top of one of the above. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#1-the-serving-engine-landscape-and-how-to-choose]
- > Benchmark numbers move monthly and are workload-specific (model size, prompt/output length, batch). Treat any "engine X is N% faster" claim - including those in your own notes - as true only for that exact configuration. Always re-benchmark on your traffic shape. Cite the engine's own docs for current feature/perf claims. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#1-the-serving-engine-landscape-and-how-to-choose]
2. PagedAttention & KV-cache memory management
- During decode, the model attends to the keys/values of every prior token. Caching them (the KV cache) is what makes autoregressive generation tractable - but the cache is enormous and grows with every token. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#2-pagedattention-kv-cache-memory-management]
- KV-cache size (rule of thumb): bytes ≈ 2 (K and V) × num_layers × num_kv_heads × head_dim × seq_len × dtype_bytes × batch For a multi-billion-parameter model at long context this is often tens of GB - frequently rivaling or exceeding the weights, and it is the binding constraint on how many concurrent requests (how big a batch) you can serve. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#2-pagedattention-kv-cache-memory-management]
- The problem PagedAttention solves: naïve serving pre-allocates one contiguous KV buffer per request sized to max_seq_len. Requests that finish early or never reach max length waste that reservation → massive internal + external fragmentation, sometimes 60–80% of KV memory wasted. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#2-pagedattention-kv-cache-memory-management]
- PagedAttention (vLLM, SOSP 2023; the idea that launched vLLM) applies OS virtual-memory paging to the KV cache: [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#2-pagedattention-kv-cache-memory-management]
- KV cache is split into fixed-size blocks (vLLM default: 16 tokens per block). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#2-pagedattention-kv-cache-memory-management]
- Each sequence has a block table mapping logical positions → arbitrary, non-contiguous physical blocks. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#2-pagedattention-kv-cache-memory-management]
- Blocks are allocated on demand as the sequence grows, so reservation ≈ actual usage. Fragmentation drops to near-zero (only the last partial block of each sequence). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#2-pagedattention-kv-cache-memory-management]
- Blocks can be shared across sequences (copy-on-write) - the basis for prefix caching (§5) and cheap parallel sampling / beam search. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#2-pagedattention-kv-cache-memory-management]
- The cost is an extra indirection in the attention kernel (gather KV from scattered blocks), which custom paged-attention kernels handle efficiently. Higher KV utilization → larger batches → higher throughput. Essentially every modern engine now implements paged KV (vLLM PagedAttention, TGI paged kernels, TRT-LLM paged KV cache, LMDeploy blocked KV, SGLang's radix-tree blocks). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#2-pagedattention-kv-cache-memory-management]
- Beyond paging - the KV-cache memory hierarchy (2025): when GPU KV memory fills, you can offload blocks to CPU RAM or NVMe instead of dropping/recomputing them: vLLM CPU offload, LMCache, Dynamo KVBM, FlexKV (GPU→CPU→SSD tiers via GPUDirect Storage / io_uring). This trades transfer latency for the ability to keep far more cached context "warm." [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#2-pagedattention-kv-cache-memory-management]
- > KV-cache compression by quantizing the cache itself (e.g., FP8/INT8 KV) is a serving-side lever and is in scope as a knob; the quantization algorithm details are not (→ compression skill). GQA/MQA shrink num_kv_heads and thus KV size, but that is a model-architecture choice (→ architecture material), not a serving technique - here, just know that fewer KV heads = smaller cache = bigger batches. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#2-pagedattention-kv-cache-memory-management]
3. Continuous (in-flight) batching
- GPUs are only efficient when batched, but LLM requests have wildly different output lengths and arrive at random times. The batching strategy is, after KV memory, the single biggest throughput lever. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#3-continuous-in-flight-batching]
- Static / dynamic batching (the old way): assemble a batch, run it to completion, return all results together. The whole batch is held hostage by its longest-generating member; finished sequences leave their GPU slot idle ("bubble"). Terrible GPU utilization for mixed-length generation. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#3-continuous-in-flight-batching]
- Continuous batching (a.k.a. in-flight batching, iteration-level scheduling; from Orca, OSDI 2022): the scheduler makes decisions every decode iteration, not every request. The moment a sequence emits its EOS token its slot is freed and a waiting request is admitted mid-flight. The batch composition churns continuously, keeping the GPU saturated. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#3-continuous-in-flight-batching]
- This is now table stakes - vLLM, TGI, TRT-LLM (in-flight batching), LMDeploy (persistent batching), and SGLang all do it. The remaining nuance is the scheduling policy: how to admit/preempt requests and how to interleave compute-bound prefills with memory-bound decodes - which is exactly what chunked prefill (§4) and disaggregation (§6) address. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#3-continuous-in-flight-batching]
- Admission & preemption: when KV memory is exhausted the scheduler must either recompute (evict a request's KV and re-prefill it later - cheap memory, wasted compute) or swap KV out to CPU (preserves compute, costs transfer bandwidth). Token-budget caps (max_num_batched_tokens) and max-concurrency limits bound how aggressively requests are packed. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#3-continuous-in-flight-batching]
4. Chunked prefill & scheduling
- The core scheduling conflict: a long prompt's prefill is one giant compute-bound op. If you run it as a single batch step, every in-flight decode stalls for its duration → a TPOT spike / jitter for all current users every time a long prompt arrives. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#4-chunked-prefill-scheduling]
- Chunked prefill (a.k.a. dynamic/split-fuse prefill; Sarathi/Sarathi-Serve) splits a long prefill into fixed-size token chunks and piggybacks each chunk into a batch alongside ongoing decode tokens. One step might be "512 prefill tokens from request A + 30 decode tokens from requests B–F." Because prefill is compute-bound and decode is memory-bound, fusing them in one step uses both the FLOP units and the memory bus - the best single-engine answer to the prefill/decode tension. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#4-chunked-prefill-scheduling]
- vLLM V1 (2025) made this the default architecture. The V1 rewrite introduced a unified scheduler that abandons the prefill-vs-decode distinction entirely: scheduling is just a dict {request_id: num_tokens_to_process}. This one representation cleanly expresses chunked prefill, prefix caching, and speculative decoding. V1's default policy prioritizes decode tokens (protect TPOT for current users), batches them, then fills the remaining max_num_batched_tokens budget with prefill chunks; an oversized prefill is automatically chunked. V1 also integrated FlashAttention 3 to handle mixed prefill+decode batches. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#4-chunked-prefill-scheduling]
- The key tuning knob is max_num_batched_tokens (the per-step token budget): [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#4-chunked-prefill-scheduling]
- Smaller budget → smaller prefill chunks → lower decode jitter / better TPOT, but more steps to finish a prefill → higher TTFT and lower peak throughput. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#4-chunked-prefill-scheduling]
- Larger budget → faster prefills / higher throughput, but bigger TPOT spikes. This is the latency↔throughput dial you turn to hit your SLOs (§7). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#4-chunked-prefill-scheduling]
5. Prefix / prompt caching
- If two requests share a prefix - a long system prompt, a few-shot block, a RAG context, or the conversation history in a multi-turn chat - the KV cache for that prefix is identical. Recomputing it per request is pure waste, and prefill is the expensive phase. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#5-prefix-prompt-caching]
- Automatic Prefix Caching (APC) keeps prefixes' KV blocks around (hash blocks by their token content + position) and reuses them when a new request's prefix matches. The matched prefix skips prefill entirely → dramatic TTFT reduction and prefill-compute savings on prefix-heavy traffic. PagedAttention's block sharing (§2) is the enabling mechanism. vLLM exposes this as enable_prefix_caching. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#5-prefix-prompt-caching]
- SGLang's RadixAttention generalizes this: instead of per-request prefix matching, it maintains a **radix tree (trie) of the KV cache across all concurrent requests**, managed with LRU eviction. This enables: [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#5-prefix-prompt-caching]
- Multi-level sharing - chains of shared prefixes, not just one prompt depth. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#5-prefix-prompt-caching]
- Fork/branch - when one request branches into multiple completions (parallel sampling, tree-of-thought, agent fan-out), children automatically share the parent's cached KV. This is why SGLang shines on agents and multi-turn chat - reported large speedups on prefix-heavy traffic vs. per-request caching. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#5-prefix-prompt-caching]
- The trade-off you must respect: cached prefixes occupy KV memory that could otherwise serve new requests. When prefix overlap is low and KV memory is tight, the cache is pure overhead and can reduce serviceable concurrency. Prefix caching is a big win for system-prompt/RAG/chat workloads and a liability for high-cardinality, low-overlap traffic. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#5-prefix-prompt-caching]
- Distinguish three cache layers (don't conflate them): [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#5-prefix-prompt-caching]
- Prefix/KV caching - reuse computed KV blocks for exact-prefix-match tokens (this section). Exact match, lossless. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#5-prefix-prompt-caching]
- Provider "prompt caching" - the same idea exposed as a billing feature by hosted APIs (cached prefix tokens billed cheaper). For consuming this on a provider's API, see llm-integration-reviewer / aws-ai-ml. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#5-prefix-prompt-caching]
- Semantic caching - return a stored response for a semantically similar (not identical) query, via embedding match (GPTCache, Redis). Different layer, approximate, can return stale/wrong answers - a correctness risk, not a KV technique. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#5-prefix-prompt-caching]
6. Disaggregated prefill/decode serving
- Chunked prefill (§4) interleaves the two phases on the same GPU. Disaggregation takes the opposite tack: run prefill and decode on physically separate GPU pools, then transfer the KV cache from prefill workers to decode workers over a fast interconnect. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#6-disaggregated-prefilldecode-serving]
- Why: prefill (compute-bound) and decode (memory-bound) interfere when co-located - a heavy prefill batch tanks decode TPOT and vice-versa. Separating them eliminates the interference and lets each pool be sized, batched, and even hardware-matched independently (e.g., compute-dense GPUs for prefill, bandwidth-dense for decode). Foundational systems: DistServe (OSDI 2024) and Splitwise (ISCA 2024). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#6-disaggregated-prefilldecode-serving]
- The metric it optimizes is goodput (§7), not raw throughput - completed requests that meet SLOs per second per GPU. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#6-disaggregated-prefilldecode-serving]
- The cost: you must move the KV cache from prefill to decode GPUs every request. This needs a fast path (NVLink / RDMA / InfiniBand) and a transfer library - NVIDIA's NIXL in Dynamo; LMCache uses NIXL for prefill→decode KV transfer. KV-cache offload/routing makes this practical at fleet scale. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#6-disaggregated-prefilldecode-serving]
- KV-aware routing: the router sends a request to the prefill/decode worker whose cache already holds the most overlapping blocks, balancing cache-hit rate against load - avoiding redundant KV regeneration across the fleet (Dynamo). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#6-disaggregated-prefilldecode-serving]
- Aggregation vs. disaggregation is an open debate (2024–2026). Disaggregation removes interference but can waste resources (compute and memory are managed in coupled units, and the split ratio rarely matches traffic exactly); chunked-prefill aggregation maximizes single-node utilization but can't fully escape the tension under tight SLOs. By mid-2025 essentially every major framework (vLLM, SGLang, Dynamo, LMCache) supports PD disaggregation for large-scale deployments, and hybrid/adaptive approaches are active research. Rule of thumb: disaggregation earns its complexity at scale (many GPUs, reasoning models with huge prefills or very long decodes); for a single node, chunked prefill is simpler and usually sufficient. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#6-disaggregated-prefilldecode-serving]
7. Latency / throughput metrics & SLOs
- You cannot tune what you cannot measure, and "tokens/sec" alone hides the user experience. The canonical metric set: [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#7-latency-throughput-metrics-slos]
- TTFT vs. throughput are different problems with opposite levers. Bigger batches raise throughput but, by interleaving heavy prefills with decodes, can regress both TTFT and TPOT. This is the fundamental latency↔throughput trade-off; you tune toward an SLO, not toward a single maximum. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#7-latency-throughput-metrics-slos]
- Goodput is the right north star. A server can post huge raw throughput while violating everyone's latency SLO (massive batches → great tokens/sec, terrible TTFT). Goodput counts only SLO-compliant requests, capturing cost and service quality in one number - it's exactly what disaggregation (§6) optimizes. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#7-latency-throughput-metrics-slos]
- Always report percentiles (p50/p90/p99), never just the mean. Tail latency is where SLOs break, especially under bursty load and long-prompt jitter. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#7-latency-throughput-metrics-slos]
- Benchmark on your real traffic shape. Input/output length distribution, request arrival pattern (Poisson vs. bursty), and concurrency dominate the numbers. Tools: vLLM's benchmark_serving, LLMPerf, sglang.bench_serving, GenAI-Perf (Triton). Synthetic uniform-length benchmarks overstate real-world throughput. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#7-latency-throughput-metrics-slos]
- Setting SLOs: derive them from the use case. Interactive chat: TTFT under a few hundred ms, TPOT below human reading speed (~6–10 tokens/sec is fine; faster is better). Batch/offline (summarization, evals): TTFT barely matters - maximize throughput/goodput and minimize cost-per-token (§9). Voice/agent loops: TTFT and tail latency dominate. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#7-latency-throughput-metrics-slos]
8. Multi-GPU & multi-node inference (parallelism)
- When a model (weights + KV cache for your target batch/context) doesn't fit on one GPU, or one GPU can't hit your latency/throughput target, you partition across GPUs. These compose (e.g., TP within a node × PP across nodes). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#8-multi-gpu-multi-node-inference-parallelism]
- Tensor Parallelism (TP): split each layer's weight matrices across GPUs; every GPU does part of every layer and they all-reduce activations each layer. Uses Megatron-LM-style sharding. Pros: reduces per-GPU memory and per-token latency (more aggregate bandwidth per token). Cons: an all-reduce per layer → needs very fast intra-node interconnect (NVLink); degrades badly across slow inter-node links. Rule: use TP within a node, set tensor_parallel_size = GPUs per node. Best lever for latency. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#8-multi-gpu-multi-node-inference-parallelism]
- Pipeline Parallelism (PP): split the model by layers into stages, one stage per GPU/node; activations pass stage→stage. Pros: only small activation tensors cross the link → tolerates slower inter-node networks (Ethernet/InfiniBand). Cons: introduces pipeline bubbles (stages idle waiting for upstream) unless micro-batched well; helps throughput more than single-request latency. Rule: use PP across nodes, pipeline_parallel_size = number of nodes. Example: 16 GPUs as 2×8 → TP=8, PP=2. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#8-multi-gpu-multi-node-inference-parallelism]
- Expert Parallelism (EP): for Mixture-of-Experts (MoE) models, place different experts on different GPUs and route tokens to the GPU holding the chosen expert. Lets you scale total parameters without every GPU holding every expert; load-balancing the routing is the hard part. Increasingly central as frontier OSS models go MoE. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#8-multi-gpu-multi-node-inference-parallelism]
- Data Parallelism (DP): replicate the whole model and split requests across replicas. Pure throughput/horizontal scaling; the unit you autoscale (§9). vLLM also supports context/sequence parallelism for very long contexts. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#8-multi-gpu-multi-node-inference-parallelism]
- Runtimes: vLLM uses native multiprocessing for single-node and Ray for multi-node; TRT-LLM and others use NCCL collectives. Heuristic order: fit on 1 GPU if you can (cheapest, no comm overhead) → TP within a node for memory/latency → add PP across nodes only when a single node can't hold the model → DP replicas for horizontal capacity → EP if (and only if) the model is MoE. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#8-multi-gpu-multi-node-inference-parallelism]
9. Constrained / structured decoding at the serving layer
- Applications need machine-readable output - JSON matching a schema, a valid SQL/regex/grammar, a tool call with the right argument shape. Constrained (guided) decoding guarantees validity by, at each decode step, computing a token mask that zeroes out any next-token that would violate the target structure, so only conforming tokens can be sampled. Unlike prompt-and-pray or retry loops, it is a hard guarantee with (when done right) near-zero added latency. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#9-constrained-structured-decoding-at-the-serving-layer]
- Regex / JSON-schema → finite-state machine (FSM): compile the constraint to an FSM whose state determines the allowed token set. Outlines pioneered compiling schemas to index structures for O(1) valid-token lookup per step. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#9-constrained-structured-decoding-at-the-serving-layer]
- Context-free grammar → pushdown automaton: for nested structures (full JSON, code, custom grammars) an FSM isn't enough; a stack-based automaton tracks nesting. XGrammar (MLSys 2025) splits the vocabulary into context-independent vs. context-dependent tokens and precomputes masks, reaching well under ~40µs/token - and is the default structured-generation backend for vLLM, SGLang, and TensorRT-LLM. llguidance (Microsoft, Rust Earley parser) and Guidance/Outlines are the other main backends. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#9-constrained-structured-decoding-at-the-serving-layer]
- Serving-level concerns (this is why it lives here, not in prompt engineering): [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#9-constrained-structured-decoding-at-the-serving-layer]
- Per-step mask latency must be hidden behind GPU compute or it dominates TPOT - hence the heavy engineering (precomputed/cached masks, context-independent token sets). Naïve grammar masking can be 100× slower than XGrammar's approach. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#9-constrained-structured-decoding-at-the-serving-layer]
- Interaction with batching & speculative decoding: masks must be applied per-sequence within a continuous batch, and verified against drafted tokens under speculative decoding (§10). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#9-constrained-structured-decoding-at-the-serving-layer]
- Tool/function calling is usually implemented as constrained decoding under the hood (constrain output to the tool's JSON-schema). vLLM/SGLang/TGI/TRT-LLM all expose guided_json / response_format / grammar parameters. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#9-constrained-structured-decoding-at-the-serving-layer]
- Validity ≠ correctness/quality. Constraining structure can shift the output distribution and occasionally degrade content quality; the model can emit schema-valid nonsense. Constrain structure, but still validate semantics downstream. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#9-constrained-structured-decoding-at-the-serving-layer]
10. Speculative decoding
- Decode is memory-bandwidth-bound: each step reloads all weights to produce one token, leaving FLOPs idle. Speculative decoding exploits that idle compute to generate multiple tokens per step - losslessly, with provably the same output distribution as the target model (when verification is done correctly). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#10-speculative-decoding]
- The pattern: a cheap draft proposes the next k tokens; the expensive target verifies all k in a single forward pass (cheap, because verification is one parallel pass over k tokens - compute it had to spare). Tokens are accepted up to the first mismatch via rejection sampling that preserves the target's distribution; on rejection, generation resumes from there. If the draft is good, you get several tokens for roughly the cost of one target pass. Speedup ≈ average accepted tokens per step, and is workload-dependent (predictable text → high acceptance → big speedup; surprising text → low). It is lossless - quality is identical to the target; only speed changes. Trade-offs: extra memory/complexity for the drafter, and low acceptance can even slow you down. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#10-speculative-decoding]
- The family (the part that moves fastest): [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#10-speculative-decoding]
- Draft-model (vanilla) SD: a small separate model of the same family drafts. Simple, but needs a well-matched small model and runs a second model. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#10-speculative-decoding]
- Prompt Lookup / n-gram (PLD): "draft" by copying spans from the prompt/context - free, great for summarization/RAG/code-edit where output echoes input. No model needed. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#10-speculative-decoding]
- Medusa: add extra decoding heads to the target model that predict several future tokens in parallel (tree-attention to verify multiple candidate continuations). No separate draft model. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#10-speculative-decoding]
- Lookahead decoding: uses Jacobi-style parallel decoding to generate and verify n-grams in place; no draft model or extra heads. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#10-speculative-decoding]
- EAGLE / EAGLE-2 / EAGLE-3: the dominant line by mid-2026. Draft at the feature (hidden-state) level rather than the token level. EAGLE-2 adds a dynamic draft tree with context-aware acceptance. EAGLE-3 (NeurIPS 2025) fuses features from early/middle/late target layers and predicts tokens directly, removing a scaling ceiling - reported ~3–6.5× over vanilla autoregressive and ~20–40% over EAGLE-2. Many engines now ship EAGLE/EAGLE-3 support. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#10-speculative-decoding]
- Serving integration: vLLM (V1's unified scheduler explicitly supports speculative tokens), SGLang, and TRT-LLM all support speculative decoding; it composes with continuous batching and (carefully) with constrained decoding. Acceptance rate falls as batch size grows (the spare compute shrinks), so SD helps most in low-batch, latency-sensitive regimes - exactly where you'd otherwise be memory-bound. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#10-speculative-decoding]
11. Autoscaling & cost-per-token
- Self-hosting only beats a pay-per-token API if your GPUs stay busy. An idle reserved GPU bills 24/7; the whole economic game is matching capacity to demand. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#11-autoscaling-cost-per-token]
- Cost-per-token is the real unit economic: GPU $/hour ÷ (tokens/sec × 3600). It's dominated by utilization, so every throughput technique above (batching, paged KV, quantized weights to fit a smaller/cheaper GPU) is also a cost lever. Reported community break-evens (workload-specific): a dedicated GPU beats serverless/API roughly past ~40–70% sustained utilization; below that, serverless or a hosted API is cheaper. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#11-autoscaling-cost-per-token]
- Autoscaling patterns: [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#11-autoscaling-cost-per-token]
- Horizontal (replica) scaling: add/remove whole model replicas (data-parallel, §8) behind a load balancer. Scale on a signal that reflects LLM load - queue depth / pending requests / GPU utilization, not CPU% (misleading for GPU work). KServe + Knative scales replicas on concurrent requests and can scale to zero; KEDA scales on pending-request/custom metrics (e.g., on OpenShift AI / vLLM). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#11-autoscaling-cost-per-token]
- Scale-to-zero & cold starts: dropping to zero replicas saves the most money but reintroduces a cold start - loading tens of GB of weights to GPU can take seconds to minutes. Mitigations: weight streaming/snapshotting, fast-boot tech (e.g., Runpod FlashBoot claims sub-250ms), keeping a warm pool, or a small always-on floor. Scale-to-zero suits spiky/dev traffic; steady production keeps a warm minimum. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#11-autoscaling-cost-per-token]
- Serverless GPU (Runpod, Modal, Northflank, etc.) bills per-second of actual compute → zero cost at zero traffic, at the price of cold-start risk and less control. Managed inference (Bedrock, SageMaker endpoints) offloads all of this - for those, see aws-ai-ml. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#11-autoscaling-cost-per-token]
- Provisioned vs. on-demand vs. spot: reserve/commit capacity for the steady baseline (cheapest per hour), burst on on-demand, use spot/preemptible for fault-tolerant batch. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#11-autoscaling-cost-per-token]
- Cost levers, in rough order of impact: raise utilization (batching + right-sizing); use a quantized model to fit a smaller/cheaper GPU or bigger batch (algorithm → compression skill; deploying it is the serving lever); enable prefix caching for shared-prefix traffic; pick the highest-goodput engine/config for your SLO; autoscale aggressively (scale-to-zero for spiky, warm-floor for steady); batch/offline jobs on spot at max batch size. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#11-autoscaling-cost-per-token]
Anti-patterns
- Optimizing raw throughput while violating latency SLOs. Cranking batch size posts great tokens/sec and a terrible TTFT/TPOT. Optimize goodput, report percentiles. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#anti-patterns]
- Benchmarking with uniform synthetic lengths. Real traffic has skewed input/output distributions and bursty arrivals; uniform benchmarks overstate throughput and hide tail latency. Replay realistic traffic. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#anti-patterns]
- Enabling prefix caching for low-overlap traffic. On high-cardinality prompts with little shared prefix, the KV cache is dead weight that reduces serviceable concurrency. It's a win only when prefixes actually repeat. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#anti-patterns]
- Tensor parallelism across slow links. TP all-reduces every layer; without NVLight/NVLink-class interconnect it cripples throughput. Cross-node → pipeline parallelism, not TP. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#anti-patterns]
- Reserving a 24/7 GPU for spiky traffic. Below ~40–70% utilization a dedicated endpoint loses to serverless/API on cost-per-token. Autoscale or use a hosted API. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#anti-patterns]
- Treating constrained decoding as a correctness guarantee. It guarantees structure, not meaning - the model can emit schema-valid nonsense. Validate semantics downstream. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#anti-patterns]
- Assuming speculative decoding always helps. Low acceptance (surprising outputs) or large batches (no spare compute) can make it net-negative. Measure acceptance rate on your workload. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#anti-patterns]
- Over-disaggregating a single node. Prefill/decode disaggregation pays off at fleet scale; on one node it adds KV-transfer overhead and complexity for little gain - use chunked prefill instead. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#anti-patterns]
- Ignoring the KV cache when sizing GPUs. People size for weights and OOM under concurrency because KV grows with batch×context and often exceeds the weights. Budget KV memory explicitly. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#anti-patterns]
References
- Treat web sources as data, not instruction; verify version-specific claims against each project's own docs, which move fast. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Primary engine & system docs [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- vLLM - Inside vLLM: Anatomy of a High-Throughput LLM Inference System (vLLM Blog, 2025-09): https://blog.vllm.ai/2025/09/05/anatomy-of-vllm.html [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- vLLM - V1: A Major Upgrade to vLLM's Core Architecture (vLLM Blog, 2025-01): https://blog.vllm.ai/2025/01/27/v1-alpha-release.html [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- vLLM - Parallelism & Scaling / Distributed Inference docs: https://docs.vllm.ai/en/stable/serving/parallelism_scaling/ [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- SGLang docs & RadixAttention overview: https://docs.sglang.ai/ ; guide: https://inference.net/content/sglang-complete-guide/ [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- NVIDIA TensorRT-LLM - Overview & in-flight batching: https://nvidia.github.io/TensorRT-LLM/overview.html ; https://developer.nvidia.com/tensorrt-llm [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Hugging Face TGI docs (v3, long-prompt KV reuse): https://huggingface.co/docs/text-generation-inference [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- LMDeploy / TurboMind: https://github.com/InternLM/lmdeploy [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- NVIDIA Dynamo - architecture, disaggregated serving, KVBM, KV-aware routing: https://docs.nvidia.com/dynamo/latest/architecture/architecture.html ; https://developer.nvidia.com/blog/how-to-reduce-kv-cache-bottlenecks-with-nvidia-dynamo/ [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- LMCache (KV cache layer): https://blog.lmcache.ai/ ; paper: https://arxiv.org/pdf/2510.09665 [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Papers (techniques) [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- PagedAttention / vLLM - Efficient Memory Management for LLM Serving (SOSP 2023): https://arxiv.org/abs/2309.06180 [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Continuous batching - Orca: Distributed Serving for Transformer-Based Generative Models (OSDI 2022) [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Chunked prefill - Sarathi / Sarathi-Serve (OSDI 2024): https://arxiv.org/abs/2403.02310 [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Disaggregation - DistServe (OSDI 2024): https://arxiv.org/abs/2401.09670 ; Splitwise (ISCA 2024): https://arxiv.org/abs/2311.18677 ; PD-multiplexing/goodput survey: https://arxiv.org/html/2504.14489v3 [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Speculative decoding - EAGLE: https://arxiv.org/abs/2401.15077 ; EAGLE-3 (NeurIPS 2025): https://arxiv.org/html/2503.01840v1 ; Medusa: https://arxiv.org/abs/2401.10774 ; Lookahead decoding: https://arxiv.org/abs/2402.02057 [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Constrained decoding - XGrammar (MLSys 2025): https://arxiv.org/pdf/2411.15100 ; Outlines: https://arxiv.org/abs/2307.09702 [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Metrics, comparisons & operations [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- LLM Inference Handbook - metrics, PD disaggregation, optimization (BentoML): https://bentoml.com/llm/inference-optimization/llm-inference-metrics [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- DistServe / Hao AI Lab - Throughput is Not All You Need: goodput : https://hao-ai-lab.github.io/blogs/distserve/ [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- MarkTechPost - vLLM vs TensorRT-LLM vs HF TGI vs LMDeploy (2025-11): https://www.marktechpost.com/2025/11/19/vllm-vs-tensorrt-llm-vs-hf-tgi-vs-lmdeploy-a-deep-technical-comparison-for-production-llm-inference/ [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Structured outputs in vLLM (Red Hat Developer, 2025-06): https://developers.redhat.com/articles/2025/06/03/structured-outputs-vllm-guiding-ai-responses [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Autoscaling vLLM on OpenShift AI / KEDA (Red Hat, 2025-10): https://developers.redhat.com/articles/2025/10/02/autoscaling-vllm-openshift-ai [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Runpod - LLM inference optimization playbook (latency/throughput/cost) & scale-to-zero: https://www.runpod.io/articles/guides/llm-inference-optimization-playbook [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- Cross-references (in-hub & sibling skills) [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- references/llm-observability.md - observing a running endpoint (tracing, token/cost/latency, eval, drift). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- references/llm-integration-reviewer.md - consuming a hosted LLM API (failover, provider prompt caching, structured-output handling). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- references/llm-models.md - model landscape & selection (which model to serve). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- aws-ai-ml - managed inference on AWS (Bedrock, SageMaker endpoints, provisioned throughput). [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
- da-7-machine-learning - quantization algorithms (GPTQ/AWQ/FP8/INT4) and transformer/attention internals (FlashAttention, GQA) that this serving layer deliberately does not re-derive. [archived source: https://llms-explorer.com/sources/mdb-context-hub/llm-inference-serving/#references]
Where this helps
- Choosing a serving engine for a new deployment — vLLM as the default, SGLang for prefix-heavy or agentic multi-turn traffic, TensorRT-LLM for all-NVIDIA latency-critical workloads. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Sizing GPU memory correctly for concurrent traffic, since the KV cache — not just model weights — is often the binding constraint on how many requests can be served at once. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Choosing between chunked-prefill aggregation and prefill/decode disaggregation depending on deployment scale — chunked prefill is simpler and sufficient on a single node, while disaggregation earns its complexity at fleet scale. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Deciding whether speculative decoding will actually help a specific workload — it pays off in low-batch, latency-sensitive regimes with predictable text, and can be net-negative at large batch sizes or on surprising output. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Project ideas
- Stand up vLLM with prefix caching enabled and benchmark TTFT on a prefix-heavy workload (shared system prompt or RAG context) against the same setup with caching disabled. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Implement a small speculative-decoding pipeline using prompt-lookup decoding (n-gram copying from the prompt, no separate draft model) and measure the accepted-tokens-per-step speedup on a summarization or code-edit task. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Build a constrained-decoding demo that forces valid JSON output via a serving engine's guided_json/response_format parameter, then measure the per-token latency overhead versus unconstrained decoding. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Set up autoscaling for a self-hosted model behind a controller like KEDA, scaling on queue depth or pending requests rather than CPU%, and measure cost-per-token at different sustained-utilization levels. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Common mistakes
- Cranking batch size to post a great tokens/sec number while silently violating the latency SLO — raw throughput and goodput (SLO-compliant throughput) are different metrics, and optimizing the wrong one hides a real user-facing regression. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Benchmarking with uniform synthetic prompt/output lengths instead of replaying the real traffic shape — skewed length distributions and bursty arrival patterns are what production traffic actually has, and uniform benchmarks overstate throughput while hiding tail latency. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Sizing GPUs for model weights alone and ignoring the KV cache, which grows with batch size times context length and frequently rivals or exceeds the weights — a classic cause of an OOM that only appears once concurrency ramps up. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Enabling prefix caching on high-cardinality, low-overlap traffic, where the cached KV blocks are pure overhead that reduces serviceable concurrency instead of delivering the throughput win it gets on prefix-heavy traffic. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Known issues
- Constrained decoding guarantees structural validity, not semantic correctness — a schema-conforming JSON output can still contain nonsense content, so downstream semantic validation is still required. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Speculative decoding's benefit shrinks as batch size grows, because the spare compute it exploits during memory-bandwidth-bound decode disappears once the GPU is already compute-saturated by a large batch — it can even become net-negative at scale. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Tensor parallelism requires an all-reduce every layer, so running it across a slow inter-node link instead of within a node over NVLink cripples throughput rather than delivering the latency win it gets intra-node. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
- Prefill/decode disaggregation adds real KV-transfer overhead and operational complexity, so applying it to a single-node deployment usually costs more than it saves — chunked prefill is the simpler, usually-sufficient answer at that scale. [source] — AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.
Children
- Serving-engine landscape (vLLM, SGLang, TensorRT-LLM, TGI, LMDeploy, NVIDIA Dynamo) (frontier)
- PagedAttention and KV-cache memory management (+ KV offload: LMCache/KVBM/FlexKV) (frontier)
- Continuous / in-flight batching (frontier)
- Chunked prefill and the vLLM V1 unified scheduler (frontier)
- Prefix / prompt caching (Automatic Prefix Caching, RadixAttention) (frontier)
- Prefill/decode disaggregation (DistServe, Splitwise, KV-aware routing) (frontier)
- Latency/throughput metrics and SLOs (TTFT, TPOT/ITL, goodput) (frontier)
- Multi-GPU inference (tensor / pipeline / expert parallelism) (frontier)
- Constrained / structured decoding at serving layer (XGrammar, Outlines, llguidance) (frontier)
- Speculative decoding (draft models, Medusa, lookahead, EAGLE/EAGLE-2/EAGLE-3) (frontier)
- Endpoint autoscaling and cost-per-token (KEDA/Knative, scale-to-zero) (frontier)
Frontier under this node: Chunked prefill and the vLLM V1 unified scheduler, Constrained / structured decoding at serving layer (XGrammar, Outlines, llguidance), Continuous / in-flight batching, Endpoint autoscaling and cost-per-token (KEDA/Knative, scale-to-zero), Latency/throughput metrics and SLOs (TTFT, TPOT/ITL, goodput), Multi-GPU inference (tensor / pipeline / expert parallelism), PagedAttention and KV-cache memory management (+ KV offload: LMCache/KVBM/FlexKV), Prefill/decode disaggregation (DistServe, Splitwise, KV-aware routing), Prefix / prompt caching (Automatic Prefix Caching, RadixAttention), Serving-engine landscape (vLLM, SGLang, TensorRT-LLM, TGI, LMDeploy, NVIDIA Dynamo), Speculative decoding (draft models, Medusa, lookahead, EAGLE/EAGLE-2/EAGLE-3)