Skip to content

Commit b893aa7

Browse files
committed
make kv_routers prefix a const
Signed-off-by: PeaBrane <yanrpei@gmail.com>
1 parent cdc785c commit b893aa7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/llm/src/discovery.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ pub use watcher::{ModelUpdate, ModelWatcher};
1212

1313
/// The root etcd path for ModelEntry
1414
pub const MODEL_ROOT_PATH: &str = "models";
15+
16+
/// The root etcd path for KV Router registrations
17+
pub const KV_ROUTERS_ROOT_PATH: &str = "kv_routers";

lib/llm/src/discovery/model_manager.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use dynamo_runtime::component::Component;
1212
use dynamo_runtime::prelude::DistributedRuntimeProvider;
1313
use dynamo_runtime::slug::Slug;
1414

15-
use crate::discovery::ModelEntry;
15+
use crate::discovery::{KV_ROUTERS_ROOT_PATH, ModelEntry};
1616
use crate::kv_router::{KvRouterConfig, scheduler::DefaultWorkerSelector};
1717
use crate::{
1818
kv_router::KvRouter,
@@ -220,7 +220,8 @@ impl ModelManager {
220220
.ok_or_else(|| anyhow::anyhow!("KV routing requires etcd (dynamic mode)"))?;
221221
let router_uuid = uuid::Uuid::new_v4();
222222
let router_key = format!(
223-
"kv_routers/{}/{}",
223+
"{}/{}/{}",
224+
KV_ROUTERS_ROOT_PATH,
224225
Slug::from_string(model_name),
225226
router_uuid
226227
);

0 commit comments

Comments
 (0)