Skip to content

Commit

Permalink
Merge pull request BerriAI#3419 from BerriAI/litellm_fix_lowest_laten…
Browse files Browse the repository at this point in the history
…cy_router

[Fix] Ensure callbacks are not added to router when `store_model_in_db=True`
  • Loading branch information
ishaan-jaff authored May 3, 2024
2 parents 91971fa + 540a35e commit c6a9b46
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion litellm/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -2669,13 +2669,18 @@ def update_settings(self, **kwargs):
"cooldown_time",
]

_existing_router_settings = self.get_settings()
for var in kwargs:
if var in _allowed_settings:
if var in _int_settings:
_casted_value = int(kwargs[var])
setattr(self, var, _casted_value)
else:
if var == "routing_strategy":
# only run routing strategy init if it has changed
if (
var == "routing_strategy"
and _existing_router_settings["routing_strategy"] != kwargs[var]
):
self.routing_strategy_init(
routing_strategy=kwargs[var],
routing_strategy_args=kwargs.get(
Expand Down

0 comments on commit c6a9b46

Please sign in to comment.