Merge pull request #222 from ErikBjare/dev/openai_api_base

feat: added support for OPENAI_API_BASE
This commit is contained in:
Ishaan Jaff 2023-08-28 08:44:03 -07:00 committed by GitHub
commit b37f975296
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -19,4 +19,4 @@ REPLICATE_API_TOKEN = ""
# Anthropic
ANTHROPIC_API_KEY = ""
# Infisical
INFISICAL_TOKEN = ""
INFISICAL_TOKEN = ""

View file

@ -214,6 +214,7 @@ def completion(
): # allow user to make an openai call with a custom base
openai.api_type = "openai"
# note: if a user sets a custom base - we should ensure this works
# allow for the setting of dynamic and stateful api-bases
api_base = (
custom_api_base or litellm.api_base or get_secret("OPENAI_API_BASE") or "https://api.openai.com/v1"
)