You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/router/README.md
+63Lines changed: 63 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -216,6 +216,69 @@ The router uses KV events from workers by default to maintain an accurate global
216
216
-**NATS is not needed** - suitable for simpler deployments without NATS infrastructure
217
217
- Suitable for testing or when event processing becomes a bottleneck
218
218
219
+
## Event Transport Modes
220
+
221
+
The router supports two event transport modes for KV cache state synchronization:
222
+
223
+
-**JetStream (default)**: Persistent event stream with durable consumers. State persists across router restarts via snapshots in NATS object store. Best for production with multi-replica consistency.
224
+
225
+
-**NATS Core with Local Indexer** (`--enable-local-indexer` on workers): Fire-and-forget pub/sub where workers maintain local radix trees. Router rebuilds state by querying workers on startup. Lower latency, simpler setup.
226
+
227
+
See [KV Cache Routing](kv_cache_routing.md#global-kv-cache-state-synchronization) for architecture diagrams and details.
228
+
229
+
## Disaggregated Serving
230
+
231
+
Dynamo supports disaggregated serving where prefill and decode are handled by separate worker pools. Register prefill workers with `ModelType.Prefill` and the frontend automatically activates an internal prefill router.
232
+
233
+
Key points:
234
+
- Prefill router auto-activates when both prefill and decode workers register with the same model name
235
+
- Supports vLLM and TensorRT-LLM backends (SGLang requires separate router setup)
236
+
- Use `--no-track-active-blocks` for prefill-only workers
237
+
238
+
See [KV Cache Routing - Disaggregated Serving](kv_cache_routing.md#disaggregated-serving-prefill-and-decode) for setup examples.
239
+
240
+
## Router Replicas and State Persistence
241
+
242
+
For high availability, run multiple router replicas with `--router-replica-sync` to synchronize active block tracking via NATS.
243
+
244
+
State persistence options:
245
+
-**JetStream mode**: Automatic persistence via event stream and object store snapshots
246
+
-**Local Indexer mode**: State rebuilds from workers on startup
247
+
-**Reset state**: Use `--router-reset-states` to start fresh (use with caution)
248
+
249
+
See [KV Cache Routing - Serving Multiple Router Replicas](kv_cache_routing.md#serving-multiple-router-replicas) for details.
250
+
251
+
## Busy Thresholds
252
+
253
+
Control worker saturation with busy thresholds:
254
+
-`--active-decode-blocks-threshold <0.0-1.0>`: Mark workers busy when KV cache utilization exceeds threshold
255
+
-`--active-prefill-tokens-threshold <count>`: Mark workers busy when active prefill tokens exceed threshold
256
+
257
+
Thresholds can be updated at runtime via the `/busy_threshold` HTTP endpoint. See [Dynamic Threshold Configuration](kv_cache_routing.md#dynamic-threshold-configuration).
258
+
259
+
## Python API
260
+
261
+
For programmatic routing control, use the `KvPushRouter` class directly:
262
+
263
+
```python
264
+
from dynamo.llm import DistributedRuntime, KvPushRouter, KvRouterConfig
0 commit comments