forked from phoenix/litellm-mirror
Merge pull request #222 from ErikBjare/dev/openai_api_base
feat: added support for OPENAI_API_BASE
This commit is contained in:
commit
b37f975296
2 changed files with 2 additions and 1 deletions
|
@ -19,4 +19,4 @@ REPLICATE_API_TOKEN = ""
|
||||||
# Anthropic
|
# Anthropic
|
||||||
ANTHROPIC_API_KEY = ""
|
ANTHROPIC_API_KEY = ""
|
||||||
# Infisical
|
# Infisical
|
||||||
INFISICAL_TOKEN = ""
|
INFISICAL_TOKEN = ""
|
||||||
|
|
|
@ -214,6 +214,7 @@ def completion(
|
||||||
): # allow user to make an openai call with a custom base
|
): # allow user to make an openai call with a custom base
|
||||||
openai.api_type = "openai"
|
openai.api_type = "openai"
|
||||||
# note: if a user sets a custom base - we should ensure this works
|
# 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 = (
|
api_base = (
|
||||||
custom_api_base or litellm.api_base or get_secret("OPENAI_API_BASE") or "https://api.openai.com/v1"
|
custom_api_base or litellm.api_base or get_secret("OPENAI_API_BASE") or "https://api.openai.com/v1"
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue