fix(main.py): raise better error message for health check models without mode

This commit is contained in:
Krrish Dholakia 2024-02-05 16:26:17 -08:00
parent 1f7c8e86a7
commit 3b9ada07e0

View file

@ -3320,6 +3320,10 @@ async def ahealth_check(
response = {} # args like remaining ratelimit etc.
return response
except Exception as e:
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": str(e)}