mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
Merge pull request #9369 from graysonchen/feature/add_openrouter_api_base
feat: Add support for custom OPENROUTER_API_BASE via get_secret in co…
This commit is contained in:
commit
cb4155fb16
1 changed files with 6 additions and 1 deletions
|
@ -2246,7 +2246,12 @@ def completion( # type: ignore # noqa: PLR0915
|
||||||
additional_args={"headers": headers},
|
additional_args={"headers": headers},
|
||||||
)
|
)
|
||||||
elif custom_llm_provider == "openrouter":
|
elif custom_llm_provider == "openrouter":
|
||||||
api_base = api_base or litellm.api_base or "https://openrouter.ai/api/v1"
|
api_base = (
|
||||||
|
api_base
|
||||||
|
or litellm.api_base
|
||||||
|
or get_secret("OPENROUTER_API_BASE")
|
||||||
|
or "https://openrouter.ai/api/v1"
|
||||||
|
)
|
||||||
|
|
||||||
api_key = (
|
api_key = (
|
||||||
api_key
|
api_key
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue