Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix gigachat passthrough url, authenticator, get_api_base

KnyazShc4e5dbc38bfe
diff --git a/litellm/llms/gigachat/authenticator.py b/litellm/llms/gigachat/authenticator.py
index 83824c72fa7..1821a209fed 100644
--- a/litellm/llms/gigachat/authenticator.py
+++ b/litellm/llms/gigachat/authenticator.py
@@ -130,12 +130,6 @@ async def get_access_token_async(
litellm_params: Optional[dict] = None,
) -> str:
"""Async version of get_access_token."""
- credentials = credentials or _get_credentials()
- if not credentials:
- raise GigaChatAuthError(
- status_code=401,
- message="GigaChat credentials not provided. Set GIGACHAT_CREDENTIALS or GIGACHAT_API_KEY environment variable.",
- )
if not litellm_params:
litellm_params = {}
diff --git a/litellm/llms/gigachat/passthrough/transformation.py b/litellm/llms/gigachat/passthrough/transformation.py
index 42bad43c79f..baf287b161f 100644
--- a/litellm/llms/gigachat/passthrough/transformation.py
+++ b/litellm/llms/gigachat/passthrough/transformation.py
@@ -36,12 +36,8 @@ class GigaChatPassthroughConfig(BasePassthroughConfig):
if base_target_url is None:
raise Exception("GigaChat api base not found")
- litellm_metadata = litellm_params.get("litellm_metadata") or {}
- model_group = litellm_metadata.get("model_group")
- if model_group and model_group in endpoint:
- endpoint = endpoint.replace(model_group, model)
+ complete_url = f"{base_target_url}/{endpoint.lstrip('/')}"
- complete_url = f"{base_target_url}/chat/completions"
return (
httpx.URL(complete_url),
base_target_url,
diff --git a/litellm/llms/gigachat/utils.py b/litellm/llms/gigachat/utils.py
index e79083f16fe..b66d25cbc0b 100644
--- a/litellm/llms/gigachat/utils.py
+++ b/litellm/llms/gigachat/utils.py
@@ -30,6 +30,5 @@ def convert_usage(usage_data: dict[str, int]) -> Usage:
)
-@staticmethod
def get_api_base(api_base: Optional[str] = None) -> Optional[str]:
return api_base or get_secret_str("GIGACHAT_API_BASE") or GIGACHAT_BASE_URL