Commit graph

20851 commits

Author SHA1 Message Date
Yuneng Jiang
7f78209db1
Merge branch 'lts/1.108.x' into litellm_backport_messages_reject_background_lts_1_108_x 2026-11-09 11:57:36 -08:00
Mateo Wang
b815053525
Merge pull request #50399 from BerriAI/litellm_backport_50073_lts_1_108_x
fix(bedrock): backport #50073 to lts/1.108.x
2026-11-09 19:43:35 +00:00
Mateo Wang
a76413209e
Merge pull request #50365 from BerriAI/litellm_backport_45715_lts_1_108_x
fix(vertex_ai): backport Claude batches in Anthropic's row shape to lts/1.108.x (#45715)
2026-11-09 19:43:07 +00:00
Mateo Wang
862a1fbeee
Merge pull request #50456 from BerriAI/litellm_backport_49076_lts_1_108_x
fix(anthropic): backport #49076 encrypted reasoning round-trip to lts/1.108.x
2026-11-09 19:36:36 +00:00
yuneng-jiang
842ab91663
Merge pull request #50568 from BerriAI/litellm_/recursing-jones-b2e294
fix(bedrock)!: backport #47429 pass-through guardrailConfig and the integration test fixes to lts/1.108.x
2026-11-09 11:23:41 -08:00
shrey
b1de7aa85d
Merge pull request #50605 from BerriAI/litellm_backport_45961_stable_1_108_x
fix(sdk): backport #45961 to lts/1.108.x
2026-11-09 09:46:09 -08:00
ekpog200
854937381d fix(videos)!: keep model_id in proxy video ids so per-model keys resolve on status/content (#44614)
Backport of #44614 to lts/1.108.x.
Cherry-picked from ba61ecdf57 (main). The line has no splits_stream_timeout on _update_kwargs_with_deployment, so only the _video_call_pin wrapping is added around deployment selection. The line has no litellm/llms/base_llm/videos/async_task_utils.py, so its _id_safe_name dedupe is applied to the dashscope video transformation that holds the same helper on this line.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-09 15:05:22 +00:00
devin-ai-integration[bot]
ca4e6521e7 fix(router): serve a team's wildcard deployment before a proxy-wide wildcard (#48490)
Backport of #48490 to lts/1.108.x.
Cherry-picked from 76d001a7c0 (main). The line has no wildcard_routed_models helper and no get_models_by_pattern, so only wildcard_route_deployments is changed.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-09 14:47:28 +00:00
MFJG
cb738a5697 fix(sdk): backport #45961 to lts/1.108.x
completion() loaded the MCP gateway handler for any request with tools,
and the handler pulls in mcp 2.x only code, so tool calls failed on
installs with mcp 1.x (google-adk 1.36.1) or no mcp at all

Cherry-picked from 783cf06f31. Only conflict was import context in
litellm/responses/main.py

(cherry picked from commit 783cf06f31)
2026-11-07 17:55:52 -08:00
Yuneng Jiang
d06f5a5021
test(e2e): repin the Together reasoning replay backend to MiniMax-M3.1-Flash
MiniMax-M3 reached its 2026-11-06 deprecation date in the cost map, which names MiniMax-M3.1-Flash as its successor

(cherry picked from commit 90f7ab6fe6)
2026-11-07 17:08:44 -08:00
Yuneng Jiang
4fb2f026a0
refactor(bedrock): drop the unused converse URL helper and cover a trailing-slash converse pass-through 2026-11-07 16:58:22 -08:00
Yuneng Jiang
f4ba1bfafc
fix(bedrock)!: backport #47429 deployment guardrailConfig on /bedrock pass-through routes to lts/1.108.x
The router-model pass-through dropped a Bedrock deployment's guardrailConfig, so converse, converse-stream, invoke and invoke-with-response-stream reached Bedrock unguarded while /v1/chat/completions on the same deployment was blocked. The signer now sends it the way Bedrock reads it, in the body for Converse and as the X-Amzn-Bedrock-Guardrail* headers for Invoke, replacing any guardrail the caller sent

Adapted to the line, which does not have #47040. The guardrail headers are merged through merge_bedrock_invoke_headers without the request metadata header, and the unit tests drop the request metadata assertions and the identity argument that only #47040 needs
2026-11-07 16:45:18 -08:00
Yuneng Jiang
52f49b8e86
test(integration): backport main's Gateway.rows, Scenario.model name and MCP ack fix to lts/1.108.x
Backports test-only changes from main so the line's integration signal stops reporting stale helpers as failures.

Gateway.database_url and Gateway.rows come from #47213 (fc27dfdc7d), and the name keyword on Scenario.model comes from #48917 (ebf84f8649). Only those hunks of tests/integration/_support/client.py are taken. The rest of #47213 gives each owned proxy its own database and Redis, which none of the line's tests need, and the workers field from a later main change is left out.

The MCP progress and cancellation test wraps its upstream in _acknowledge_notifications_after_dispatch, from #49967 (b5952f243a). The helper is already on the line.
2026-11-07 14:34:39 -08:00
mateo-berri
d5ad71dd65 test(anthropic): type the retry helper parameter in the cancellation test
Some checks failed
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
2026-11-07 10:54:21 -08:00
mateo-berri
edb48c1d09 fix(anthropic): stop a cancelled SDK retry from starting another call
The resent-failure retry predicate returned true for BaseException
subclasses such as asyncio.CancelledError, so a cancelled
acompletion_with_retries or aresponses_with_retries call could start
another provider call. Retry only Exception subclasses again, as
tenacity's default did, while still skipping a resent failure.
2026-11-07 10:45:18 -08:00
mateo-berri
b277d687b5 fix(anthropic): stop SDK retries from resending a rejected block or clearing the global num_retries
A transient 429 or 500 on a /v1/messages turn that carries a replayed encrypted
block was retried by an SDK call's num_retries loop, which sent the block again
until every retry was rejected. On async calls the loop then raised the first
transient error, so the turn failed instead of being sent again without the
block. The retry loop now stops at that rejection and passes it on, so the turn
is sent again once without encrypted blocks.

A rejected first try on a sync call also cleared the process-wide
litellm.num_retries, so later calls in the process were no longer retried. That
setting now stays as configured.
2026-11-07 10:22:13 -08:00
mateo-berri
433a76f754 fix(anthropic): skip the SDK num_retries retry for an attempt that is sent again 2026-11-07 09:28:59 -08:00
mateo-berri
c72cb031d8 test(anthropic): type the success logger and use a fixed token expiry in the bridge tests 2026-11-07 08:55:37 -08:00
mateo-berri
5a6475d112 test(anthropic): type the parameters of the failure-recording test loggers
Backport of 3d53f0047d (#49076) to lts/1.108.x.
2026-11-07 08:46:14 -08:00
mateo-berri
a1c02f7d1a fix(anthropic): log only the outcome of a turn sent again, and keep every reasoning item in Messages logs on the line
A /v1/messages turn whose replayed encrypted block the backend rejects is sent
once more without it. The rejected first attempt no longer fires failure
callbacks or releases its parallel slot and budget reservation, so only the
turn sent again is logged and counted.

Success logs for a Messages client now keep every reasoning item of a
non-streamed turn, matching the reply the client got.
2026-11-07 07:33:23 -08:00
mateo-berri
97df7cb369 fix(anthropic): keep every non-streamed reasoning item for Messages clients on the line's bridge
This line's transform_request rewrites the logging call_type to responses, so the non-streamed reply read the Messages-client check after the rewrite and kept only the last reasoning item. The bridge handler now reads it before the request transform and passes it to transform_response, as the streamed path already does.
2026-11-07 06:06:59 -08:00
mateo-berri
ce35f27bfa fix(anthropic): keep every non-streamed reasoning item for Messages clients and read a deployment's reasoning_summary in the keep check
Backport of #49076 to lts/1.108.x.
Ported from cadfe1d179 (cursor/chatgpt-encrypted-reasoning-messages-1723) onto the line's pass_through/adapters layout.
2026-11-07 04:08:08 -08:00
mateo-berri
d6625245b4 fix(anthropic): send openai/ Messages turns again once without encrypted reasoning a backend rejects
The openai/ Responses path on /v1/messages had no retry, so a chatgpt/ block left in history answered 400 on every later openai/ turn. That path now sends the turn once more without encrypted reasoning, the same way the chat bridge does. The retry matches only invalid_encrypted_content or a "could not be verified" message naming the content, so the exception mapper's own hint no longer triggers it. The xAI web search keep path is backed out, since xAI sends no encrypted reasoning over the bridge.

Backport of 15e6017012 from #49076 to lts/1.108.x, ported by hand onto the pass_through modules.

Co-authored-by: DDT <141296842+Hugo-DDT@users.noreply.github.com>
2026-11-07 01:53:19 -08:00
mateo-berri
f86222be48 fix(anthropic): stream reasoning signatures only to Messages clients, keep xAI web search reasoning, and retry only when the sent request carried it 2026-11-06 23:23:15 -08:00
mateo-berri
27574a429a fix(anthropic): keep each streamed reasoning summary with its own item
A summary delta carries no item index, so the next item's summary joined the block that already got its signature. A thinking chunk after an indexed signature now opens a new block.
2026-11-06 20:45:06 -08:00
yuneng-jiang
7e95523094
Merge pull request #50487 from BerriAI/backport_49984_lts_1108
Some checks failed
LiteLLM Rust / rust-lint (push) Waiting to run
LiteLLM Rust / rust-test (push) Waiting to run
LiteLLM Rust / rust-wheel (push) Waiting to run
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
test(e2e): backport the e2e speedup and main's CI cleanups to lts/1.108.x
2026-11-06 19:44:32 -08:00
joshua-berri
03d9254dc2
Merge pull request #50484 from BerriAI/litellm_backport_mcp_sse_lts_1_108_x
fix(mcp): backport #47034 to lts/1.108.x
2026-11-06 19:41:16 -08:00
mateo-berri
ba5d7b83b9 fix(anthropic): start a new streamed block for each reasoning item
The backported Responses bridge tags each reasoning item's thinking block with its output index, but this line's Anthropic stream wrapper only opened a new block when the block type changed, so a second reasoning item of the same type was dropped. This ports the index check from #46863, which main already has.
2026-11-06 19:30:43 -08:00
mateo-berri
4fc1d5bb0d fix(anthropic): stop logging rejected encrypted reasoning
The retry warning keeps provider, model, status, and error code, and leaves the ciphertext out.

Backport of the third #49076 commit to lts/1.108.x. Cherry-picked from c62c92d2ad.

Co-authored-by: DDT <141296842+Hugo-DDT@users.noreply.github.com>
2026-11-06 18:16:29 -08:00
mateo-berri
0b2cfa5c1e fix(anthropic): keep encrypted reasoning when OpenAI thinking routes the chat adapter to Responses
With use_chat_completions_url_for_anthropic_messages on, an openai model with thinking enabled is rewritten to openai/responses/, which accepts the same organization's encrypted reasoning. The keep check now uses the same routing predicate, so turn 2 replays the block instead of stripping it.
2026-11-06 18:16:10 -08:00
Mateo Wang
a323682345
ci: remove workflows whose secrets are dead (#49722)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit b4a80d175c)
2026-11-06 17:41:13 -08:00
tavren27
b6c3c591ee
ci: run the dashboard API types and Terraform endpoint checks on every change that can alter the spec (#49022)
* ci: run the dashboard API types check on every change that can alter the OpenAPI spec

* chore: shorten the spec_pattern comment to a pointer at the CI filter

* chore: drop the spec_pattern comment

* docs: name the full ui-api-types trigger set in the make check header and dashboard AGENTS.md

* test: check make check and CI pick the same files for the API-type sync

* ci: run the Terraform provider endpoint audit on enterprise route changes

* test: keep the Terraform trigger test in the mapped workflow test file

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
(cherry picked from commit e73f06ecdc)
2026-11-06 17:40:47 -08:00
devin-ai-integration[bot]
8473801145
ci: remove the Together AI and weekly cost map sync workflows (#48473)
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 57ac107311)
2026-11-06 17:40:46 -08:00
yuneng-jiang
48bb30b537
test(mcp): replace the live Linear MCP OAuth e2e tests with integration coverage (#47154)
* test(mcp): move the MCP OAuth happy path from a live Linear e2e to an integration test

GitHub Actions now runs unit tests only, and the MCP OAuth happy path needed a
captured Linear browser login to click through a real consent page. The OAuth
flows it exercised are already integration tests against an owned
authorization-server double, except one behavior: the stored per-user token
must be served by a proxy process that never saw the consent, with no shared
Redis to fall back on. That case is now in test_mcp_oauth_flows.py

The e2e test, its owned-gateway helper, its workflow, the mcp_oauth_live marker
and the JUnit gate script only that workflow used are removed

* test(mcp): chat completions run an OAuth server tool with the caller's own stored token

* test(e2e): drop the Linear chat-completion MCP OAuth e2e and its helpers

The behavior it checked, a chat completion running an OAuth server's tool with
the caller's stored per-user token, is now an integration test in
test_mcp_llm_endpoints.py that needs no saved Linear browser login

* test(mcp): decode the stored per-user credential as urlsafe base64

The plaintext check used b64decode, which drops the - and _ of a urlsafe value
and raised on roughly one ciphertext in five

* test(mcp): drop the chat OAuth integration test that duplicates test_mcp_slots F2-chat

security/test_mcp_slots.py already sends a per-user OAuth token through
/v1/chat/completions and asserts the peer receives it. Every mutant the new test
killed was also killed by the existing suite, so it added no signal

(cherry picked from commit 44fcbc30b0)
2026-11-06 17:40:33 -08:00
yujonglee
26852a46f5
Merge pull request #50463 from BerriAI/litellm_backport_50300_lts_1_108_x
fix(guardrails): backport #50300 to lts/1.108.x
2026-11-07 10:40:24 +09:00
yuneng-jiang
048b587b0c
test(e2e): retire the quiet_stack lock and batch the claude_code model registration (#49984)
* test(e2e): retire the quiet_stack lock

quiet_stack held an exclusive host-wide lock for six tests, draining every
other xdist worker while they ran. On the full e2e lane that left 35-38% of
worker time idle. Each of those tests now lives where it can run without
pausing the suite

- the two memory tests move to perf/ behind the perf marker, so the perf lane
  runs them on its own fresh stack. Their refusing deployments use a literal
  key because the perf stack carries no provider keys
- the stored-request size check from the memory test becomes an integration
  test on an owned proxy that stores prompts
- the discount and margin spend-row tests are dropped from e2e. Their
  breakdown assertions join the existing integration pricing test, which
  already owns the discount and margin repricing flow
- the Bedrock guardrail cost test stays in e2e without the pricing reset
  fixture, since nothing else on the stack writes pricing config now
- the MCP semantic tool filter test turns on a proxy-wide setting, so it gets
  a new proxy_wide_config opt-in marker and runs after the main run

* test(e2e): register the claude_code deployments as one batch

The claude_code session fixture registered its 24 deployments one at a time on every xdist worker, and each one waited out the 15 s propagation window on its own, about 6 minutes per worker. ProxyClient.register_models posts the whole batch, polls each model until every replica serves it, then waits out propagation once from the last write. A model that fails to post or never becomes servable comes back as ModelNotRegistered, and an unservable one is deleted, so the fixture keeps reporting per-deployment failures the way it did

(cherry picked from commit b18188dee2)
2026-11-06 17:27:13 -08:00
joshua-berri
3867d48dd5 fix(mcp): backport #47034 to lts/1.108.x
Upgrade to MCP SDK 2.3.0 and raise the per-event SSE size cap so MCP
tool results over 1 MiB stop failing with "SSE stream ended without a
response"

(cherry picked from commit 4aec80f5ee)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 17:08:23 -08:00
yujonglee
6c95a2d970 fix(guardrails): check a model-level post_call response once across the proxy and deployment layers (#50300)
Backport of #50300 to lts/1.108.x
Cherry-picked from 2b4485dee5 (main)

Conflicts in litellm/integrations/custom_guardrail.py and litellm/proxy/utils.py came from code the
line does not have (the pydantic import, _REQUEST_FIELDS and _guardrails_listed_in in
custom_guardrail.py, the stream token-id helpers in proxy/utils.py). Kept the line's code, added the
pick's helpers and pydantic import, and defined _REQUEST_FIELDS in both files next to the line's own
module-level TypeAdapter constants
2026-11-07 07:45:04 +09:00
mateo-berri
cb05200a5a style: clear the ruff reds lts/1.108.x already has
Drops a second ScriptedBedrockInvoke class (F811) whose wider first definition already covers it, and a repeated supports_bedrock_native_structured_output key (F601) with the same value, both from merging two earlier backports. No behavior change.
2026-11-06 14:23:12 -08:00
mateo-berri
3c1e9d83d4 fix(anthropic): reject background on /v1/messages to the Responses bridge unless drop_params drops it
Backport of the unmerged main fix to lts/1.108.x.
Cherry-picked from 92221383e5, 2d243a3f4a and c3a12326df (litellm_messages_reject_background).
Adapted to the line: background false worked here before, so false and null still pass and are left off the wire, while main answers 400 to any value.
2026-11-06 14:23:12 -08:00
mateo-berri
6fef70ac72 fix(anthropic): keep Responses reasoning on tool turns and retry once when a backend cannot decrypt it
Backport of the second #49076 commit to lts/1.108.x. Cherry-picked from 10c953d855.

Adapted to the line: chat_completion_ends_in_responses_api has no deployment_model_info
parameter here, so only tools, reasoning_effort, and api_base are threaded through, and
the moved tests import the adapters from pass_through instead of messages.
2026-11-06 13:17:32 -08:00
mateo-berri
1e513a4314 fix(chatgpt): round-trip encrypted reasoning through /v1/messages
The chat bridge stored encrypted reasoning on reasoning_items, the Anthropic
adapter never read that field, stream chunks that only carried thinking
blocks were dropped, and the messages adapter stripped the signed blocks
before a chatgpt request could turn them back into reasoning items.

Backport of #49076 to lts/1.108.x. Cherry-picked from ea9e29b1a8 (cursor/chatgpt-encrypted-reasoning-messages-1723).
The line keeps the reasoning helpers in common_utils and the adapters under pass_through,
gains resolve_model_and_provider_for_metadata, and streams redacted_thinking as its own block.

Co-authored-by: DDT <141296842+Hugo-DDT@users.noreply.github.com>
Co-authored-by: DDT <1786035110@qq.com>
2026-11-06 12:56:05 -08:00
mateo-berri
534aeb2d88 fix(bedrock): treat an empty api_base or runtime endpoint as unset
Backport to lts/1.108.x ahead of its main PR.
Cherry-picked from 9bcb039ac2 (litellm_fix_bedrock_empty_api_base).
2026-11-06 12:29:32 -08:00
Yuneng Jiang
e716a2c6cc
Merge branch 'lts/1.108.x' into litellm_backport_translation_p0_lts_1_108_x 2026-11-06 11:08:42 -08:00
mrinal-berri
73e9ac9304
Merge pull request #50267 from BerriAI/litellm_backport_49957_lts_1_108_x
fix(responses): backport json_object system prompt in input to lts/1.108.x (#49957)
2026-11-06 10:19:57 -08:00
Mateo Wang
58d96d3f1e
Merge pull request #50348 from BerriAI/litellm_backport_48931_lts_1_108_x
fix(mcp): backport #48931 to lts/1.108.x
2026-11-06 10:08:26 -08:00
Mateo Wang
be09d658fa
Merge pull request #50392 from BerriAI/litellm_backport_50255_lts_1_108_x
fix(vertex_ai): backport #50255 to lts/1.108.x
2026-11-06 09:33:56 -08:00
Mateo Wang
9155cd224b
Merge pull request #50360 from BerriAI/litellm_backport_bedrock_converse_service_tier_lts_1_108_x
fix(bedrock): backport Converse service_tier fix to lts/1.108.x
2026-11-06 09:33:36 -08:00
Mateo Wang
7ab17dfc53
Merge pull request #50362 from BerriAI/litellm_backport_43086_lts_1_108_x
fix(bedrock): backport #43086 to lts/1.108.x
2026-11-06 09:33:27 -08:00
Kerry Lu
612587a91d
Merge pull request #50326 from BerriAI/litellm_backport_1108_2_fixes_lts_1_108_x
fix(backport): bring #50132, #50218, #50274 and #50276 onto lts/1.108.x
2026-11-06 08:56:25 -08:00