dynamo/docs/components/router
dagil-nvidia 46dad85b03
docs: update KVBM diagram and bump container image tags to 1.0.0 (#7365)
Signed-off-by: Dan Gil <dagil@nvidia.com>
2026-03-13 18:08:10 -05:00
..
README.md feat(kv-router): pluggable scheduling policy for router queue [DYN-2454] (#7260) 2026-03-13 04:16:49 +00:00
kv-event-replay-comparison.md docs(kv-router): add kv event replay comparison with vLLM (#6928) 2026-03-05 09:17:34 -08:00
router-examples.md docs: update KVBM diagram and bump container image tags to 1.0.0 (#7365) 2026-03-13 18:08:10 -05:00
router-guide.md test: generalize router test infrastructure and expand documentations (#7327) 2026-03-13 13:58:32 -07:00
standalone-indexer.md feat(kv-router): add Prometheus metrics to standalone indexer (#7339) 2026-03-13 10:07:48 -07:00

README.md

title
Router

The Dynamo KV Router intelligently routes requests by evaluating their computational costs across different workers. It considers both decoding costs (from active blocks) and prefill costs (from newly computed blocks), using KV cache overlap to minimize redundant computation. Optimizing the KV Router is critical for achieving maximum throughput and minimum latency in distributed inference setups.

Quick Start

To launch the Dynamo frontend with the KV Router:

python -m dynamo.frontend --router-mode kv --http-port 8000

For Kubernetes, set DYN_ROUTER_MODE=kv on the Frontend service. Workers automatically report KV cache events — no worker-side configuration changes needed.

Argument Default Description
--router-mode kv round_robin Enable KV cache-aware routing
--router-kv-overlap-score-weight 1.0 Balance prefill vs decode optimization (higher = better TTFT)
--no-router-kv-events enabled Fall back to approximate routing (no event consumption from workers)
--router-queue-threshold 2.0 Backpressure queue threshold; enables priority scheduling via nvext.agent_hints.latency_sensitivity
--router-queue-policy fcfs Queue scheduling policy: fcfs (tail TTFT) or wspt (avg TTFT)

Standalone Router

You can also run the KV router as a standalone service (without the Dynamo frontend). See the Standalone Router component for more details.

For all CLI arguments, environment variables, K8s deployment examples, and tuning guidelines, see the Router Guide. For A/B benchmarking, see the KV Router A/B Benchmarking Guide.

Prerequisites and Limitations

Requirements:

  • Dynamic endpoints only: KV router requires register_model() with model_input=ModelInput.Tokens. Your backend handler receives pre-tokenized requests with token_ids instead of raw text.
  • Backend workers must call register_model() with model_input=ModelInput.Tokens (see Backend Guide)
  • You cannot use --static-endpoint mode with KV routing (use dynamic discovery instead)

Multimodal Support:

  • TRT-LLM and vLLM: Multimodal routing supported for images via multimodal hashes
  • SGLang: Image routing not yet supported
  • Other modalities (audio, video, etc.): Not yet supported

Limitations:

  • Static endpoints not supported—KV router requires dynamic model discovery via etcd to track worker instances and their KV cache states

For basic model registration without KV routing, use --router-mode round-robin or --router-mode random with both static and dynamic endpoints.

Next Steps

  • Router Guide: Deep dive into KV cache routing, configuration, disaggregated serving, and tuning
  • Router Examples: Python API usage, K8s examples, and custom routing patterns
  • Standalone Indexer: Run the KV indexer as a separate service for independent scaling
  • Router Design: Architecture details, algorithms, and event transport modes