feat(main.py): support auto-infering mode if not set

This commit is contained in:
Krrish Dholakia 2024-01-25 20:07:31 -08:00
parent ac131b3824
commit 5996617f03

View file

@ -3170,6 +3170,9 @@ async def ahealth_check(
if model is None:
raise Exception("model not set")
if model in litellm.model_cost and mode is None:
mode = litellm.model_cost[model]["mode"]
model, custom_llm_provider, _, _ = get_llm_provider(model=model)
mode = mode or "chat" # default to chat completion calls