From 280ad6f049fd25db972080cc55cf54d7779c79a3 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Tue, 12 Aug 2025 17:17:19 -0700 Subject: [PATCH] fix(main.py): add sambanova api base support to embeddings --- litellm/main.py | 10 ++++++++-- litellm/model_prices_and_context_window_backup.json | 9 --------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/litellm/main.py b/litellm/main.py index 754b824e7dd..339d9e14406 100644 --- a/litellm/main.py +++ b/litellm/main.py @@ -1890,7 +1890,7 @@ def completion( # type: ignore # noqa: PLR0915 or get_secret_str("COMETAPI_KEY") or litellm.api_key ) - + api_base = ( api_base or litellm.api_base @@ -1917,7 +1917,7 @@ def completion( # type: ignore # noqa: PLR0915 stream=stream, provider_config=provider_config, ) - + ## LOGGING logging.post_call( input=messages, api_key=api_key, original_response=response @@ -4281,6 +4281,12 @@ def embedding( # noqa: PLR0915 ) elif custom_llm_provider == "sambanova": api_key = api_key or litellm.api_key or get_secret_str("SAMBANOVA_API_KEY") + api_base = ( + api_base + or litellm.api_base + or get_secret_str("SAMBANOVA_API_BASE") + or "https://api.sambanova.ai/v1" + ) response = base_llm_http_handler.embedding( model=model, input=input, diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index cf1e7590906..1001aca9c09 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -16902,15 +16902,6 @@ "supports_reasoning": true, "source": "https://cloud.sambanova.ai/plans/pricing" }, - "sambanova/E5-Mistral-7B-Instruct": { - "max_tokens": 4096, - "max_input_tokens": 4096, - "input_cost_per_token": 1.3e-07, - "output_cost_per_token": 0.0, - "litellm_provider": "sambanova-embedding-models", - "mode": "embedding", - "source": "https://cloud.sambanova.ai/plans/pricing" - }, "assemblyai/nano": { "mode": "audio_transcription", "input_cost_per_second": 0.00010278,