chore(router): drop unreachable unknown-model error branch

get_model_list always returns a list, never None, so the is-None branch
could not execute. Collapse to the single reachable message.
This commit is contained in:
user 2026-06-28 21:37:11 +00:00
parent 453aedef95
commit 9b4442c6df
No known key found for this signature in database

View file

@ -10031,10 +10031,7 @@ class Router:
# If still no deployments after checking for fallbacks, raise an error
if len(healthy_deployments) == 0:
if self.get_model_list(model_name=model) is None:
message = f"You passed in model={model}. There is no 'model_name' with this string"
else:
message = f"You passed in model={model}. There are no healthy deployments for this model"
message = f"You passed in model={model}. There are no healthy deployments for this model"
raise litellm.BadRequestError(
message=message,