diff --git a/litellm/proxy/health_check.py b/litellm/proxy/health_check.py index 3f67b8b477c..976e9eb2de8 100644 --- a/litellm/proxy/health_check.py +++ b/litellm/proxy/health_check.py @@ -128,9 +128,15 @@ def _is_health_check_model_metadata_key(key: str) -> bool: return key.startswith("supports_") or key in _HEALTH_CHECK_MODEL_METADATA_KEYS -def _strip_model_metadata_from_health_params(litellm_params: dict) -> dict: +def _strip_model_metadata_from_health_params( + litellm_params: Mapping[str, object], +) -> dict: # mutable-ok: ahealth_check kwargs and LiteLLM_Params(**probe) need a mutable dict """Drop model_info capability keys that leaked onto the health-check probe params.""" - return {k: v for k, v in litellm_params.items() if not _is_health_check_model_metadata_key(k)} + return { # mutable-ok: ahealth_check kwargs and LiteLLM_Params(**probe) need a mutable dict + k: v + for k, v in litellm_params.items() + if not _is_health_check_model_metadata_key(k) + } def _get_process_rss_mb() -> float | None: @@ -755,7 +761,7 @@ def _update_litellm_params_for_health_check(model_info: dict, litellm_params: di the provider request body (#38941) """ # Copy first: callers pass the live deployment litellm_params dict. - litellm_params = dict(litellm_params) + litellm_params = dict(litellm_params) # mutable-ok: copy so probe mutations don't rewrite the shared deployment dict # rebind-ok: local probe copy mode: Final = _resolve_health_check_mode( model_info, litellm_params, # any-ok: untyped router config dict