The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(router): cover the non-mapping litellm_params marker guard and drop redundant docstrings
mateo-berrib7136243c7e5
diff --git a/litellm/router.py b/litellm/router.pyindex 60e93a0526c..1eb2995f558 100644--- a/litellm/router.py+++ b/litellm/router.py@@ -10701,7 +10701,6 @@ class Router:@staticmethoddef _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 filtereddef _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.pyindex 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: