build(litellm_server/main.py): fix keys in environment

This commit is contained in:
Krrish Dholakia 2023-10-26 16:54:06 -07:00
parent 89c94cf14f
commit ffa036566b
3 changed files with 8 additions and 7 deletions

View file

@ -1921,12 +1921,12 @@ def validate_environment(model: Optional[str]=None) -> dict:
if model is None:
return {"keys_in_environment": keys_in_environment, "missing_keys": missing_keys}
## EXTRACT LLM PROVIDER - if model name provided
custom_llm_provider = None
# check if llm provider part of model name
if model.split("/",1)[0] in litellm.provider_list:
custom_llm_provider = model.split("/", 1)[0]
model = model.split("/", 1)[1]
custom_llm_provider_passed_in = True
custom_llm_provider = get_llm_provider(model=model)
# # check if llm provider part of model name
# if model.split("/",1)[0] in litellm.provider_list:
# custom_llm_provider = model.split("/", 1)[0]
# model = model.split("/", 1)[1]
# custom_llm_provider_passed_in = True
if custom_llm_provider:
if custom_llm_provider == "openai":