diff --git a/litellm/proxy/management_endpoints/model_management_endpoints.py b/litellm/proxy/management_endpoints/model_management_endpoints.py index 8155119cf7b..2234e825090 100644 --- a/litellm/proxy/management_endpoints/model_management_endpoints.py +++ b/litellm/proxy/management_endpoints/model_management_endpoints.py @@ -2094,10 +2094,8 @@ async def add_new_model( enforced=bool(general_settings.get(ENFORCE_RPM_TPM_ON_MODEL_ADD_SETTING, False)), ) - model_params.model_info = ( - ModelInfo.model_validate( # rebind-ok: downstream team-model handling mutates this same object - dict(without_server_derived_pricing(model_params.model_info.model_dump(exclude_none=True))) - ) + model_params.model_info = ModelInfo( # rebind-ok: downstream team-model handling mutates this same object + **without_server_derived_pricing(model_params.model_info.model_dump(exclude_none=True)) ) model_response: prisma_models.LiteLLM_ProxyModelTable | LiteLLM_ProxyModelTable | None = None diff --git a/litellm/types/utils.py b/litellm/types/utils.py index 84231423562..00c55b35182 100644 --- a/litellm/types/utils.py +++ b/litellm/types/utils.py @@ -3667,7 +3667,7 @@ def is_server_derived_pricing_key(key: str) -> bool: return key in SERVER_DERIVED_PRICING_FIELDS or ABOVE_THRESHOLD_COST_KEY_PATTERN.search(key) is not None -def without_server_derived_pricing(model_info: Mapping[str, object]) -> Mapping[str, object]: +def without_server_derived_pricing(model_info: Mapping[str, Any]) -> Mapping[str, Any]: """Drop the pricing ``/model/info`` derives for display, keeping everything else. ``/model/info`` fills a deployment's missing pricing in from the cost map so the