From 3b9ada07e024d991399a2f089a47f84a9ecbe617 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Mon, 5 Feb 2024 16:26:17 -0800 Subject: [PATCH] fix(main.py): raise better error message for health check models without mode --- litellm/main.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/litellm/main.py b/litellm/main.py index 66af60576eb..384dadc32d5 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -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)}