mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fix: add isinstance guard for aliases field and remove unused helper
This commit is contained in:
parent
7b3621518b
commit
8b385120b9
2 changed files with 7 additions and 10 deletions
|
|
@ -201,6 +201,13 @@ def _expand_model_aliases(model_cost: dict) -> dict:
|
|||
if aliases is None:
|
||||
continue
|
||||
keys_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__,
|
||||
)
|
||||
continue
|
||||
if not aliases:
|
||||
continue
|
||||
for alias in aliases:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue