Commit graph

17572 commits

Author SHA1 Message Date
ryan-crabbe-berri
f04f0258f7 refactor(team): model the bulk budget audit payload as frozen types 2026-09-17 15:41:06 -07:00
ryan-crabbe-berri
909a30d6a1 fix(team): keep a forked member budget's reset window and audit bulk member budget writes
Forking a shared budget row rebuilt budget_reset_at from the duration, so editing
an unrelated limit restarted the member's window while their spend carried over:
a tpm bump quietly handed them a fresh period. The fork now inherits the source
row's deadline, and only recomputes when the patch actually sets budget_duration.

The bulk member budget route now writes one audit entry per call, a team-scoped
'updated' row carrying every written member's limits before and after, matching
what /team/member_add already records for membership changes. It honors the
litellm-changed-by header like the other audited team routes.
2026-09-17 15:17:00 -07:00
ryan-crabbe-berri
5396810bb6 fix(management_v1): authorize bulk member budget writes off the writer and reject unschedulable reset windows
The roster the authorization check reads came from the routed reader, so a
replica lagging behind a team-admin demotion could still grant that caller
member-budget writes. Pin that read to the writer, as the model reconcile does.

A budget_duration the reset job can never schedule from, a non-positive one
that leaves the row permanently due or an unparseable one that blew up mid
batch as a 500, is now a 422 naming the row it came from, with nothing written.
The check is the same one /team/member_update and /budget/new already run,
lifted out of validate_budget_duration so both surfaces share it.
2026-09-17 13:31:32 -07:00
ryan-crabbe-berri
4f6dfb0480 fix(management_v1): report a zero team default as no cap
Enforcement treats max_budget 0 on the team default as "no cap" and only
honors 0 as an explicit disable on a member's own row, so reporting an
inheriting member as capped at 0 said the opposite of what happens on their
next request.
2026-09-17 12:35:46 -07:00
ryan-crabbe-berri
648373a260 feat(management_v1): bulk update team member budgets
Adds POST /management/v1/teams/{team_id}/members/bulk_update, a merge patch
over per-member limits (max_budget_in_team, tpm_limit, rpm_limit,
budget_duration, allowed_models) for up to 500 members in one transaction.

Editing a team's default member budget has never reached members who already
have a budget row, because /team/member_add clones the default per member.
This gives admins one call to roll a new cap out across the roster, and each
result carries max_budget_source so a caller can see whether a member is on
their own cap or on the team default.

Reads run on the writer inside the batch transaction, and any budget row more
than one membership points at is cloned before it is written, so raising one
member's cap never moves another's.
2026-09-17 12:30:46 -07:00
yujonglee
dc81cf57f7
Merge pull request #41550 from BerriAI/new-ocr-mapping2
refactor(ocr): mirror Python provider layout and preserve tests
2026-09-17 12:18:02 -07:00
Yujong Lee
cd4d78a26a fix(ocr): narrow public error attribute writes and cover callback failure mapping
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 19:06:28 +00:00
joshua-berri
1e7b03a6ed
Merge pull request #41619 from BerriAI/litellm_fix_mcp_guardrail_context_4889
fix(mcp): preserve request-selected guardrails during tool execution
2026-09-17 19:04:04 +00:00
joshua-berri
f075417643
Merge pull request #41609 from BerriAI/litellm_fix_mcp_health_permissions_4504
fix(mcp): restrict health discovery to virtual key grants
2026-09-17 19:03:50 +00:00
kerry-berri
ab03850666
Merge pull request #41623 from BerriAI/litellm_lit_8010_mock_response_provider_custom_pricing
fix(mock_completion): keep the resolved provider so router custom pricing resolves for azure_ai deployments
2026-09-17 11:49:33 -07:00
Yujong Lee
1f0c10147d merge: port OCR request validation and upstream error mapping onto main's dispatch layout
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 18:33:20 +00:00
Yujong Lee
15f0d83305 merge: take main's e2e team allow-list settle helper
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 18:16:46 +00:00
Yujong Lee
766f45e0eb merge: resolve conflicts with main for anthropic layout rename
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 18:09:27 +00:00
Yujong Lee
b26935416a Merge remote-tracking branch 'github/main' into litellm_rust_bridge_declarative_route_catalog
# Conflicts:
#	tests/e2e/access_control/test_model_access_group_e2e.py
2026-09-17 11:08:08 -07:00
kerry
3cf42f6565 test(mock_completion): cover the provider inference fallback for direct calls
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 18:07:58 +00:00
Yujong Lee
b170d61b8d route stuff through dispatch no direct main 2026-09-17 11:06:46 -07:00
Yujong Lee
56ba988b62 fix wrong assertion 2026-09-17 10:54:58 -07:00
Joshua Valluru
f4918e69f4 test(mcp): use the shared guardrail exception in regression 2026-09-17 10:54:28 -07:00
Joshua Valluru
5b91195406 fix(mcp): retain selected guardrails for virtual REST calls 2026-09-17 10:40:33 -07:00
Yuneng Jiang
fa01e2d5b7
Merge branch 'main' into litellm_/buildkite-241-triage-4a48cf 2026-09-17 10:39:37 -07:00
Yuneng Jiang
dd6ef9e1bc
fix(e2e): delete raw cloud-storage batch files with the master key
DELETE /v1/files/{id} only lets a proxy admin key delete a raw s3:// or
gs:// file id, because such ids skip the managed-file owner check. The
batch lifecycle cleanup deleted the vertex_ai raw ids with the test's
own virtual key and got a 403 at teardown on every build since #194

Raw cloud-storage ids now go through the master key; managed and
provider-native ids keep using the creating key
2026-09-17 10:37:08 -07:00
Yuneng Jiang
1d71564063
fix(e2e): settle the team allow-list through /team/info
The team access-group fixture polled a 403 until its message enumerated
the team's allow-list, because registering a team-scoped deployment
appends that deployment to the list and the fixture has to wait for the
reset to land. #41310 replaced that message with a fixed client-facing
one, so the poll never matched and both tests errored at setup

The allow-list is now read back from /team/info until it holds exactly
the access group
2026-09-17 10:37:07 -07:00
Yuneng Jiang
c3048dcd30
test(http): move the outbound HTTP/2 check into a new integration sdk suite
The check spins up a hypercorn TLS peer and drives the SDK's own httpx
handlers at it, so it needs litellm importable, hypercorn installed and a
loopback socket. It lived under tests/e2e, whose Buildkite runner image
installs neither litellm nor hypercorn by design (the suite drives a
remote proxy over HTTP), so every scheduled e2e build since #230 failed
to import the module and pytest reported it as a collection error. The
unit tree bans sockets, so it does not belong there either

tests/integration is the CircleCI tier built for real TCP against local
protocol peers. This adds an sdk shard to it for cases that exercise the
SDK's clients with no gateway in the path, registers the two HTTP/2
nodes in the contracts manifest, and adds the shard to the CircleCI
matrix. The test now flips the feature through LITELLM_HTTP2 (the user
surface) instead of patching module attributes, and asserts the version
the peer observed on the wire next to the one the client reports
2026-09-17 10:37:07 -07:00
kerry
c2dd7bd98a fix(mock_completion): stamp the resolved provider on mock responses so router custom pricing resolves
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 17:36:11 +00:00
Yujong Lee
4ecc55ec70 fix(ocr): build upstream httpx response in Python and satisfy PT012
The Rust bridge imported httpx to construct the provider error response, which
fails in the isolated wheel check where httpx is absent. Rust now raises
RustUpstreamError with a headers attribute and the Python lifecycle wraps it in
a typed UpstreamFailure carrying the httpx.Response before legacy mapping.
Test helpers gained call_native so pytest.raises blocks hold a single call

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 17:34:18 +00:00
yuneng-jiang
11b99142eb
Merge pull request #41573 from BerriAI/litellm_project-route-coverage
test(management): cover project authorization lifecycle
2026-09-17 10:30:55 -07:00
Yujong Lee
f91d1f7ea1 fix wrong assertion 2026-09-17 10:30:32 -07:00
Joshua Valluru
db4cd8de8d test(mcp): await registration on every configured replica 2026-09-17 10:13:45 -07:00
Joshua Valluru
326ba8c8a4 test(mcp): reuse the registered server snapshot for alias grants 2026-09-17 10:03:36 -07:00
Joshua Valluru
743684bdbe fix(mcp): preserve request-selected guardrails during tool execution 2026-09-17 09:57:08 -07:00
Yuneng Jiang
44bc3d1436
test(management): avoid pinning tenant error disclosure 2026-09-17 09:41:49 -07:00
Joshua Valluru
5a105657c1 test(mcp): isolate health assertions to owned servers 2026-09-17 09:25:05 -07:00
Joshua Valluru
664b1f16bb style(tests): wrap MCP health regression setup 2026-09-17 09:19:05 -07:00
Joshua Valluru
e21db01d67 fix(mcp): scope health discovery for route-restricted keys 2026-09-17 09:17:55 -07:00
Yujong Lee
370cdaabf9 encode failing tests 2026-09-17 08:04:52 -07:00
yucheng-berri
e40b90bbfa
Merge pull request #41220 from BerriAI/litellm_post_call_guardrail_context
fix(guardrails): give post-call scans the scoped request conversation and tools
2026-09-17 00:31:46 -07:00
yucheng
b237c185db test(guardrails): type the recording guardrail logging_obj as the logging object
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 07:12:27 +00:00
yucheng-berri
d8d5437f55
Merge pull request #41558 from BerriAI/litellm_lit_6568_streaming_redaction
fix(guardrails): stream Prompt Security post_call redactions in incremental_diff mode
2026-09-17 00:10:45 -07:00
Yuneng Jiang
a40b6b3e44
test(management): close project lifecycle coverage gaps 2026-09-16 23:43:25 -07:00
yuneng-jiang
5c486126ac
Merge pull request #41568 from BerriAI/litellm_/ci-test-failures-investigation-99785b
test(e2e): drop the auto-router select "opens below" spec
2026-09-16 23:23:36 -07:00
Yuneng Jiang
4210f586c2
test(management): cover project authorization lifecycle 2026-09-16 23:08:00 -07:00
Devin AI
85444b56d9 fix(guardrails): hand the input scan context to the logging_only response scan
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 06:04:38 +00:00
Yuneng Jiang
25445e8b5c
test(e2e): drop the auto-router select "opens below" spec
The spec pinned Base UI's collision behaviour, not our code: it only passes
while the template popup happens to fit under the trigger at 1280x900, and
#41315's taller Add Auto Router form broke that premise for the second time
in three weeks. #41527 tried to scroll the trigger into the upper half, but
the dialog content is shorter than its max height, so nothing scrolls and CI
still fails 3/3 with the trigger at y=487

The guarantee #38554 introduced is that the popup never covers the trigger,
and the sibling spec keeps asserting that at a viewport with no room below
2026-09-16 22:43:51 -07:00
yucheng
2d925e5dde fix(guardrails): scope the logging_only reply scan with the request's own translation
The chat-shaped output handler now takes the input translation as its
request scoping, so the logged request is scoped exactly once and with
the pre-call semantics of the surface it arrived on. This drops the
unscoped chat_shaped_request_conversation detour from af312dc8, which
made the Anthropic response scan remove in-sequence system turns under
skip_system while the request scan kept them

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 05:40:44 +00:00
Devin AI
af312dc8d7 fix(guardrails): scope the logging_only response scan once
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 05:30:06 +00:00
yucheng
060abd263e fix(guardrails): keep usage chunk and defer tool_calls finish_reason behind held text in incremental_diff
A stream_options.include_usage usage chunk (empty delta plus usage) was folded into the final
transform round and rebuilt without its usage, so token counts and cost vanished from clients.
Metadata-only chunks are now replayed after the final text flush.

A terminal tool-call chunk arriving while earlier text was still held back carried
finish_reason=tool_calls ahead of that text. The finish_reason is now deferred to the final
text chunk whenever the choice has held text.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 05:11:04 +00:00
yucheng
87263cefca Merge remote-tracking branch 'origin/main' into litellm_post_call_guardrail_context
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

# Conflicts:
#	tests/test_litellm/llms/openai/responses/test_openai_responses_guardrail_handler.py
2026-09-17 05:08:02 +00:00
Yuneng Jiang
a0869fe835
test(budgets): avoid mutable fixture state 2026-09-16 22:06:31 -07:00
Yuneng Jiang
5c41e0b8dc
test(budgets): cover management null handling 2026-09-16 21:42:55 -07:00
yuneng-jiang
5ef40a630b
Merge pull request #41527 from BerriAI/litellm_/monitor-cci-failures-ac97a9
test: fix seven tests left stale by #41311, #41337, #39996, #41310, #41289 and #41315
2026-09-16 21:25:51 -07:00