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
KnyazSh9da1ccd12f8a
diff --cc litellm/litellm_core_utils/get_litellm_params.pyindex 16875816037,fc3c25e0d95..4f4c046ec59--- a/litellm/litellm_core_utils/get_litellm_params.py+++ b/litellm/litellm_core_utils/get_litellm_params.py@@@ -32,11 -32,10 +32,13 @@@ OPTIONAL_KWARGS_KEYS = frozenset"aws_sts_endpoint","aws_external_id","aws_bedrock_runtime_endpoint",+ "aws_bedrock_project_id",+ "gigachat_scope",+ "gigachat_auth_url",+ "gigachat_access_token","tpm","rpm",+ "use_xai_oauth",})diff --cc litellm/main.pyindex 5f5fe9ba359,18dcdfcd6be..792efe8243d--- a/litellm/main.py+++ b/litellm/main.py@@@ -1640,9 -1647,8 +1647,11 @@@ def completion( # type: ignore # noqalitellm_request_debug=kwargs.get("litellm_request_debug", False),tpm=kwargs.get("tpm"),rpm=kwargs.get("rpm"),+ use_xai_oauth=kwargs.get("use_xai_oauth", False),+ aws_bedrock_project_id=kwargs.get("aws_bedrock_project_id"),+ gigachat_scope=kwargs.get("gigachat_scope"),+ gigachat_auth_url=kwargs.get("gigachat_auth_url"),+ gigachat_access_token=kwargs.get("gigachat_access_token"),)cast(LiteLLMLoggingObj, logging).update_environment_variables(model=model,diff --cc litellm/proxy/common_request_processing.pyindex 6ffa17e4a04,d81668a7804..fdade64dce5--- a/litellm/proxy/common_request_processing.py+++ b/litellm/proxy/common_request_processing.py@@@ -1367,13 -1368,21 +1395,23 @@@ class ProxyBaseLLMRequestProcessing# since we're dealing with raw binary data (e.g., AWS event streams)return StreamingResponse(content=generator, # type: ignore[arg-type]- status_code=status.HTTP_200_OK,- headers=custom_headers,+ status_code=getattr(+ response, "status_code", status.HTTP_200_OK+ ),+ headers=streaming_headers,)else:- # Traditional HTTP response with aiter_bytes+ _early = (+ await self._handle_non_streaming_allm_passthrough_route(+ response=response,+ proxy_logging_obj=proxy_logging_obj,+ user_api_key_dict=user_api_key_dict,+ custom_headers=custom_headers,+ request_headers=dict(request.headers),+ )+ )+ if _early is not None:+ return _earlyreturn StreamingResponse(content=response.aiter_bytes(), # type: ignore[union-attr]status_code=response.status_code, # type: ignore[union-attr]diff --cc tests/test_litellm/proxy/pass_through_endpoints/test_llm_pass_through_endpoints.pyindex e313be688f5,8bb7b52af14..9935c3e59dd--- 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@@@ -24,9 -22,9 +24,10 @@@ from litellm.proxy.pass_through_endpoincreate_pass_through_route,cursor_proxy_route,get_vertex_base_url,+ gigachat_proxy_route,llm_passthrough_factory_proxy_route,milvus_proxy_route,+ mistral_proxy_route,openai_proxy_route,vertex_discovery_proxy_route,vertex_proxy_route,