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
KnyazShe9835bedaf6c
diff --cc tests/test_litellm/passthrough/test_passthrough_main.pyindex bdfb3a348b3,dc2b7cc3682..adcca96271e--- a/tests/test_litellm/passthrough/test_passthrough_main.py+++ b/tests/test_litellm/passthrough/test_passthrough_main.py@@@ -641,38 -684,45 +685,40 @@@ async def test_allm_passthrough_route_4mock_logging_obj = MagicMock()mock_logging_obj.update_environment_variables = MagicMock()mock_logging_obj.async_flush_passthrough_collected_chunks = AsyncMock()+ mock_logging_obj.async_failure_handler = AsyncMock()- with patch(- "litellm.utils.ProviderConfigManager.get_provider_passthrough_config",- return_value=mock_provider_config,- ), patch(- "litellm.litellm_core_utils.get_litellm_params.get_litellm_params",- return_value={},- ), patch(- "litellm.litellm_core_utils.get_llm_provider_logic.get_llm_provider",- return_value=(- "gpt-4",- "azure",- "fake-azure-key",- "https://my-azure.openai.azure.com",+ with (+ patch(+ "litellm.utils.ProviderConfigManager.get_provider_passthrough_config",+ return_value=mock_provider_config,+ ),+ patch(+ "litellm.litellm_core_utils.get_litellm_params.get_litellm_params",+ return_value={},+ ),+ patch(+ "litellm.litellm_core_utils.get_llm_provider_logic.get_llm_provider",+ return_value=(+ "gpt-4",+ "azure",+ "fake-azure-key",+ "https://my-azure.openai.azure.com",+ ),),- ), patch.object(- async_client.client, "send", mock_send- ), patch.object(- async_client.client, "build_request", mock_build_request+ patch.object(async_client.client, "send", mock_send),+ patch.object(async_client.client, "build_request", mock_build_request),):- result = await allm_passthrough_route(- model="azure/gpt-4",- endpoint="openai/deployments/gpt-4/responses",- method="POST",- custom_llm_provider="azure",- api_base="https://my-azure.openai.azure.com",- api_key="fake-azure-key",- json={"model": "gpt-4", "input": "hello", "stream": True},- client=async_client,- litellm_logging_obj=mock_logging_obj,- )-- # result is an async generator — consuming it must raise, not silently yield error bytes- chunks = []with pytest.raises(httpx.HTTPStatusError) as exc_info:- async for chunk in result: # type: ignore[union-attr]- chunks.append(chunk)+ await allm_passthrough_route(+ model="azure/gpt-4",+ endpoint="openai/deployments/gpt-4/responses",+ method="POST",+ custom_llm_provider="azure",+ api_base="https://my-azure.openai.azure.com",+ api_key="fake-azure-key",+ json={"model": "gpt-4", "input": "hello", "stream": True},+ http_client=async_client,+ litellm_logging_obj=mock_logging_obj,+ )assert exc_info.value.response.status_code == 429- assert len(chunks) == 0, "No chunks should be yielded before the 429 raises"diff --cc tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.pyindex 637dc8e2f06,c9be00afed0..e313be688f5--- 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@@@ -23,7 -21,7 +23,8 @@@ from litellm.proxy.pass_through_endpoinbedrock_llm_proxy_route,create_pass_through_route,cursor_proxy_route,+ get_vertex_base_url,+ gigachat_proxy_route,llm_passthrough_factory_proxy_route,milvus_proxy_route,openai_proxy_route,