
NVIDIA Dynamo is a distributed inference orchestration platform that accelerates LLM deployments through intelligent request routing, resource management, and disaggregated prefill-decode separation. The framework integrates with multiple inference backends to provide flexible deployment options while maintaining consistent API interfaces.
This guide outlines the deployment of NVIDIA Dynamo with SGLang, a high-performance backend optimized for structured generation. It covers infrastructure setup, container deployment, aggregated serving for single-GPU configurations, and disaggregated serving that separates prefill and decode phases across dedicated GPUs.
Before you begin, ensure you:
This deployment uses several components that work together to provide efficient LLM inference.
NVIDIA Dynamo serves as the orchestration layer, managing GPU resources, routing requests, and coordinating between different workers. The platform includes a frontend service that receives inference requests, a smart router that directs traffic based on KV cache awareness, and a GPU planner that dynamically adjusts resource allocation based on workload demands.
SGLang acts as the inference backend, providing fast structured generation and efficient memory management through RadixAttention. It supports two worker types: prefill workers process incoming prompts and generate initial tokens with disaggregation-mode prefill, while decode workers handle sequential token generation with disaggregation-mode decode. The SGLang backend integrates with Dynamo through metrics reporting and bootstrap coordination.
etcd provides distributed service discovery, allowing Dynamo components to locate and communicate with each other across the cluster. It maintains a registry of active workers and their capabilities.
NATS handles message passing between components, particularly for KV cache events. Prefill workers publish KV cache information through NATS, enabling the router to make intelligent decisions about request placement.
NIXL (NVIDIA Inter-GPU Exchange Library) manages efficient data transfer between GPUs during disaggregated serving. It enables prefill workers to transfer KV cache data to decode workers with minimal latency through the disaggregation transfer backend.
The Dynamo repository contains deployment scripts, container utilities, and orchestration modules required to run inference workloads. Clone the repository to access the SGLang-specific configurations and container runtime scripts.
Clone the repository.
Navigate to the repository directory.
Switch to the latest stable release.
The command checks out the stable release. Visit the Dynamo releases page to find the latest stable release version.
Dynamo requires etcd for worker registry and NATS for KV cache event propagation between workers. The Docker Compose configuration launches both services with exposed ports (etcd: 2379-2380, NATS: 4222, 6222, 8222). These services must run continuously for request coordination.
Start the infrastructure services.
Verify the services are running.
The output displays the running etcd and NATS containers.
The SGLang container requires a CUDA version match between the host driver and container runtime to prevent GPU kernel incompatibilities. The NVIDIA Container Toolkit maps host GPUs into containers, requiring the container's CUDA version to align with the host driver's supported version.
Check the installed CUDA version.
The output displays the CUDA version in the top-right corner of the table.
Pull the SGLang container image from NGC. Match the CUDA version in the image tag to your system's CUDA version.
For CUDA 13.x, use:
For CUDA 12.x, use:
Visit the NVIDIA NGC Catalog to view all available image tags and CUDA versions.
(Optional) Build the container from source instead of pulling the pre-built image.
The build process creates an image named dynamo:latest-sglang. If you prefer using this locally built image, replace nvcr.io/nvidia/ai-dynamo/sglang-runtime:0.9.0-cuda13 with dynamo:latest-sglang in all subsequent commands.
The container runs as UID 1000 and requires write access to the Hugging Face cache directory for model downloads. Incorrect permissions prevent the container from accessing cached model weights, causing worker initialization failures.
Create the cache directory if it does not exist.
Set ownership to the container user (UID 1000).
Set appropriate permissions.
Aggregated serving combines prefill and decode phases on a single worker, eliminating inter-GPU data transfers and reducing request latency. This architecture suits single-GPU environments or workloads prioritizing response time over throughput. The deployment script configures the Dynamo frontend to route requests to a unified SGLang worker that handles both prompt processing and token generation on the same GPU.
Export your Hugging Face token to avoid rate limitations when downloading large models. Replace YOUR_HF_TOKEN with your actual token.
Run the SGLang container with GPU access and workspace mounting. Use the image tag that matches your CUDA version from the previous section.
The command starts an interactive container session with GPU support and passes the Hugging Face token to the container.
Inside the container, create a custom launch script for aggregated serving with the NVIDIA Nemotron model.
Make the script executable.
Run the aggregated serving script.
The script starts the frontend service on port 8000 and an SGLang worker that loads the specified model (defaults to NVIDIA Nemotron Nano 4B).
To deploy the larger NVIDIA Nemotron Super 49B model instead, pass the model name as an argument:
The 49B model requires high-memory GPUs such as B200 or GB200 class devices. Ensure sufficient VRAM and consider tensor parallelism for production deployments.
Open a new terminal session on your server (outside the container).
Test with a chat completion request.
The output displays the model's chat response in JSON format.
Disaggregated serving assigns prefill and decode phases to separate GPU workers, enabling independent scaling of each phase. Prefill workers process prompts and transfer KV cache data to decode workers via NIXL, maximizing throughput by separating prompt processing from token generation.
Exit the container if you are still inside from the previous section. Press Ctrl+C to terminate the running process, then press Ctrl+D to exit the container.
Export your Hugging Face token. Replace YOUR_HF_TOKEN with your actual token.
Run the container with the image tag that matches your CUDA version.
Inside the container, create a custom launch script for disaggregated serving with the NVIDIA Nemotron model.
Make the script executable.
Run the disaggregated serving script.
The script starts the frontend service on port 8000, a prefill worker on GPU 0, and a decode worker on GPU 1 with the specified model (defaults to NVIDIA Nemotron Nano 4B).
To deploy the larger NVIDIA Nemotron Super 49B model instead, pass the model name as an argument:
The 49B model requires high-memory GPUs such as B200 or GB200 class devices. Ensure sufficient VRAM and consider tensor parallelism for production deployments.
Open a new terminal session on your server (outside the container).
Test with multiple sequential requests to observe worker distribution.
Each request returns a unique ID, and the logs inside the container show which workers process each request.
Test with concurrent requests to verify load distribution.
Dynamo's router distributes the requests across the prefill and decode workers.
You have successfully deployed inference workloads using NVIDIA Dynamo with SGLang. The aggregated serving configuration provides a simple, single-GPU deployment suitable for low-latency applications, while the disaggregated serving configuration optimizes throughput by separating prefill and decode phases across multiple GPUs. Dynamo's intelligent routing and resource management maximize GPU utilization and token generation efficiency. For more advanced configurations, including KV-aware routing, multimodal support, and Kubernetes deployments, refer to the official NVIDIA Dynamo documentation.
0 Comments
Be the first to comment and share your perspective with the community.