fix(proxy_cli-and-utils.py): fixing how config file is read + infering llm_provider for known openai endpoints

This commit is contained in:
Krrish Dholakia 2023-10-10 20:53:02 -07:00
parent d99d6a99f1
commit d280a8c434
9 changed files with 170 additions and 29 deletions

View file

@ -253,7 +253,7 @@ def completion(
if deployment_id != None: # azure llms
model=deployment_id
custom_llm_provider="azure"
model, custom_llm_provider = get_llm_provider(model=model, custom_llm_provider=custom_llm_provider)
model, custom_llm_provider = get_llm_provider(model=model, custom_llm_provider=custom_llm_provider, api_base=api_base)
model_api_key = get_api_key(llm_provider=custom_llm_provider, dynamic_api_key=api_key) # get the api key from the environment if required for the model
if model_api_key and "sk-litellm" in model_api_key:
api_base = "https://proxy.litellm.ai"