fix(nebius): document provider default rebinding

This commit is contained in:
Dylan 2026-08-13 17:40:17 +02:00
parent 9b6b765ae2
commit f54a0581ba
2 changed files with 5 additions and 3 deletions

View file

@ -291,7 +291,7 @@ def get_llm_provider(
custom_llm_provider = "nscale"
dynamic_api_key = litellm.NscaleConfig.get_api_key()
elif endpoint == litellm.NebiusConfig.API_BASE_URL.removeprefix("https://"):
custom_llm_provider = "nebius"
custom_llm_provider = "nebius" # rebind-ok: resolve the provider from its canonical endpoint
dynamic_api_key = api_key or get_secret_str("NEBIUS_API_KEY")
elif endpoint == "dashscope-intl.aliyuncs.com/compatible-mode/v1":
custom_llm_provider = "dashscope"
@ -608,7 +608,9 @@ def _get_openai_compatible_provider_info(
api_base = api_base or get_secret("LLAMA_API_BASE") or "https://api.llama.com/compat/v1"
dynamic_api_key = api_key or get_secret_str("LLAMA_API_KEY")
elif custom_llm_provider == "nebius":
api_base = api_base or get_secret("NEBIUS_API_BASE") or litellm.NebiusConfig.API_BASE_URL
api_base = ( # rebind-ok: fill the provider default when the caller did not pass an endpoint
api_base or get_secret("NEBIUS_API_BASE") or litellm.NebiusConfig.API_BASE_URL
)
dynamic_api_key = api_key or get_secret_str("NEBIUS_API_KEY")
elif custom_llm_provider == "ollama":
api_base = api_base or get_secret("OLLAMA_API_BASE") or "http://localhost:11434"

View file

@ -6202,7 +6202,7 @@ def embedding(
or custom_llm_provider == "litellm_proxy"
or (model in litellm.open_ai_embedding_models and custom_llm_provider is None)
):
api_base = (
api_base = ( # rebind-ok: fill the provider default for the embedding request
api_base
or litellm.api_base
or get_secret_str("OPENAI_BASE_URL")