Commit graph

50178 commits

Author SHA1 Message Date
mateo
78eb92ca55 refactor(proxy): simplify TypeSafe passthrough pricing lookup and route
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 15:55:57 +00:00
mateo
2dc9697381 feat(proxy): add TypeSafe Jev passthrough spend tracking
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 15:53:19 +00:00
kerry-berri
4b368bf066
Merge pull request #41576 from BerriAI/litellm_openrouter_union_alpha
feat(openrouter): add stealth/union-alpha to the model cost map
2026-09-17 00:37:39 -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
kerry
3d0fd127d5 feat(openrouter): add stealth/union-alpha to the model cost map
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 07:20:16 +00: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
yucheng
b536289233 refactor(guardrails): type the request scan context helpers as read-only mappings
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 06:54:17 +00: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
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
f58389c0e8
Merge pull request #41563 from BerriAI/litellm_budget-null-clear-tests
test(budgets): cover management null handling
2026-09-16 23:02:04 -07: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
yucheng-berri
821bcf5d78
Merge pull request #41140 from BerriAI/litellm_otel_v2_langfuse_user_session_tags 2026-09-16 20:55:42 -07:00
Yuneng Jiang
c6023b4eec
test: pin the post-#41289 cooldown contract and scroll the auto-router select spec
test_router_fallbacks_with_cooldowns_and_dynamic_credentials expected a
caller-supplied credential to register its own deployment and cool it down.
#41289 stopped registering it, so cooldown logic skips that id and the
assertion can never hold. The test now asserts what the router guarantees
today: a 429 to a forwarded credential cools down none of the shared
deployments, the next credential is still served, and a 429 owned by a shared
deployment still cools it down. The final live OpenAI call becomes a mock

The auto-router template spec assumed the Add Auto Router form left room
below the Template select at 1280x900. #41315 added classifier fields above
it, so the options opened upward. The spec now scrolls the trigger to the top
of the dialog and asserts it sits in the upper half before checking placement
2026-09-16 20:52:19 -07:00
yuneng-jiang
54fa790e20
Merge pull request #41551 from BerriAI/litellm_cadence_319f427_key_lifecycle_delete
test(e2e): read a deleted key back as deleted, not as a 404
2026-09-16 20:48:55 -07:00
yuneng-jiang
3c34b92594
Merge pull request #41524 from BerriAI/litellm_aws_rotation_values
test(aws): verify rotated secret value
2026-09-16 20:41:12 -07:00
yucheng-berri
375cd4a668
Merge pull request #41498 from BerriAI/litellm_otel_indexed_messages_span_headroom 2026-09-16 20:40:24 -07:00
ryan-crabbe-berri
8b64f1ef03
Merge pull request #41525 from BerriAI/litellm_team_admin_rpm_budget_fields
feat(proxy): let team admins edit rpm_limit and max_budget when enabled
2026-09-16 20:39:05 -07:00
tin-berri
d18e06f736
Merge pull request #41508 from BerriAI/litellm_1789600151_discover_context_limits
feat(router): discover token limits for hosted OpenAI-compatible models
2026-09-16 20:29:57 -07:00
yuneng-berri
44a0e16c81
test(e2e): read a deleted key back as deleted, not as a 404
/key/info now serves a deleted key from the archive with status deleted
instead of answering 404, so the delete test's convergence predicate never
settled and the read timed out against a 200 it kept discarding.

The predicate now waits for status deleted through the same
_key_info_everywhere helper the rest of the file uses, and KeyInfo carries
the status field. The chat-rejection assertion after it is unchanged, so
the test still proves the key stops serving.
2026-09-17 02:38:27 +00:00
Yassin Kortam
351a54e849
Merge pull request #41507 from BerriAI/litellm_attribute_router_rejected_spend_provider
fix(spend_tracking): attribute router-rejected requests to the model group provider
2026-09-16 18:21:44 -07:00
ryan-crabbe-berri
fc13cea479 fix(proxy): refuse a team admin's budget write when the budget changed mid-request
The keep-or-lower check compares against the budget update_team read, so the write now only lands while the stored max_budget still matches it and answers 409 otherwise. A concurrent proxy admin cut can no longer be overwritten with a higher value.
2026-09-16 18:11:53 -07:00
yucheng
7815719de7 fix(guardrails): stream Prompt Security post_call redactions in incremental_diff mode
Forward streaming_transform_mode from guardrail litellm_params into PromptSecurityGuardrail so incremental_diff is reachable from config; the default stays block_only. In incremental_diff the guardrail now returns stream_holdback_chars alongside the rewritten texts so that a value split across streamed chunks (or across an abbreviation period) is never partially released before the vendor rewrite arrives. Each response text gets its own protect call so modified_text maps back to the right choice when n > 1, and custom_guardrail no longer logs a clean response as mask just because the guardrail attached holdback metadata

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 01:06:12 +00:00
Mateo Wang
2445bdd2b5
Merge pull request #40934 from BerriAI/litellm_fix_ocr_native_multipage_pdf
fix(logging): scan each log record once and collapse base64 payloads before the secret regex
2026-09-16 18:06:11 -07:00
yassin
e06c81665f refactor(spend_tracking): type the get_logging_payload parameters
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 01:02:03 +00:00
yuneng-jiang
38676aa599
Merge pull request #41078 from BerriAI/litellm_integration_extensions
test: add extension and browser integration contracts
2026-09-16 17:55:25 -07:00
yuneng-jiang
e927b63211
Merge pull request #41520 from BerriAI/litellm_/attribution-investigation-a81211
fix(e2e): bind provider-cache recordings to the deployment's test, not the serving process
2026-09-16 17:52:03 -07:00
ryan-crabbe-berri
d3f0607820 test(ui): find the max_budget checkbox by its new label 2026-09-16 17:50:57 -07:00
yucheng-berri
0add8c0083
Merge pull request #41495 from BerriAI/litellm_converted_stream_post_call_hook
fix(utils): run post-call deployment hook on converted chat streams
2026-09-16 17:49:14 -07:00
yucheng
79aae7f062 refactor(otel v2): build Langfuse trace attributes from pairs to satisfy the type discipline gate
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 00:49:12 +00:00
Yuneng Jiang
02ced74540
test: fix five tests left stale by #41311, #41337, #39996 and #41310
Every one of these fails on main's own scheduled CircleCI run with the same
assertion as on any PR, and each traces to a merged behavior change that
never updated the test that pinned the old behavior

- tests/integration/_support/client.py: #41311 made /key/info serve deleted
  keys from the archive with status deleted, so the scenario teardown asserts
  the live row is gone and the readback reports deleted instead of a 404.
  This alone accounts for nine integration-management and one
  integration-providers failure
- tests/integration/authorization/test_warmed_policy.py: #39996 made team
  admins unable to edit any team field unless a proxy admin allow-lists it,
  and tpm_limit is the only field it accepts today. The demotion test now
  enables tpm_limit for the scenario and edits that instead of team_alias
- tests/llm_responses_api_testing/test_base_responses_api_streaming_iterator.py:
  #41337 reads usage off the terminal response and copies the event when it
  is missing, which a Mock(spec=ResponsesAPIResponse) cannot survive. The
  four mocks now carry a usage object
- tests/test_openai_endpoints.py: #41310 lengthened the access-denied
  message, and the test matched against the ExceptionInfo repr, which
  saferepr truncates in the middle. It now matches the exception text
- tests/local_testing/test_text_completion.py: Together no longer serves
  Qwen2-1.5B serverless, the cheapest cost-map row. The test mocks the
  completions call and asserts the request litellm builds, so a vendor
  catalog rotation cannot fail it again

test_router_fallbacks_with_cooldowns_and_dynamic_credentials is deliberately
untouched: it passes and fails on main with identical code, and the failing
path is a product question about whether dynamic-credential 429s cool down
2026-09-16 17:47:27 -07:00
Yuneng Jiang
86f709d7c9
test(aws): preserve rotation response coverage 2026-09-16 17:47:09 -07:00
Yassin Kortam
617a40bb1c
Merge pull request #40842 from BerriAI/litellm_guardrail_tag_budget_enforcement
fix(proxy): enforce tag budgets for tags added by guardrails
2026-09-16 17:44:29 -07:00
yujonglee
a86be37aa6
Merge pull request #41500 from BerriAI/litellm_add-framer
feat(rust): add standalone framing crate
2026-09-16 17:41:12 -07:00
yucheng
126e257062 merge: resolve conflict with main in otel metadata module
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 00:38:50 +00:00
kerry-berri
db408f68ae
Merge pull request #41494 from BerriAI/litellm_auto_merge_price_sync
ci: auto-merge provider-info-sync PRs when CI, Greptile and Bugbot are clean
2026-09-16 17:36:02 -07:00
ryan-crabbe-berri
e3a82f2f66 fix(proxy): stop team admins raising an org team's max_budget under the org cap
The keep-or-lower budget rule only ran for standalone teams, so once max_budget is enabled a team admin on an org team could grow its own budget up to the organization's. It now applies to team admins on every team; org admins keep editing within the org cap.
2026-09-16 17:35:18 -07:00
Yuneng Jiang
a0a006f248
fix(e2e): own a shared fixture's deployment by the fixture's node, not the first test
A deployment registered while a module- or class-scoped fixture is being set up
was bound to whichever test asked for the fixture first, so every later test in
the module shared that partition. A session-scoped fixture is set up by every
xdist worker, so its deployment could never have one owner at all.

The e2e conftest now wraps pytest_fixture_setup and records the node the fixture
is scoped to: registrations made during a module or class fixture's setup carry
that node's slug, and a session- or package-scoped one has no owner and stays
live. The registration seam test moves from tests/e2e to the cache harness tests
beside the rest of the attribution coverage.
2026-09-16 17:35:05 -07:00
yucheng
e1cce943de Merge remote-tracking branch 'origin/main' into litellm_converted_stream_post_call_hook 2026-09-17 00:31:24 +00:00
mateo-berri
55cf4c43ed fix(logging): stamp scrubbed records with a private sentinel a caller cannot supply
A record stamped litellm_redacted=True skips the secret filter and both
formatters, and extra={"litellm_redacted": True} on any log call put that
stamp on a fresh record before the filter ran. The stamp is now a private
object compared by identity, so only the filter's own pass marks a record
scrubbed.
2026-09-16 17:30:49 -07:00
Yujong Lee
1ef094bb41 feat(rust): add standalone framing crate
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 00:30:43 +00:00
yassin
f76e8b3984 test(spend_tracking): type the provider resolution stubs in the router-rejected regression tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-17 00:29:13 +00:00
Yuneng Jiang
495b731bbc
Merge remote-tracking branch 'origin/main' into litellm_aws_rotation_values 2026-09-16 17:29:10 -07:00