Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
dcf1b44
Merge pull request #30907 from BerriAI/litellm_internal_staging
yuneng-berri Jun 21, 2026
7bdaab2
chore: sync upstream 2026-06-23
claude Jun 23, 2026
1684e57
fix(cost_calculation): restore Tuple import dropped by auto-merge
claude Jun 23, 2026
df376d1
fix(deps): update ws to 8.21.0 (GHSA-96hv-2xvq-fx4p) and pypdf to 6.1…
claude Jun 23, 2026
79dfd70
fix(deps): fix osv-scan failures and uv lock check
claude Jun 23, 2026
ce90499
fix(proxy): remove orphaned plugin_router include left by auto-merge
claude Jun 23, 2026
4d3f38d
fix(deps): regenerate uv.lock with all CVE fixes
claude Jun 23, 2026
1ae7c72
fix(deps): regenerate uv.lock with uv 0.10.9 (matches CI)
claude Jun 23, 2026
397133d
fix: restore missing _map_*_exception helpers and fix import issues
claude Jun 23, 2026
91cc3f8
fix: modernize Optional annotations in exception_mapping_utils and ra…
claude Jun 23, 2026
e9aec7d
fix(ui): remove oxc config block unsupported in vitest 3.2.6
claude Jun 23, 2026
289f461
fix(proxy): restore plugin_router and fix gen:api deep route traversal
claude Jun 23, 2026
e32fba8
chore(ui): update tsconfig.tsbuildinfo after vitest config fix
claude Jun 23, 2026
2316694
fix(streaming): restore _dispatch_provider_chunk lost in -X theirs merge
claude Jun 23, 2026
4394e33
chore: ratchet lint budgets after restoring _dispatch_provider_chunk
claude Jun 23, 2026
76d4d66
fix(ui): regenerate schema.d.ts with enterprise routes via full uv en…
claude Jun 23, 2026
c21cc04
style: apply black formatting to streaming_handler.py
claude Jun 23, 2026
4d04cbc
fix(proxy): import register_plugins_from_config from plugin_routes
claude Jun 23, 2026
f37a873
style: apply black formatting to proxy_server.py
claude Jun 23, 2026
63553e9
fix(docker): add libatomic to Dockerfile.database runtime apk install
claude Jun 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions basedpyright-code-budget.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"reportAny": {
"baseline": 25453,
"baseline": 25467,
"slack": 2500
},
"reportArgumentType": {
"baseline": 1961,
"baseline": 1960,
"slack": 180
},
"reportAssignmentType": {
"baseline": 221,
"slack": 3
},
"reportAttributeAccessIssue": {
"baseline": 339,
"baseline": 330,
"slack": 3
},
"reportCallIssue": {
Expand All @@ -32,15 +32,15 @@
"slack": 3
},
"reportExplicitAny": {
"baseline": 7022,
"baseline": 7034,
"slack": 700
},
"reportFunctionMemberAccess": {
"baseline": 8,
"slack": 3
},
"reportGeneralTypeIssues": {
"baseline": 155,
"baseline": 153,
"slack": 3
},
"reportIncompatibleMethodOverride": {
Expand All @@ -60,7 +60,7 @@
"slack": 3
},
"reportInvalidTypeForm": {
"baseline": 22,
"baseline": 23,
"slack": 3
},
"reportInvalidTypeVarUse": {
Expand All @@ -80,7 +80,7 @@
"slack": 1000
},
"reportMissingTypeStubs": {
"baseline": 30,
"baseline": 20,
"slack": 10
},
"reportOperatorIssue": {
Expand Down Expand Up @@ -112,7 +112,7 @@
"slack": 10
},
"reportPrivateUsage": {
"baseline": 1648,
"baseline": 1652,
"slack": 160
},
"reportRedeclaration": {
Expand All @@ -128,43 +128,43 @@
"slack": 3
},
"reportUndefinedVariable": {
"baseline": 2,
"baseline": 5,
"slack": 3
},
"reportUnknownArgumentType": {
"baseline": 31622,
"baseline": 31662,
"slack": 3000
},
"reportUnknownLambdaType": {
"baseline": 75,
"slack": 10
},
"reportUnknownMemberType": {
"baseline": 27135,
"baseline": 27400,
"slack": 2500
},
"reportUnknownParameterType": {
"baseline": 13686,
"baseline": 13704,
"slack": 1000
},
"reportUnknownVariableType": {
"baseline": 21499,
"baseline": 21694,
"slack": 2000
},
"reportUnnecessaryCast": {
"baseline": 124,
"baseline": 119,
"slack": 10
},
"reportUnnecessaryComparison": {
"baseline": 683,
"baseline": 688,
"slack": 10
},
"reportUnnecessaryContains": {
"baseline": 4,
"slack": 3
},
"reportUnnecessaryIsInstance": {
"baseline": 816,
"baseline": 819,
"slack": 10
},
"reportUntypedBaseClass": {
Expand All @@ -180,15 +180,15 @@
"slack": 3
},
"reportUnusedFunction": {
"baseline": 138,
"baseline": 135,
"slack": 10
},
"reportUnusedImport": {
"baseline": 670,
"baseline": 648,
"slack": 10
},
"reportUnusedVariable": {
"baseline": 866,
"baseline": 573,
"slack": 10
}
}
12 changes: 6 additions & 6 deletions litellm/litellm_core_utils/exception_mapping_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json
import re
import traceback
from typing import Any, Optional, Protocol, cast
from typing import Any, Protocol, cast

import httpx

Expand Down Expand Up @@ -124,7 +124,7 @@ def is_azure_content_policy_violation_error(error_str: str) -> bool:
return False


def get_error_message(error_obj) -> Optional[str]:
def get_error_message(error_obj) -> str | None:
"""
OpenAI Returns Error message that is nested, this extract the message

Expand Down Expand Up @@ -180,13 +180,13 @@ def _get_body_error_code(error_str: str) -> int | None:
return None


def _get_response_headers(original_exception: Exception) -> Optional[httpx.Headers]:
def _get_response_headers(original_exception: Exception) -> httpx.Headers | None:
"""
Extract and return the response headers from an exception, if present.

Used for accurate retry logic.
"""
_response_headers: Optional[httpx.Headers] = None
_response_headers: httpx.Headers | None = None
try:
_response_headers = getattr(original_exception, "headers", None)
error_response = getattr(original_exception, "response", None)
Expand All @@ -203,7 +203,7 @@ def _get_response_headers(original_exception: Exception) -> Optional[httpx.Heade


def extract_and_raise_litellm_exception(
response: Optional[Any],
response: Any | None,
error_str: str,
model: str,
custom_llm_provider: str,
Expand Down Expand Up @@ -1954,7 +1954,7 @@ def _map_azure_exception(
# Azure OpenAI (especially Images) often nests error details under
# body["error"]. Detect content policy violations using the structured
# payload in addition to string matching.
azure_error_code: Optional[str] = None
azure_error_code: str | None = None
try:
body_dict = getattr(original_exception, "body", None) or {}
if isinstance(body_dict, dict):
Expand Down
4 changes: 2 additions & 2 deletions litellm/llms/anthropic/cost_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- e.g.: prompt caching
"""

from typing import TYPE_CHECKING, Optional
from typing import TYPE_CHECKING, Optional, Tuple

from litellm.litellm_core_utils.llm_cost_calc.utils import (
_get_token_base_cost,
Expand Down Expand Up @@ -62,7 +62,7 @@ def _compute_cache_only_cost(

def cost_per_token(
model: str, usage: "Usage", service_tier: str | None = None
) -> tuple[float, float]:
) -> Tuple[float, float]:
"""
Calculates the cost per token for a given model, prompt tokens, and completion tokens.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ def _resolve_search_tool_conflict(

return googleSearch, googleSearchRetrieval, enterpriseWebSearch, urlContext

def _map_function(self, value: list[dict], optional_params: dict) -> list[Tools]:
def _map_function(self, value: List[dict], optional_params: dict) -> List[Tools]:
"""
Map OpenAI-style tools/functions to Vertex AI format.

Expand Down
6 changes: 3 additions & 3 deletions litellm/proxy/proxy_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ def _run_gunicorn_server(
num_workers: int,
ssl_certfile_path: str,
ssl_keyfile_path: str,
max_requests_before_restart: int | None = None,
max_requests_before_restart_jitter: int | None = None,
max_requests_before_restart: Optional[int] = None,
max_requests_before_restart_jitter: Optional[int] = None,
):
"""
Run litellm with `gunicorn`
Expand Down Expand Up @@ -912,7 +912,7 @@ def run_server(
keepalive_timeout,
timeout_worker_healthcheck,
max_requests_before_restart,
max_requests_before_restart_jitter: int | None,
max_requests_before_restart_jitter: Optional[int],
enforce_prisma_migration_check: bool,
use_v2_migration_resolver: bool,
reload: bool,
Expand Down
14 changes: 7 additions & 7 deletions litellm/proxy/proxy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,6 @@ def generate_feedback_box():
)
from litellm.proxy.management_helpers.audit_logs import create_audit_log_for_update
from litellm.proxy.memory.memory_endpoints import router as memory_router
from litellm.proxy.plugin_routes import (
router as plugin_router,
register_plugins_from_config,
)
from litellm.proxy.middleware.in_flight_requests_middleware import (
InFlightRequestsMiddleware,
)
Expand Down Expand Up @@ -455,6 +451,10 @@ def generate_feedback_box():
from litellm.proxy.pass_through_endpoints.pass_through_endpoints import (
router as pass_through_router,
)
from litellm.proxy.plugin_routes import (
register_plugins_from_config,
router as plugin_router,
)
from litellm.proxy.public_endpoints import router as public_endpoints_router
from litellm.proxy.rag_endpoints.endpoints import router as rag_router
from litellm.proxy.rerank_endpoints.endpoints import router as rerank_router
Expand Down Expand Up @@ -8758,8 +8758,8 @@ async def model_list(
async def model_info(
model_id: str,
user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),
team_id: str | None = None,
healthy_only: bool | None = False,
team_id: Optional[str] = None,
healthy_only: Optional[bool] = False,
):
"""
Retrieve information about a specific model accessible to your API key.
Expand Down Expand Up @@ -16456,7 +16456,6 @@ async def get_routes():
app.include_router(tag_management_router)
app.include_router(workflow_management_router)
app.include_router(memory_router)
app.include_router(plugin_router)
app.include_router(cost_tracking_settings_router)
app.include_router(router_settings_router)
app.include_router(fallback_management_router)
Expand All @@ -16466,6 +16465,7 @@ async def get_routes():
app.include_router(ui_discovery_endpoints_router)
# Eager: /models/{name}:method overlaps with the OpenAI /models endpoint.
app.include_router(google_router)
app.include_router(plugin_router)

attach_lazy_features(app)
app.add_middleware(
Expand Down
9 changes: 0 additions & 9 deletions osv-scanner.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,3 @@ id = "GHSA-gr75-jv2w-4656"
ignoreUntil = 2026-12-31
reason = "langchain fix requires >=1.3.9, but that needs langgraph>=1.2.4,<1.3.0 which conflicts with our pinned langgraph==1.0.10 (langgraph-prebuilt==1.0.8 requires langgraph==1.0.10). Blocked until langgraph family can be bumped as a coordinated upgrade."

[[IgnoredVulns]]
id = "GHSA-f4xh-w4cj-qxq8"
ignoreUntil = 2026-06-24
reason = "langsmith 0.8.18 (the fix) was published within the past 3 days; blocked by exclude-newer-span = P3D until 2026-06-24. Remove this entry once the daily lock refresh picks up 0.8.18."

[[IgnoredVulns]]
id = "GHSA-4xgf-cpjx-pc3j"
ignoreUntil = 2026-06-24
reason = "pydantic-settings 2.14.2 (the fix) was published within the past 3 days; blocked by exclude-newer-span = P3D until 2026-06-24. Remove this entry once the daily lock refresh picks up 2.14.2."
14 changes: 7 additions & 7 deletions ruff-strict-budget.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"slack": 10
},
"ANN401": {
"baseline": 1941,
"baseline": 1942,
"slack": 50
},
"ASYNC230": {
Expand Down Expand Up @@ -108,7 +108,7 @@
"slack": 3
},
"C901": {
"baseline": 304,
"baseline": 311,
"slack": 15
},
"D419": {
Expand Down Expand Up @@ -232,7 +232,7 @@
"slack": 3
},
"PLR0913": {
"baseline": 1831,
"baseline": 1849,
"slack": 50
},
"PLR1704": {
Expand Down Expand Up @@ -412,7 +412,7 @@
"slack": 3
},
"TID251": {
"baseline": 2669,
"baseline": 2670,
"slack": 50
},
"TRY002": {
Expand All @@ -436,11 +436,11 @@
"slack": 30
},
"UP006": {
"baseline": 13066,
"baseline": 13065,
"slack": 100
},
"UP007": {
"baseline": 2541,
"baseline": 2542,
"slack": 50
},
"UP008": {
Expand Down Expand Up @@ -476,7 +476,7 @@
"slack": 3
},
"UP035": {
"baseline": 2261,
"baseline": 2262,
"slack": 50
},
"UP036": {
Expand Down
Loading
Loading