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]

Merge branch 'litellm_internal_staging' into litellm_decrease_anys_opus5_r2

mateo-berric236bcf241ce
diff --cc basedpyright-code-budget.json
index d572a328926,f8ef0ce1732..d693c251df8
--- a/basedpyright-code-budget.json
+++ b/basedpyright-code-budget.json
@@@ -1,9 -1,9 +1,9 @@@
{
"reportAny": {
- "limit": 15294
- "limit": 16389
++ "limit": 15626
},
"reportArgumentType": {
- "limit": 2520
- "limit": 2229
++ "limit": 2220
},
"reportAssignmentType": {
"limit": 319
@@@ -24,7 -24,7 +24,7 @@@
"limit": 19
},
"reportExplicitAny": {
- "limit": 4639
- "limit": 5242
++ "limit": 4879
},
"reportFunctionMemberAccess": {
"limit": 7
@@@ -42,7 -42,7 +42,7 @@@
"limit": 12
},
"reportIndexIssue": {
- "limit": 25
- "limit": 35
++ "limit": 30
},
"reportInvalidTypeForm": {
"limit": 34
@@@ -54,10 -54,10 +54,10 @@@
"limit": 0
},
"reportMissingParameterType": {
- "limit": 5626
- "limit": 5614
++ "limit": 5610
},
"reportMissingTypeArgument": {
- "limit": 15383
- "limit": 15356
++ "limit": 15338
},
"reportMissingTypeStubs": {
"limit": 40
@@@ -105,16 -105,16 +105,16 @@@
"limit": 109
},
"reportUnknownMemberType": {
- "limit": 38521
- "limit": 38500
++ "limit": 38449
},
"reportUnknownParameterType": {
- "limit": 19718
- "limit": 19673
++ "limit": 19657
},
"reportUnknownVariableType": {
- "limit": 30129
- "limit": 30092
++ "limit": 30012
},
"reportUnnecessaryCast": {
- "limit": 117
+ "limit": 111
},
"reportUnnecessaryComparison": {
"limit": 695
diff --cc litellm/llms/litellm_proxy/skills/code_execution.py
index 0b156379d0d,f51213ca1c3..fbc287589b3
--- a/litellm/llms/litellm_proxy/skills/code_execution.py
+++ b/litellm/llms/litellm_proxy/skills/code_execution.py
@@@ -302,6 -248,8 +302,8 @@@ class CodeExecutionHandler
verbose_logger.debug("CodeExecutionHandler: Execution result: %s", exec_result)
- sandbox_files: Sequence[_SandboxFile] = exec_result["files"]
++ sandbox_files: Sequence[_SandboxGeneratedFile] = exec_result["files"]
+
execution_results.append(
{
"iteration": iteration,
diff --cc litellm/proxy/response_polling/background_streaming.py
index d32d6ab8861,3c5d889d23f..7f00a24a541
--- a/litellm/proxy/response_polling/background_streaming.py
+++ b/litellm/proxy/response_polling/background_streaming.py
@@@ -10,8 -10,8 +10,8 @@@ https://platform.openai.com/docs/api-re
import asyncio
import json
- from collections.abc import Callable, Sequence
- from typing import TYPE_CHECKING, Final, TypedDict, cast
-from collections.abc import Mapping, Sequence
++from collections.abc import Callable, Mapping, Sequence
+ from typing import TYPE_CHECKING, Final, TypedDict
from fastapi import Request, Response
from fastapi.responses import StreamingResponse
@@@ -38,25 -38,21 +38,25 @@@ class _StreamOutputItem(TypedDict, tota
content: ReadOnly[Sequence[_StreamContentPart | None]]
-class _StreamTerminalResponse(TypedDict, total=False):
- """Fields of the ``response`` payload carried by a terminal streaming event."""
-
+class _StreamResponsePayload(TypedDict, total=False):
- status: ReadOnly[str]
+ status: ReadOnly[ResponsesAPIStatus]
+ error: ReadOnly[dict[str, object] | None]
+ usage: ReadOnly[dict[str, object] | None]
+ reasoning: ReadOnly[dict[str, object] | None]
tool_choice: ReadOnly[object]
- model: ReadOnly[str]
- instructions: ReadOnly[str]
- temperature: ReadOnly[float]
- top_p: ReadOnly[float]
- max_output_tokens: ReadOnly[int]
- previous_response_id: ReadOnly[str]
- truncation: ReadOnly[str]
- parallel_tool_calls: ReadOnly[bool]
- user: ReadOnly[str]
- store: ReadOnly[bool]
+ tools: ReadOnly[list[object] | None]
+ model: ReadOnly[str | None]
+ instructions: ReadOnly[str | None]
+ temperature: ReadOnly[float | None]
+ top_p: ReadOnly[float | None]
+ max_output_tokens: ReadOnly[int | None]
+ previous_response_id: ReadOnly[str | None]
+ text: ReadOnly[dict[str, object] | None]
+ truncation: ReadOnly[str | None]
+ parallel_tool_calls: ReadOnly[bool | None]
+ user: ReadOnly[str | None]
+ store: ReadOnly[bool | None]
+ incomplete_details: ReadOnly[dict[str, object] | None]
output: ReadOnly[Sequence[_StreamOutputItem]]
diff --cc ruff-strict-budget.json
index f479764f269,fce91d57d88..be3f13ea7ef
--- a/ruff-strict-budget.json
+++ b/ruff-strict-budget.json
@@@ -1,6 -1,6 +1,6 @@@
{
"ANN001": {
- "limit": 2988
- "limit": 2998
++ "limit": 2994
},
"ANN002": {
"limit": 71
@@@ -12,10 -12,10 +12,10 @@@
"limit": 2003
},
"ANN202": {
- "limit": 839
- "limit": 845
++ "limit": 843
},
"ANN204": {
- "limit": 698
+ "limit": 696
},
"ANN205": {
"limit": 112
@@@ -24,7 -24,7 +24,7 @@@
"limit": 133
},
"ANN401": {
- "limit": 240
- "limit": 597
++ "limit": 492
},
"ASYNC230": {
"limit": 11
@@@ -168,7 -168,7 +168,7 @@@
"limit": 3
},
"RET504": {
- "limit": 172
- "limit": 175
++ "limit": 174
},
"RUF012": {
"limit": 239
@@@ -195,10 -195,10 +195,10 @@@
"limit": 22
},
"SIM101": {
- "limit": 58
+ "limit": 56
},
"SIM102": {
- "limit": 309
- "limit": 315
++ "limit": 313
},
"SIM103": {
"limit": 119
@@@ -231,7 -231,7 +231,7 @@@
"limit": 5
},
"TID251": {
- "limit": 1080
- "limit": 1111
++ "limit": 1099
},
"TRY002": {
"limit": 524
diff --cc type-discipline-budget.json
index 2518ff223ac,bb02618b11e..399d0f6abad
--- a/type-discipline-budget.json
+++ b/type-discipline-budget.json
@@@ -1,9 -1,9 +1,9 @@@
{
"LIT001": {
- "limit": 22554
- "limit": 22642
++ "limit": 22590
},
"LIT002": {
- "limit": 26782
- "limit": 26834
++ "limit": 26812
},
"LIT003": {
"limit": 269
@@@ -27,12 -27,12 +27,12 @@@
"limit": 0
},
"LIT010": {
- "limit": 16510
- "limit": 16550
++ "limit": 16532
},
"LIT011": {
- "limit": 5520
- "limit": 5576
++ "limit": 5557
},
"LIT012": {
- "limit": 4506
+ "limit": 4496
}
}