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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
Merge branch 'litellm_internal_staging' into feature/improve-gigachat-provider
KnyazSh736411bd6792
diff --cc litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.pyindex 3dab313bd5c,9a3bc82c6fa..a3fe2911038--- a/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py+++ b/litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py@@@ -6,8 -6,7 +6,9 @@@ Provider-specific Pass-Through EndpointUse litellm with Anthropic SDK, Vertex AI SDK, Cohere SDK, etc."""+from __future__ import annotations++ import hmacimport jsonimport osimport re@@@ -28,11 -27,15 +29,16 @@@ from litellm.constants importBEDROCK_AGENT_RUNTIME_PASS_THROUGH_ROUTES,)from litellm.llms.anthropic.common_utils import AnthropicModelInfo+from litellm.llms.custom_httpx.http_handler import get_async_httpx_clientfrom litellm.llms.vertex_ai.vertex_llm_base import VertexBasefrom litellm.proxy._types import *+ from litellm.proxy.auth.handle_jwt import JWTHandlerfrom litellm.proxy.auth.route_checks import RouteChecks- from litellm.proxy.auth.user_api_key_auth import user_api_key_auth, user_api_key_auth_websocket+ from litellm.proxy.auth.user_api_key_auth import (+ _get_bearer_token,+ user_api_key_auth,+ user_api_key_auth_websocket,+ )from litellm.proxy.common_utils.http_parsing_utils import (_read_request_body,_safe_get_request_headers,@@@ -1760,14 -1888,16 +1902,16 @@@ async def _prepare_vertex_auth_headersvertex_location: Vertex locationbase_target_url: Base URL for the Vertex AI serviceget_vertex_pass_through_handler: Handler for the specific Vertex AI service+ user_api_key_dict: The caller's resolved authentication, so only the secret that+ authenticated them is stripped on the credential-less branchReturns:- Tuple containing:+ tuple containing:- headers: dict - Authentication headers to use- - base_target_url: Optional[str] - Updated base target URL+ - base_target_url: str | None - Updated base target URL- headers_passed_through: bool - Whether headers were passed through from request- - vertex_project: Optional[str] - Updated vertex project ID- - vertex_location: Optional[str] - Updated vertex location+ - vertex_project: str | None - Updated vertex project ID+ - vertex_location: str | None - Updated vertex location"""vertex_llm_base: Final = VertexBase()headers_passed_through = Falsediff --cc tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.pyindex 9b2b4238c5b,3b506324ad7..b138ddc6711--- a/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py+++ b/tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.py@@@ -11,12 -12,12 +12,14 @@@ from unittest.mock import AsyncMock, Maimport httpximport pytestfrom fastapi import HTTPException, Request, Response+from fastapi.responses import StreamingResponsefrom fastapi.testclient import TestClient+ from starlette.datastructures import FormDataimport litellm+from litellm.proxy.common_request_processing import ProxyBaseLLMRequestProcessing+ from litellm.constants import LITELLM_PROXY_MASTER_KEY_ALIASfrom litellm.proxy.pass_through_endpoints.llm_passthrough_endpoints import (BaseOpenAIPassThroughHandler,RouteChecks,