From 9b4442c6df65ad048097a1c0a87d23978deb2c73 Mon Sep 17 00:00:00 2001 From: user <70670632+stuxf@users.noreply.github.com> Date: Sun, 28 Jun 2026 21:37:11 +0000 Subject: [PATCH] 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. --- litellm/router.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/litellm/router.py b/litellm/router.py index 8abdd60ccad..2d66bc3158d 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -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,