[model-gateway] Add consistent hashing for ManualPolicy routing (#15907)
This commit is contained in:
@@ -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,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user