[model-gateway] Add consistent hashing for ManualPolicy routing (#15907)

This commit is contained in:
Simo Lin
2025-12-26 22:53:03 -08:00
committed by GitHub
parent faecd37ed4
commit 171912a9e3
15 changed files with 1180 additions and 206 deletions
@@ -26,6 +26,7 @@ def policy_from_str(policy_str: Optional[str]) -> PolicyType:
"power_of_two": PolicyType.PowerOfTwo,
"bucket": PolicyType.Bucket,
"manual": PolicyType.Manual,
"consistent_hashing": PolicyType.ConsistentHashing,
}
return policy_map[policy_str]
@@ -13,6 +13,7 @@ pub enum PolicyType {
PowerOfTwo,
Bucket,
Manual,
ConsistentHashing,
}
#[pyclass(eq)]
@@ -416,6 +417,7 @@ impl Router {
bucket_adjust_interval_secs: self.bucket_adjust_interval_secs,
},
PolicyType::Manual => ConfigPolicyConfig::Manual,
PolicyType::ConsistentHashing => ConfigPolicyConfig::ConsistentHashing,
}
};