fix: return failed status dict instead of raising Exception when wildcard model provider is unknown in ahealth_check_wildcard_models

This commit is contained in:
Haitao Pan 2026-06-16 17:46:49 +08:00
parent b02df7735a
commit 7eaa4aeb3e

View File

@ -31,9 +31,10 @@ class HealthCheckHelpers:
custom_llm_provider=custom_llm_provider, n=3
)
if len(cheapest_models) == 0:
raise Exception(
f"Unable to health check wildcard model for provider {custom_llm_provider}. Add a model on your config.yaml or contribute here - https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json"
)
return {
"status": "failed",
"reason": f"Unable to health check wildcard model for provider {custom_llm_provider}. Add a model on your config.yaml or contribute here - https://github.com/BerriAI/litellm/blob/main/model_prices_and_context_window.json"
}
if len(cheapest_models) > 1:
fallback_models = cheapest_models[
1: