@@ -31,6 +31,7 @@ use dynamo_llm::kv_router::scheduler::KVHitRateEvent;
3131use dynamo_llm:: kv_router:: KV_HIT_RATE_SUBJECT ;
3232use dynamo_runtime:: {
3333 error, logging,
34+ metrics:: MetricsRegistry ,
3435 traits:: events:: { EventPublisher , EventSubscriber } ,
3536 utils:: { Duration , Instant } ,
3637 DistributedRuntime , ErrorContext , Result , Runtime , Worker ,
@@ -60,6 +61,10 @@ struct Args {
6061 #[ arg( long) ]
6162 endpoint : String ,
6263
64+ /// Model name for the target component (optional)
65+ #[ arg( long) ]
66+ model_name : Option < String > ,
67+
6368 /// Polling interval in seconds for scraping dynamo endpoint stats (minimum 1 second)
6469 #[ arg( long, default_value = "1" ) ]
6570 poll_interval : u64 ,
@@ -109,6 +114,7 @@ fn get_config(args: &Args) -> Result<LLMWorkerLoadCapacityConfig> {
109114 Ok ( LLMWorkerLoadCapacityConfig {
110115 component_name : args. component . clone ( ) ,
111116 endpoint_name : args. endpoint . clone ( ) ,
117+ model_name : args. model_name . clone ( ) ,
112118 } )
113119}
114120
@@ -131,7 +137,14 @@ async fn app(runtime: Runtime) -> Result<()> {
131137 . await
132138 . context ( "Unable to create unique instance of Count; possibly one already exists" ) ?;
133139
134- let target_component = namespace. component ( & config. component_name ) ?;
140+ let target_component = {
141+ let c = namespace. component ( & config. component_name ) ?;
142+ if let Some ( ref model) = config. model_name {
143+ c. add_labels ( & [ ( "model" , model. as_str ( ) ) ] ) ?
144+ } else {
145+ c
146+ }
147+ } ;
135148 let target_endpoint = target_component. endpoint ( & config. endpoint_name ) ;
136149
137150 let service_path = target_endpoint. path ( ) ;
0 commit comments