From fd13e24d57bbcb89ed7b30401c4a0cd524ce0bef Mon Sep 17 00:00:00 2001 From: Sameer Kankute Date: Mon, 23 Mar 2026 19:37:05 +0530 Subject: [PATCH] Fix greptile comments --- litellm/router.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/litellm/router.py b/litellm/router.py index e61e08ebc27..438f87eb297 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -7105,8 +7105,8 @@ class Router: - model: dict - the deployment to index - idx: int - the index in model_list """ - team_id = model.get("model_info", {}).get("team_id") - team_public_model_name = model.get("model_info", {}).get( + team_id = (model.get("model_info") or {}).get("team_id") + team_public_model_name = (model.get("model_info") or {}).get( "team_public_model_name" ) if team_id and team_public_model_name: @@ -7164,7 +7164,10 @@ class Router: ) if _deployment_on_router is not None: # deployment with this model_id exists on the router - if deployment.litellm_params == _deployment_on_router.litellm_params: + if ( + deployment.litellm_params == _deployment_on_router.litellm_params + and deployment.model_info == _deployment_on_router.model_info + ): # No need to update return None @@ -8190,7 +8193,8 @@ class Router: returned_models.append(alias_model) else: returned_models.append(model) - return returned_models + if returned_models: + return returned_models # O(1) lookup in model_name index if model_name in self.model_name_to_deployment_indices: