Skip to content

Commit f542d8c

Browse files
committed
use default snapshot_threshold of 10000
Signed-off-by: PeaBrane <yanrpei@gmail.com>
1 parent 0e496b8 commit f542d8c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

components/frontend/src/dynamo/frontend/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ def parse_args():
152152
parser.add_argument(
153153
"--router-snapshot-threshold",
154154
type=int,
155-
default=None,
156-
help="KV Router: Number of messages in stream before triggering a snapshot. If not set, snapshots are disabled.",
155+
default=10000,
156+
help="KV Router: Number of messages in stream before triggering a snapshot. Defaults to 10000.",
157157
)
158158
parser.add_argument(
159159
"--router-persist-states",

docs/architecture/kv_cache_routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The main KV-aware routing arguments:
2727

2828
- `--router-reset-states`/`--router-persist-states`: Controls whether the router state is reset on startup. When `--router-reset-states` is used (default), the router clears both the JetStream event stream and NATs object store, starting with a fresh state. When `--router-persist-states` is used, the router retains existing state from previous runs, downloading any available snapshot from NATs object store and continuing to consume events from where it left off. This enables routers to maintain KV cache awareness across restarts. **Note**: State persistence is only available when `--use-kv-events` is enabled (default). When using `--no-kv-events` with `ApproxKvIndexer`, state persistence is not supported.
2929

30-
- `--router-snapshot-threshold`: Sets the number of messages in the JetStream before triggering a snapshot. When the message count exceeds this threshold, a router will attempt to purge acknowledged messages from the stream and create a snapshot of the current radix tree state in NATs object store. If not set, snapshots are disabled. This helps manage stream size and provides faster initialization for routers that restart.
30+
- `--router-snapshot-threshold`: Sets the number of messages in the JetStream before triggering a snapshot. When the message count exceeds this threshold, a router will attempt to purge acknowledged messages from the stream and create a snapshot of the current radix tree state in NATs object store. Defaults to 10000. This helps manage stream size and provides faster initialization for routers that restart.
3131

3232
## Architecture
3333

lib/bindings/python/rust/llm/entrypoint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl KvRouterConfig {
4242
#[pymethods]
4343
impl KvRouterConfig {
4444
#[new]
45-
#[pyo3(signature = (overlap_score_weight=1.0, router_temperature=0.0, use_kv_events=true, router_replica_sync=false, router_snapshot_threshold=None, router_reset_states=true))]
45+
#[pyo3(signature = (overlap_score_weight=1.0, router_temperature=0.0, use_kv_events=true, router_replica_sync=false, router_snapshot_threshold=10000, router_reset_states=true))]
4646
fn new(
4747
overlap_score_weight: f64,
4848
router_temperature: f64,

lib/llm/src/kv_router.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl Default for KvRouterConfig {
121121
use_kv_events: true,
122122
router_replica_sync: false,
123123
max_num_batched_tokens: 8192,
124-
router_snapshot_threshold: None,
124+
router_snapshot_threshold: Some(10000),
125125
router_reset_states: true,
126126
}
127127
}

0 commit comments

Comments
 (0)