(fix) deepinfra with openai v1.0.0

This commit is contained in:
ishaan-jaff 2023-11-13 09:51:22 -08:00
parent cf0ab7155e
commit 27cbd7d895
2 changed files with 5 additions and 55 deletions

View file

@ -1992,6 +1992,11 @@ def get_llm_provider(model: str, custom_llm_provider: Optional[str] = None, api_
api_base = "https://api.endpoints.anyscale.com/v1"
dynamic_api_key = os.getenv("ANYSCALE_API_KEY")
custom_llm_provider = "custom_openai"
elif custom_llm_provider == "deepinfra":
# deepinfra is openai compatible, we just need to set this to custom_openai and have the api_base be https://api.endpoints.anyscale.com/v1
api_base = "https://api.deepinfra.com/v1/openai"
dynamic_api_key = os.getenv("DEEPINFRA_API_KEY")
custom_llm_provider = "custom_openai"
return model, custom_llm_provider, dynamic_api_key, api_base
# check if api base is a known openai compatible endpoint