@@ -84,12 +84,19 @@ pub struct RouterConfig {
8484 /// Profiling timeout in seconds (for vLLM profiling endpoints)
8585 #[ serde( default = "default_profile_timeout_secs" ) ]
8686 pub profile_timeout_secs : u64 ,
87+ /// TTL for Decode-side KV metadata cached by vLLM P/D router.
88+ #[ serde( default = "default_pd_kv_cache_ttl_secs" ) ]
89+ pub pd_kv_cache_ttl_secs : u64 ,
8790}
8891
8992fn default_profile_timeout_secs ( ) -> u64 {
9093 10
9194}
9295
96+ fn default_pd_kv_cache_ttl_secs ( ) -> u64 {
97+ 0
98+ }
99+
93100fn default_history_backend ( ) -> HistoryBackend {
94101 HistoryBackend :: Memory
95102}
@@ -491,6 +498,7 @@ impl Default for RouterConfig {
491498 history_backend : default_history_backend ( ) ,
492499 enable_profiling : false ,
493500 profile_timeout_secs : default_profile_timeout_secs ( ) ,
501+ pd_kv_cache_ttl_secs : default_pd_kv_cache_ttl_secs ( ) ,
494502 }
495503 }
496504}
@@ -1063,6 +1071,7 @@ mod tests {
10631071 history_backend : default_history_backend ( ) ,
10641072 enable_profiling : false ,
10651073 profile_timeout_secs : default_profile_timeout_secs ( ) ,
1074+ pd_kv_cache_ttl_secs : default_pd_kv_cache_ttl_secs ( ) ,
10661075 } ;
10671076
10681077 assert ! ( config. mode. is_pd_mode( ) ) ;
@@ -1131,6 +1140,7 @@ mod tests {
11311140 history_backend : default_history_backend ( ) ,
11321141 enable_profiling : false ,
11331142 profile_timeout_secs : default_profile_timeout_secs ( ) ,
1143+ pd_kv_cache_ttl_secs : default_pd_kv_cache_ttl_secs ( ) ,
11341144 } ;
11351145
11361146 assert ! ( !config. mode. is_pd_mode( ) ) ;
@@ -1195,6 +1205,7 @@ mod tests {
11951205 history_backend : default_history_backend ( ) ,
11961206 enable_profiling : false ,
11971207 profile_timeout_secs : default_profile_timeout_secs ( ) ,
1208+ pd_kv_cache_ttl_secs : default_pd_kv_cache_ttl_secs ( ) ,
11981209 } ;
11991210
12001211 assert ! ( config. has_service_discovery( ) ) ;
0 commit comments