Multimodal KV Routing

Route multimodal requests to workers with the best KV cache overlap
View as Markdown

Overview

Multimodal KV routing extends Dynamo’s KV-aware router to account for image content when calculating cache overlap. The frontend assigns each image a stable hash and includes its identity in the routing view of the prompt.

When an image appears again, the KV router sends the request to the worker with the most matching KV cache blocks. This increases prefix-cache reuse and avoids repeating prefill work for cached multimodal content.

The KV cache stores attention key/value state so a worker can skip repeated prefill work. The embedding cache stores vision encoder outputs so the encoder can skip repeated image processing. You can use both features together. See Embedding Cache.

When to Use

Use multimodal KV routing when:

  • Multiple backend workers serve multimodal requests.
  • Images repeat across requests, such as product photos or shared reference images.
  • You want to maximize KV cache reuse for multimodal content.

Single-worker deployments do not need routing, and workloads with entirely unique images receive little image-specific cache benefit.

How It Works

The routing flow in general has three steps:

  1. The frontend computes a stable identity for each image.
  2. The frontend represents the image in a routing-only token view that matches the backend’s cache identity.
  3. The KV router selects the worker with the highest block overlap and forwards the same image identity to that worker.

vLLM provides two routing paths. Use the default Rust frontend for supported model families when you want minimal frontend processing. Use the Python chat processor when you need vLLM’s broader model support or want the frontend to preprocess images and transfer the processed inputs to workers.

Default Rust frontend

The frontend calculates only the image identity and routing token layout. The selected worker still runs the model’s multimodal processor. This path has lower frontend overhead, but multimodal routing depends on the model being registered with Dynamo’s Rust processor registry.

Alternative: Python chat processor

With --dyn-chat-processor vllm, the frontend runs vLLM’s full multimodal processor. It supports models known to vLLM without requiring a Dynamo Rust processor specification and can transfer processed inputs through shared memory or NIXL. This shifts preprocessing and transfer work to the frontend.

Launch

Use the Python chat processor when you need vLLM’s model-native multimodal processor or want to transfer processed multimodal inputs from the frontend. Otherwise, use the default Rust frontend.

Default Rust frontend

$cd $DYNAMO_HOME
$bash examples/backends/vllm/launch/agg_multimodal_router.sh

Alternative: Python chat processor

$cd $DYNAMO_HOME
$bash examples/backends/vllm/launch/agg_multimodal_router_chat_processor.sh

See vLLM Multimodal for model support, hashing behavior, transfer modes, and configuration.

Support Matrix

BackendRouting PathStatusNotes
vLLMRust frontend (default)YesSupported families include Qwen2-VL, Qwen2.5-VL, Qwen3-VL, LLaVA 1.5, LLaVA-NeXT, Llama 4, Kimi K2.5/K2.6, Qwen3.5, and Qwen3.6. The rest use text-prefix-only routing.
vLLMPython chat processorYesUses vLLM’s own multimodal processor — supports any VLM that vLLM supports.
SGLangRust frontend (default)YesDynamo’s SGLang image includes hash-forwarding support; custom installations must add it.
TensorRT-LLMRust frontend (default)YesSupported model scope is the Qwen2-VL family (Qwen2-VL / Qwen2.5-VL / Qwen3-VL) and Kimi (Kimi-K2.5 / Kimi-K2.6). Other multimodal models fall back to text-prefix routing.