Skip to content

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]

fix: re-attach model_id after endpoint cleaning, bump log level

Sameer Kankutef784beb74f3d
diff --git a/litellm/proxy/health_check.py b/litellm/proxy/health_check.py
index 058f2f4ed9d..3e05ee3c484 100644
--- a/litellm/proxy/health_check.py
+++ b/litellm/proxy/health_check.py
@@ -210,20 +210,20 @@ async def _perform_health_check(
_model_id = (model.get("model_info") or {}).get("id")
if isinstance(is_healthy, dict) and "error" not in is_healthy:
- endpoint_data = {**litellm_params, **is_healthy}
+ cleaned = _clean_endpoint_data({**litellm_params, **is_healthy}, details)
if _model_id:
- endpoint_data["model_id"] = _model_id
- healthy_endpoints.append(_clean_endpoint_data(endpoint_data, details))
+ cleaned["model_id"] = _model_id
+ healthy_endpoints.append(cleaned)
elif isinstance(is_healthy, dict):
- endpoint_data = {**litellm_params, **is_healthy}
+ cleaned = _clean_endpoint_data({**litellm_params, **is_healthy}, details)
if _model_id:
- endpoint_data["model_id"] = _model_id
- unhealthy_endpoints.append(_clean_endpoint_data(endpoint_data, details))
+ cleaned["model_id"] = _model_id
+ unhealthy_endpoints.append(cleaned)
else:
- endpoint_data = {**litellm_params}
+ cleaned = _clean_endpoint_data(litellm_params, details)
if _model_id:
- endpoint_data["model_id"] = _model_id
- unhealthy_endpoints.append(_clean_endpoint_data(endpoint_data, details))
+ cleaned["model_id"] = _model_id
+ unhealthy_endpoints.append(cleaned)
return healthy_endpoints, unhealthy_endpoints
diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py
index 42740c24f45..b87fc9d127b 100644
--- a/litellm/proxy/proxy_server.py
+++ b/litellm/proxy/proxy_server.py
@@ -2138,7 +2138,7 @@ def _write_health_state_to_router_cache(
sum(1 for s in states.values() if not s.get("is_healthy")),
)
except Exception as e:
- verbose_proxy_logger.debug(
+ verbose_proxy_logger.warning(
"Failed to write health state to router cache: %s", str(e)
)