From 6288cac28890e5ae657101c42ce26e44f8c4b5b4 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 ac965a0af5b..19a0f250dc1 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -7183,8 +7183,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: @@ -7242,7 +7242,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 @@ -8268,7 +8271,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: