| title | Examples |
|---|
For quick start instructions, see the SGLang README. This document provides all deployment patterns for running SGLang with Dynamo, including LLMs, multimodal, and diffusion models, and Kubernetes deployment.
- Infrastructure Setup
- LLM Serving
- Embedding Models
- Vision Models
- Diffusion Models
- Kubernetes Deployment
- Testing
For local/bare-metal development, start etcd and optionally NATS using Docker Compose:
docker compose -f deploy/docker-compose.yml up -dThe simplest deployment pattern: a single worker handles both prefill and decode.
cd $DYNAMO_HOME/examples/backends/sglang
./launch/agg.shTwo workers behind a KV-aware router that maximizes cache reuse:
cd $DYNAMO_HOME/examples/backends/sglang
./launch/agg_router.shThis launches the frontend with --router-mode kv and two workers with ZMQ-based KV event publishing.
Separates prefill and decode into independent workers connected via NIXL for KV cache transfer. Requires 2 GPUs.
cd $DYNAMO_HOME/examples/backends/sglang
./launch/disagg.shFor details on how SGLang disaggregation works with Dynamo, including the bootstrap mechanism and RDMA transfer flow, see SGLang Disaggregation.
Scales to 2 prefill + 2 decode workers with KV-aware routing on both pools. Requires 4 GPUs.
cd $DYNAMO_HOME/examples/backends/sglang
./launch/disagg_router.shThe frontend uses --router-mode kv and automatically detects prefill workers to activate an internal prefill router. Each worker publishes KV events over ZMQ on unique ports.
Serve multimodal models using SGLang's built-in multimodal support:
cd $DYNAMO_HOME/examples/backends/sglang
./launch/agg_vision.shFor advanced multimodal deployments with separate encoder, prefill, and decode workers (E/PD and E/P/D patterns), see the dedicated SGLang Multimodal documentation.
| Pattern | Script | Description |
|---|---|---|
| E/PD | ./launch/multimodal_epd.sh |
Separate vision encoder + combined PD worker |
| E/P/D | ./launch/multimodal_disagg.sh |
Separate encoder, prefill, and decode workers |
Run diffusion language models like LLaDA2.0:
cd $DYNAMO_HOME/examples/backends/sglang
./launch/diffusion_llada.shGenerate images from text prompts using FLUX or other diffusion models:
cd $DYNAMO_HOME/examples/backends/sglang
./launch/image_diffusion.shOptions: --model-path, --fs-url (local or S3), --http-url.
Generate videos from text prompts using Wan2.1 models:
cd $DYNAMO_HOME/examples/backends/sglang
./launch/text-to-video-diffusion.shOptions: --wan-size 1b|14b, --num-frames, --height, --width, --num-inference-steps.
For full details on all diffusion worker types (LLM, image, video), see Diffusion.
For complete K8s deployment examples, see:
RuntimeError: cuDNN frontend 1.8.1 requires cuDNN lib >= 9.5.0
Set SGLANG_DISABLE_CUDNN_CHECK=1 before launching. This is common when PyTorch ships a CuDNN version older than what SGLang's Conv3d models require. Affects vision and diffusion models.
unable to extract config.json from directory ...
This happens with diffusers models (FLUX.1-dev, Wan2.1, etc.) that use model_index.json instead of config.json. Ensure you are using the correct worker flag (--image-diffusion-worker or --video-generation-worker) rather than the standard LLM worker mode. These flags use a registration path that does not require config.json.
If a previous run left orphaned GPU processes, the next launch may OOM. Check for zombie processes:
nvidia-smi # look for lingering sgl_diffusion::scheduler or python processes
kill -9 <PID>Ensure both prefill and decode workers can reach each other over TCP. The bootstrap mechanism uses --disaggregation-bootstrap-port (default: 12345). For multi-node setups, ensure the port is reachable across hosts and set --host 0.0.0.0.
- SGLang README: Quick start and feature overview
- Reference Guide: Architecture, configuration, and operational details
- SGLang Multimodal: Vision model deployment patterns
- SGLang HiCache: Hierarchical cache integration
- Benchmarking: Performance benchmarking tools
- Tuning Disaggregated Performance: P/D tuning guide