Merge pull request #4798 from BerriAI/litellm_fix_health_check

fix health check - make sure one failing deployment does not stop the health check
This commit is contained in:
Ishaan Jaff 2024-07-19 16:41:12 -07:00 • committed by GitHub
commit d3e7910c4d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4798,9 +4798,10 @@ async def ahealth_check(
if isinstance(stack_trace, str):
stack_trace = stack_trace[:1000]
if model not in litellm.model_cost and mode is None:
raise Exception(
"Missing `mode`. Set the `mode` for the model - https://docs.litellm.ai/docs/proxy/health#embedding-models"
)
return {
"error": "Missing `mode`. Set the `mode` for the model - https://docs.litellm.ai/docs/proxy/health#embedding-models"
}
error_to_return = str(e) + " stack trace: " + stack_trace
return {"error": error_to_return}