fix(parallel_request_limiter.py): handle metadata being none

This commit is contained in:
Krrish Dholakia 2024-03-14 10:02:26 -07:00
parent 704573c3f6
commit 7876aa2d75
4 changed files with 11 additions and 6 deletions

View file

@ -3682,11 +3682,12 @@ async def ahealth_check(
response = {} # args like remaining ratelimit etc.
return response
except Exception as e:
traceback.print_exc()
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)}
return {"error": f"{str(e)}"}
####### HELPER FUNCTIONS ################