From 65849225f68241fe473b1dcbd2521556765ecc3c Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 20 Sep 2026 09:53:14 +0000 Subject: [PATCH] fix(types): type the catalog snapshot and echo filter parameters as Mapping[str, object] Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/litellm_core_utils/get_model_cost_map.py | 2 +- litellm/types/utils.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/litellm/litellm_core_utils/get_model_cost_map.py b/litellm/litellm_core_utils/get_model_cost_map.py index 9835e1ffe43..5471fe50d5f 100644 --- a/litellm/litellm_core_utils/get_model_cost_map.py +++ b/litellm/litellm_core_utils/get_model_cost_map.py @@ -99,7 +99,7 @@ class GetModelCostMap: return cls._loaded_catalog @classmethod - def _snapshot_loaded_catalog(cls, model_cost: dict) -> None: + def _snapshot_loaded_catalog(cls, model_cost: Mapping[str, object]) -> None: raw: Final = _CATALOG_ADAPTER.validate_python(model_cost) cls._loaded_catalog = MappingProxyType({key: MappingProxyType(entry) for key, entry in raw.items()}) diff --git a/litellm/types/utils.py b/litellm/types/utils.py index cd0b5961209..39ff4a305ea 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -3779,7 +3779,9 @@ def echoed_cost_map_pricing_fields(model_info: Mapping[str, Any]) -> tuple[str, return tuple(sorted(k for k in model_info if is_server_derived_pricing_key(k))) -def echoed_cost_map_fields(model_info: Mapping[str, Any], *cost_map_entries: Mapping[str, Any]) -> tuple[str, ...]: +def echoed_cost_map_fields( + model_info: Mapping[str, object], *cost_map_entries: Mapping[str, object] +) -> tuple[str, ...]: """Fields a ``/model/info`` echo copied from the cost map unchanged. Only ``litellm.get_model_info`` emits ``key``, so a blob carrying it is an echo of that