fix(router.py): fix high-traffic bug for usage-based-routing-v2

This commit is contained in:
Krrish Dholakia 2024-04-29 16:47:30 -07:00
parent 09bae3d8ad
commit e7b4882e97

View file

@ -2779,7 +2779,10 @@ class Router:
self.cache.get_cache(key=model_id, local_only=True) or 0
)
### get usage based cache ###
if isinstance(model_group_cache, dict):
if (
isinstance(model_group_cache, dict)
and self.routing_strategy != "usage-based-routing-v2"
):
model_group_cache[model_id] = model_group_cache.get(model_id, 0)
current_request = max(