NVIDIA Dynamo
Run a fleet of inference engines as one service with NVIDIA Dynamo. Put one frontend in front of many vLLM or SGLang workers, route each request to the worker that already holds its KV cache, split prefill and decode across GPUs, deploy and scale on Kubernetes, and keep serving when workers fail.
Independent educational course. Project names and marks belong to their respective owners; their use does not imply sponsorship or endorsement.
How to work through this course
Before you begin: The free Foundations course and one engine course (vLLM or SGLang), or equivalent experience running a single inference server. You should be comfortable with Python, a Linux shell, and basic Kubernetes. The deployment runbooks need NVIDIA GPUs, two for the multi-worker steps; every lesson exercise runs on a laptop with Python.
By the end: Size a multi-worker deployment from workload facts, choose between aggregated, KV-routed, and disaggregated serving with benchmarks you can defend, and operate it with metrics, traces, load shedding, draining, and a rehearsed rollback.
- Understand the idea. Read each section in order and study its diagrams. When a pause-and-predict question appears, commit to an answer before you reveal it. Look up unfamiliar terms in the glossary below.
- Try it yourself. Run the code examples and compare your output with the lesson's. Use the browser labs where available; steps that need a GPU are optional and say so.
- Check your understanding. Answer the knowledge check at the end of each lesson and make sure you can say why the other options are wrong. Complete all units to unlock the final quiz; the passing score is 80%.
The optional project brings the lessons together. Keep notes on your choices, results, and any failures so you can explain what you learned.
Course orientation
What is NVIDIA Dynamo?
NVIDIA Dynamo is an open-source framework for serving a model across many GPUs and nodes. It does not run the model itself: vLLM, SGLang, or TensorRT-LLM still execute it inside each worker. Dynamo adds the fleet layer around them: one OpenAI-compatible frontend, a registry of live workers, a router that picks a worker for each request, KV cache transfer between workers and memory tiers, and a planner and Kubernetes operator that size the worker pools.
The problem it solves
One engine schedules requests inside one replica. Once you run several replicas, questions appear that no engine answers: which worker should take this request, where its reusable KV cache already lives, whether long prompts should run on different GPUs from token generation, how many workers of each kind to run, and what happens to requests in flight when a worker dies. Dynamo answers each question with a separate component, so you adopt only the ones your workload needs.
Request path
- 01Frontend and router
The frontend accepts OpenAI-compatible requests on port 8000, applies the chat template, tokenizes the prompt, and passes token IDs to its router, which picks a worker by round-robin or by cached prefix and load.
- 02Discovery and transports
Workers register their endpoints in discovery (etcd, local files, or Kubernetes resources). Requests travel to workers over TCP by default, and KV cache events travel on a separate event plane.
- 03Engine workers
Each worker wraps an unchanged vLLM, SGLang, or TensorRT-LLM engine at the version the Dynamo release pins. A worker either runs prefill and decode together (aggregated) or specializes in one of them (disaggregated).
- 04KV transfer and tiers
NIXL moves KV blocks directly from a prefill GPU to a decode GPU, and KVBM offloads blocks to CPU memory or disk so a later request can reuse them instead of recomputing.
- 05Control and operations
The Kubernetes operator deploys the whole graph, the planner recommends or applies worker counts, and metrics, traces, load shedding, draining, and request migration keep the service observable and recoverable.
What it covers
- One client-facing API for many workers, including templating, tokenization, streaming, and cancellation.
- Worker registration, discovery, and readiness, so requests go only to workers that can serve them.
- KV-aware routing that weighs each worker's cached prefix against its load, using events the workers publish.
- Disaggregated prefill and decode, with KV transfer through NIXL and cache offload through KVBM.
- Kubernetes deployment, SLA-driven planning, load shedding, graceful shutdown, and request migration.
Outside its scope
- Running the model. Kernels, batching inside a worker, and the local KV cache belong to the engine, at the engine version Dynamo 1.4.2 pins (vLLM 0.26.0, SGLang 0.5.16).
- Deciding that a component is worth it. Every component adds processes and failure modes, and a single engine or plain replicas are often the right answer.
- Authenticating users. The frontend has no user authentication of its own, so it belongs behind a gateway that has.
- Sizing a fleet from simulation alone. DynoSim and Mocker help rank designs; only measurements on real GPUs size them.
Key terms in this course
- Frontend
- The OpenAI-compatible HTTP entry point that templates, tokenizes, routes, and streams responses.
- Worker
- A process that wraps one engine and registers its endpoints so the frontend can find it.
- Discovery
- The live registry of workers and their endpoints, kept in etcd, local files, or Kubernetes resources.
- Aggregated serving
- Each worker runs both prefill and decode for its requests, as a single engine does.
- KV-aware routing
- Choosing a worker by how much of the prompt it already has cached, weighed against how busy it is.
- KV events
- Messages workers publish when they store or evict KV blocks, which keep the router's view of each cache current.
- Disaggregated serving
- Running prefill and decode on separate workers and moving each request's KV cache between them.
- NIXL
- NVIDIA's transfer library, which moves KV blocks between GPUs and nodes.
- KVBM
- Dynamo's KV block manager, which offloads cache blocks from GPU memory to CPU memory and disk.
- Planner
- A control loop that turns measured load and latency targets into worker counts, run in advisory mode first.
- Request migration
- Continuing an in-flight request on another worker after its worker fails, starting from the tokens generated so far.
- TTFT and ITL
- Time to first token and inter-token latency: how long a user waits for the first token, and between later ones.
Syllabus
- 01What is NVIDIA Dynamo?Up nextSay which jobs NVIDIA Dynamo takes on around an inference engine and which jobs stay inside vLLM, SGLang, or TensorRT-LLM.
- 02The Dynamo frontend: APIs, streaming, and request hintsOpenList the endpoints the Dynamo 1.4.2 frontend serves and predict whether a request gets 200, 400, 404, or 503 before it reaches a worker.
- 03Discovery, transports, and worker readinessOpenName a Dynamo worker by its namespace, component, and endpoint, and find its registration in discovery.
- 04Backend integrations: vLLM, SGLang, and TensorRT-LLM inside DynamoOpenDescribe what each Dynamo backend wrapper adds around vLLM, SGLang, and TensorRT-LLM, and what the engine still does alone.
- 05KV-aware routing: prefix overlap against loadOpenCompute the cost Dynamo 1.4.2's KV router assigns to each worker from its cached prefix, queued prompt tokens, and active decode blocks, and predict which worker it picks.
- 06NIXL, KVBM, and where KV blocks liveOpenCalculate how long it takes to move a request's KV blocks over NVLink, PCIe, a network, or an SSD, and compare it with recomputing them.
- 07Disaggregated prefill and decodeOpenTrace a request through Dynamo's prefill router, a prefill worker, a NIXL transfer, and a decode worker, and name what happens at each step.
- 08Deploy locally with an engine backendOpenStart a Dynamo frontend and one aggregated vLLM or SGLang worker from the 1.4.2 runtime container, and send a first request.
- 09Operate Dynamo on KubernetesOpenName the custom resources the Dynamo 1.4.2 operator reconciles, and trace a DynamoGraphDeployment down to its components, pods, and discovery records.
- 10Plan capacity and autoscale with the PlannerOpenWrite a DynamoGraphDeploymentRequest that describes a workload, latency targets, and hardware, and read what the profiler selected before anything deploys.
- 11Observability and resilience: trace, shed, drain, and recoverOpenTurn on Dynamo 1.4.2's metrics, JSONL logs, and OpenTelemetry traces, and follow one request by its `x-request-id` from the frontend through prefill, KV transfer, and decode.
- 12Capstone: design the inference fleetOpenWrite a workload table and service-level objectives (SLOs) precise enough to size a fleet from.
- QFinal graded quizComplete all units to unlock
Full unit-by-unit learning objectives (56 outcomes)
01 · What is NVIDIA Dynamo?
- Say which jobs NVIDIA Dynamo takes on around an inference engine and which jobs stay inside vLLM, SGLang, or TensorRT-LLM.
- Name the decisions a fleet of workers must make that a single engine never sees, and put numbers on one of them.
- Trace one request through Dynamo's request plane, control plane, and state path, and say which component owns each step.
- Decide from workload facts whether one engine, plain replicas, or Dynamo components fit a deployment.
- Start a one-frontend, one-worker Dynamo deployment and prove that a worker is registered before you trust it.
02 · The Dynamo frontend: APIs, streaming, and request hints
- List the endpoints the Dynamo 1.4.2 frontend serves and predict whether a request gets 200, 400, 404, or 503 before it reaches a worker.
- Follow a streamed request and its cancellation from the client through the frontend to the engine, and tell a completed stream from a failed or cut-off one.
- Configure a gateway that turns client-supplied priority, tenant, and worker hints into bounded, authenticated values.
- Choose the parser flags for a model and validate every parsed tool call before an application executes it.
03 · Discovery, transports, and worker readiness
- Name a Dynamo worker by its namespace, component, and endpoint, and find its registration in discovery.
- Choose the discovery, request, and event transports for a deployment, and say what breaks when each one fails.
- Trace a worker from process start to its first routed request, and gate traffic on the right readiness signal.
- Estimate how many requests fail when a worker crashes instead of draining, and shrink that number.
04 · Backend integrations: vLLM, SGLang, and TensorRT-LLM inside Dynamo
- Describe what each Dynamo backend wrapper adds around vLLM, SGLang, and TensorRT-LLM, and what the engine still does alone.
- Check a runtime image against the Dynamo 1.4.2 compatibility matrix and explain why a newer standalone engine cannot be dropped in.
- Sort the flags of a worker command into Dynamo runtime, wrapper, and engine layers, and predict which ones the worker rejects.
- Plan a backend swap as a migration, with fixed fixtures, measured capacity, and a rollback image.
05 · KV-aware routing: prefix overlap against load
- Compute the cost Dynamo 1.4.2's KV router assigns to each worker from its cached prefix, queued prompt tokens, and active decode blocks, and predict which worker it picks.
- Explain why the worker with the longest cached prefix can lose, and show it with numbers.
- Name the moments when the router's view of caches and load is stale, and the flags that shrink each window.
- Simulate round-robin, longest-prefix, and cost-based routing on a laptop and read the trade-off between hit rate and time to first token.
- Enable KV routing on a two-worker deployment and prove from metrics that workers publish cache events and the router consumes them.
06 · NIXL, KVBM, and where KV blocks live
- Calculate how long it takes to move a request's KV blocks over NVLink, PCIe, a network, or an SSD, and compare it with recomputing them.
- Explain what NIXL registers, exchanges, and transfers during a prefill-to-decode handoff, and what the two sides must agree on.
- Size KVBM's GPU, host, and disk tiers with the right environment variables, and tell offloading from useful reuse in its metrics.
- Work out how topology and lower cache tiers change the router's choice of worker.
- Explain why stale transfer metadata must lead to recomputation, and configure the settings that decide what happens when a transfer fails.
07 · Disaggregated prefill and decode
- Trace a request through Dynamo's prefill router, a prefill worker, a NIXL transfer, and a decode worker, and name what happens at each step.
- Calculate the KV transfer time for a real model and link, and compare it with the prefill it follows.
- Explain how running long prefills on separate GPUs protects inter-token latency, and what it costs in time to first token and decode capacity.
- Decide from workload facts and equal-GPU benchmarks whether a deployment should stay aggregated or split its phases.
- Recognize the handoff's failure modes (missing connector, port clashes, expired leases, failed loads) and the metrics that reveal them.
08 · Deploy locally with an engine backend
- Start a Dynamo frontend and one aggregated vLLM or SGLang worker from the 1.4.2 runtime container, and send a first request.
- Choose between file and etcd discovery for a local deployment, and explain what each one gives up.
- Gate traffic on layered health checks, and tell a frontend, discovery, engine, or request failure apart from the evidence.
- Record a local topology so a teammate can reproduce it, and shut it down without leaving stale registrations or GPU processes.
- Grow the deployment one component at a time, each justified by a measured constraint.
09 · Operate Dynamo on Kubernetes
- Name the custom resources the Dynamo 1.4.2 operator reconciles, and trace a DynamoGraphDeployment down to its components, pods, and discovery records.
- Write or review a DynamoGraphDeployment whose components carry the right role, image, and GPU request for aggregated or disaggregated serving.
- Calculate how long the operator's probes and a pod's drain window give a worker, and say what protects requests when a worker dies mid-stream.
- Choose which role to scale from sustained signals: prefill for time to first token, decode for inter-token latency and KV pressure, the frontend for CPU.
- Deploy a model graph from a saved manifest, verify it through the frontend, and remove it without touching the platform.
10 · Plan capacity and autoscale with the Planner
- Write a DynamoGraphDeploymentRequest that describes a workload, latency targets, and hardware, and read what the profiler selected before anything deploys.
- Calculate prefill and decode capacity separately for a workload, and explain why one request rate can need very different splits.
- Explain how the Planner's SLA mode turns traffic predictions and live engine metrics into replica counts, and which settings bound it.
- Simulate a delayed control loop and show why scaling on instantaneous queue depth oscillates.
- Run the Planner in advisory mode, compare its recommendations with real traffic, and decide when to let it act.
11 · Observability and resilience: trace, shed, drain, and recover
- Turn on Dynamo 1.4.2's metrics, JSONL logs, and OpenTelemetry traces, and follow one request by its `x-request-id` from the frontend through prefill, KV transfer, and decode.
- Say what an AIPerf measurement, a DynoSim replay, and a Mocker run can each claim, and label every result accordingly.
- Configure load shedding so an overloaded fleet returns HTTP 529 quickly instead of queueing every request into a timeout.
- Remove a worker in the right order (stop new routing, then drain bounded work) and predict what a crash costs with and without request migration.
- Write a failure drill with an expected outcome and a recovery deadline, and rehearse the rollback that ends it.
12 · Capstone: design the inference fleet
- Write a workload table and service-level objectives (SLOs) precise enough to size a fleet from.
- Estimate KV cache memory, decode step time, prefill load, and GPU count for a real model, and add the spare capacity a worker loss needs.
- Choose between aggregated, KV-routed, and disaggregated serving from those numbers, and explain why aggregated wins whenever it meets the SLOs.
- Turn the design into a benchmark plan with predictions that could prove it wrong, a failure plan, and a rollback trigger.
Optional field project
Build, measure, and defend a Dynamo fleet
- 01Run one frontend and one worker, then prove membership and the API
- 02Measure routing, cache tiers, and the prefill and decode split
- 03Make the topology reproducible, then run it on Kubernetes
- 04Plan capacity, drill failures, and defend the design
View optional project brief
Sign in to read the project brief.
Free guides and tools
- Serving systemsNVIDIA Triton Inference Server: architecture and serving
- Serving systemsDisaggregated serving and KV-aware routing for LLMs
- FoundationsPrefill vs. decode: how LLM inference latency works
- CalculatorEstimate model weights and KV-cache memory
- PracticePractice inference algorithms in Python and NumPy