mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix(main.py): fix lm_studio/ embedding routing (#7658)
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 36s
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 36s
* fix(main.py): fix lm_studio/ embedding routing adds the mapping + updates docs with example * docs(self_serve.md): update doc to show how to auto-add sso users to teams * fix(streaming_handler.py): simplify async iterator check, to just check if streaming response is an async iterable
This commit is contained in:
parent
efe236d05b
commit
865e6d5bda
6 changed files with 109 additions and 38 deletions
|
@ -3218,6 +3218,7 @@ def embedding( # noqa: PLR0915
|
|||
api_base=api_base,
|
||||
api_key=api_key,
|
||||
)
|
||||
|
||||
if dynamic_api_key is not None:
|
||||
api_key = dynamic_api_key
|
||||
|
||||
|
@ -3395,18 +3396,19 @@ def embedding( # noqa: PLR0915
|
|||
custom_llm_provider == "openai_like"
|
||||
or custom_llm_provider == "jina_ai"
|
||||
or custom_llm_provider == "hosted_vllm"
|
||||
or custom_llm_provider == "lm_studio"
|
||||
):
|
||||
api_base = (
|
||||
api_base or litellm.api_base or get_secret_str("OPENAI_LIKE_API_BASE")
|
||||
)
|
||||
|
||||
# set API KEY
|
||||
api_key = (
|
||||
api_key
|
||||
or litellm.api_key
|
||||
or litellm.openai_like_key
|
||||
or get_secret_str("OPENAI_LIKE_API_KEY")
|
||||
)
|
||||
if api_key is None:
|
||||
api_key = (
|
||||
litellm.api_key
|
||||
or litellm.openai_like_key
|
||||
or get_secret_str("OPENAI_LIKE_API_KEY")
|
||||
)
|
||||
|
||||
## EMBEDDING CALL
|
||||
response = openai_like_embedding.embedding(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue