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: add isinstance guard for aliases field and remove unused helper
Chesars8b385120b986
diff --git a/litellm/litellm_core_utils/get_model_cost_map.py b/litellm/litellm_core_utils/get_model_cost_map.pyindex 81182f06dbf..b97cf32a67f 100644--- a/litellm/litellm_core_utils/get_model_cost_map.py+++ b/litellm/litellm_core_utils/get_model_cost_map.py@@ -201,6 +201,13 @@ def _expand_model_aliases(model_cost: dict) -> dict:if aliases is None:continuekeys_with_aliases.append(model_name)+ if not isinstance(aliases, list):+ verbose_logger.warning(+ "LiteLLM model alias field for '%s' is not a list (got %s) — skipping.",+ model_name,+ type(aliases).__name__,+ )+ continueif not aliases:continuefor alias in aliases:diff --git a/tests/test_litellm/test_model_cost_aliases.py b/tests/test_litellm/test_model_cost_aliases.pyindex ee01484922a..6e30cbfe157 100644--- a/tests/test_litellm/test_model_cost_aliases.py+++ b/tests/test_litellm/test_model_cost_aliases.py@@ -7,19 +7,9 @@ entries, creating shared dict references for alias entries at load time.import logging-from litellm.litellm_core_utils.get_model_cost_map import _expand_model_aliases-# ----------------------------------------------------------------------------# Helpers-# -----------------------------------------------------------------------------def _make_model_cost(**entries) -> dict:- """Build a small model_cost dict from keyword args (model_name → info)."""- return dict(entries)--# ---------------------------------------------------------------------------# Core expansion behaviour# ---------------------------------------------------------------------------