From b7136243c7e53eed208f6b455ceb2211b2e32b80 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Wed, 12 Aug 2026 00:17:52 -0700 Subject: [PATCH] test(router): cover the non-mapping litellm_params marker guard and drop redundant docstrings --- litellm/router.py | 2 -- tests/test_litellm/test_router.py | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/litellm/router.py b/litellm/router.py index 60e93a0526c..1eb2995f558 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -10701,7 +10701,6 @@ class Router: @staticmethod def _is_strategy_marker_deployment(deployment: Mapping[str, object]) -> bool: - """True when the deployment is a strategy-router pseudo-model (`auto_router/` prefixed).""" litellm_params: Final = deployment.get("litellm_params") if not isinstance(litellm_params, Mapping): return False @@ -11354,7 +11353,6 @@ class Router: return filtered def _model_name_has_plain_deployments(self, model: str) -> bool: - """True when `model` also names regular (non strategy-router) deployments in the model_list.""" indices: Final = self.model_name_to_deployment_indices.get(model) or () return any(not self._is_strategy_marker_deployment(self.model_list[idx]) for idx in indices) diff --git a/tests/test_litellm/test_router.py b/tests/test_litellm/test_router.py index 640bd229b49..70c13600014 100644 --- a/tests/test_litellm/test_router.py +++ b/tests/test_litellm/test_router.py @@ -7608,6 +7608,9 @@ class TestTaggedAutoRouterOnSharedModelName: ) assert deployment["litellm_params"]["model"] == "openai/gpt-4o" + def test_deployment_without_litellm_params_mapping_is_not_a_marker(self): + assert litellm.Router._is_strategy_marker_deployment({"model_name": "gpt4o"}) is False + class TestGetAllowedFailsFromPolicy: def _make_router(self, **policy_kwargs) -> litellm.Router: