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
fix: address Greptile review feedback
Chesars6469de951609
diff --git a/litellm/litellm_core_utils/get_model_cost_map.py b/litellm/litellm_core_utils/get_model_cost_map.pyindex 0aabedae603..406702503ef 100644--- a/litellm/litellm_core_utils/get_model_cost_map.py+++ b/litellm/litellm_core_utils/get_model_cost_map.py@@ -199,9 +199,11 @@ def _expand_model_aliases(model_cost: dict) -> dict:for model_name, model_info in model_cost.items():aliases: Optional[list] = model_info.get("aliases")- if not aliases:+ if aliases is None:continuekeys_with_aliases.append(model_name)+ if not aliases:+ continuefor alias in aliases:if alias in model_cost:verbose_logger.warning(diff --git a/tests/test_litellm/test_model_cost_aliases.py b/tests/test_litellm/test_model_cost_aliases.pyindex 29a37ed54d7..c6702ab13e4 100644--- a/tests/test_litellm/test_model_cost_aliases.py+++ b/tests/test_litellm/test_model_cost_aliases.py@@ -148,7 +148,7 @@ class TestAliasConflicts:# The canonical "model-dated" entry is preserved, not overwrittenassert "model-dated" in result- assert "alias conflict" in caplog.text.lower() or len(result) == 2+ assert "alias conflict" in caplog.text.lower()def test_duplicate_alias_across_entries(self, caplog):"""Same alias claimed by two different entries: second one is skipped."""