test(router): cover the non-mapping litellm_params marker guard and drop redundant docstrings

This commit is contained in:
mateo-berri 2026-08-12 00:17:52 -07:00
parent bcba392b21
commit b7136243c7
2 changed files with 3 additions and 2 deletions

View file

@ -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)

View file

@ -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: