Commit graph

51754 commits

Author SHA1 Message Date
yucheng-berri
5ae41bfb32 fix(cost_calculator): stop copying optional_params into response hidden params (#43637)
* fix(cost_calculator): stop copying optional_params into response hidden params

* test(cost_calculator): assert the stored spend-log request and logging payload carry no forwarded credentials

(cherry picked from commit e5c74cb2a6)
2026-10-20 18:05:13 -07:00
Joshua Valluru
c4b8aae4f3 test(bedrock): isolate native capability fixtures from mirrored metadata 2026-10-20 17:55:27 -07:00
Joshua Valluru
961ed33100 fix(bedrock): adapt structured output verification to the 1.103 harness 2026-10-20 17:54:28 -07:00
Joshua Valluru
4268f0e10c fix(bedrock): adapt release imports and integration helpers 2026-10-20 17:49:38 -07:00
Joshua Valluru
0c61613801 fix(bedrock): preserve deployment isolation on older release interfaces 2026-10-20 17:49:24 -07:00
Joshua Valluru
c335e81186 fix(bedrock): adapt native output backports to release interfaces 2026-10-20 17:49:15 -07:00
Mateo Wang
857b6bdc7d fix(bedrock): send native structured output first on Opus 4.8 and Sonnet 5 and fall back to the json tool when Bedrock rejects it (#47100)
* fix(bedrock): send native structured output first on Opus 4.8 and Sonnet 5 and fall back to the json tool when Bedrock rejects it

* fix(bedrock): retry with the json tool when Bedrock refuses the native output schema

Count a 400 under output_config.format.schema: as a native output rejection, so a schema Bedrock cannot compile (like a pattern with a nested {n,m} group) gets the json tool retry instead of reaching the caller

* fix(bedrock): make the native output retry send what an opted-out deployment sends

The retry after a native output rejection now reruns the same optional param
mapping completion() ran, with the deployment model_info opted out of
supports_bedrock_native_structured_output, so tool_choice, effort and the json
tool schema match an opted-out deployment instead of a hand-built tool. Each
config keeps only the predicate that decides when native output came from the
opt-in key.

Bedrock batch records for Anthropic models map with the opt-in turned off,
since a batch job has no retry. Models on supports_native_structured_output
keep native output in batch

* fix(bedrock): build the messages retry from the caller's request and keep other errors unchanged

* fix(bedrock): give sync converse stream errors the upstream body as text

* fix(bedrock): let a malformed caller outputConfig reach Bedrock instead of raising

A Converse json_schema request whose caller outputConfig failed litellm's
shape check raised a pydantic error before the request was sent, so the
caller got a 500 where the merge base passed Bedrock's 400 through. The
opt-in check now treats that outputConfig as carrying no native output.

Also opts the vertex wire test's pinned Opus 4.8 json tool deployment out of
native output, and extends the Bedrock native output integration tests.

* fix(bedrock): send a refused caller outputConfig once and give opt-out advice only when native output is unsupported

A caller can send its own outputConfig on Converse. When Bedrock refused that
schema on an opt-in deployment, the retry still carried the caller's textFormat,
so Bedrock got the same request twice and the warning told the operator to turn
off an opt-in that was not the cause. The retry is now skipped when the opted-out
request would still carry a native textFormat, so Bedrock's 400 reaches the
caller after one call as on the merge base. The opt-out advice is logged only for
the account-level "Extra inputs are not permitted" rejection.

* fix(bedrock): keep the caller's continuation message on the native output retry

The Converse transform pops user_continue_message from litellm_params on the first attempt, so a retry built from those params afterwards dropped it. Both Bedrock chat routes now hand the fallback a copy taken before the first attempt.

* test(bedrock): pin additional_drop_params on the /v1/messages native output retry

* fix(bedrock): give the Converse native output retry the fake stream timeout
2026-10-20 17:48:53 -07:00
Mateo Wang
8e721385e5 fix(bedrock): use native structured output on Haiku 5.5 and Sonnet 5.5, and fix Fable 5 and Sonnet 4.6 schema 400s (#46870)
* fix(bedrock): use native structured output on every Claude model whose Bedrock profiles accept it

Bedrock accepts outputConfig structured output on every reachable profile of
Claude Opus 4.7, 4.8, 5, 5.5, Sonnet 5, 5.5, Haiku 5.5, and Fable 5.1, so
json_schema now goes out natively there instead of as a forced tool, which kept
Bedrock from returning adaptive thinking. Fable 5 rejects outputConfig, so its
keys go back to the tool path. GovCloud keys keep their flags, and the drift
tests let GovCloud lag its commercial base but never lead it.

* fix(bedrock): clean Claude schemas for native structured output and keep recursive schemas on the old path

Bedrock native output rejects minimum/maximum, minItems, uniqueItems, oneOf,
additionalProperties true, and recursive or unresolved $ref, all of which the
forced tool accepted. Claude schemas on the Bedrock native paths now go through
the cleaner the Anthropic native path already uses, and a schema with a
recursive or unresolved $ref keeps the forced tool, inline, or drop path it had.

* fix(bedrock): keep older installs on the json tool with a Bedrock-only native output key

Older installs fetch the model map from main, so flipping supports_native_structured_output
moved them onto native output with their old schema handling. The new
supports_bedrock_native_structured_output key is ignored by older code. Schemas native output
cannot hold (recursive refs, open objects such as dict fields) keep the json tool on the new
key, models on the old key keep their current behavior for those shapes, and the Anthropic
API, Vertex AI, and Azure keep their current behavior.

* chore(cost-map): regenerate the model prices schema for the Bedrock native output key

* fix(bedrock): keep native output to profiles every account accepts and route schemas Bedrock rejects to the json tool

Only Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.1 keep the Bedrock native output key, since
Opus 4.8 and Sonnet 5 answer 400 on some accounts and Opus 5 garbles escaped characters.
Lookaround patterns and string formats outside Bedrock's list now keep the json tool, objects
typed as a union with null are closed, and the cleaner keeps minItems of 0 or 1.

* fix(bedrock): keep Opus 5.5 and Fable 5.1 on the json tool, since native output stops their adaptive thinking

* fix(bedrock): keep shared $defs in native schemas and send refused schemas to the json tool on every native model

Native output now keeps $defs instead of inlining each use, so a submodel reused across a schema counts once against Bedrock's optional and union limits. Schemas native output cannot hold use the json tool on Converse and Invoke chat for both native keys, and minItems is only kept when it is an integer 0 or 1

* fix(bedrock): keep the json tool unless thinking is requested and bound native output schemas

The Bedrock native output key now applies only when the call asks for thinking, so calls without
thinking keep the json tool as before. Schemas past Bedrock's documented union and optional counts,
or past a grammar size estimate fitted to live probes, keep the json tool on both map keys. Open
objects keep the json tool on the Anthropic API, Vertex AI and Azure AI, where native output returned
them empty. The $ref check no longer expands $defs, so doubling definitions no longer stall the request.

* fix(bedrock): resolve root-path $defs refs so nested Pydantic models keep native output on Invoke

* test(bedrock): cover native structured output and json tool routing through the proxy

Integration cells drive the proxy against a scripted Bedrock peer that enforces Bedrock's structured output schema rules, covering thinking with native output on Converse, Converse streaming, Invoke, /v1/responses and /v1/messages, the deployment opt-in, Fable 5, schema cleaning on every native entry, open objects, and malformed schemas. Vertex, Anthropic and Azure AI cells cover open objects on native-capable models and the cleaner's minItems and nullable object handling. The unit table now covers reasoning_effort none and disabled thinking

* fix(bedrock): keep native output for numeric formats and wide old-key schemas, and keep thinking in json mode

Check string formats only on nodes that can be strings, apply the 64-field cap only to the Bedrock-only key, carry thinking blocks into the json mode message, and send malformed json tool schemas as object schemas.

* fix(anthropic): keep native output for dict fields unless the json tool can be forced

* fix(anthropic): keep native output for dict fields when the caller sends tools

* test(bedrock): close the dangerous-tool-use test schema, since Bedrock native output requires closed objects

* test(anthropic): cover forced and unforced open-object routing, json mode thinking, numeric formats and wide schemas

Add proxy cells for open-object schemas that keep native output when the json tool cannot be forced (a model that refuses forced tools on the Anthropic API and Vertex AI, thinking, caller tools), for the thinking block a json mode answer keeps on Vertex AI and Bedrock Invoke, and for integer and number formats and 65-field schemas on each Bedrock map key. Point the forced open-object cells at the Anthropic API and Azure AI only, since no Vertex AI model in the cost map takes both native output and a forced tool

* fix(bedrock): keep the native output opt-in on the deployment that sets it, and route effort none open objects to native output

* test(bedrock): cover deployment-scoped native output opt-in, register_model and effort none open objects
2026-10-20 17:48:02 -07:00
Joshua Valluru
2ec53c0b8f fix(deps): retain the configured three-day release window 2026-10-20 17:08:22 -07:00
Joshua Valluru
60eb7fedf3 test(cost): retarget pricing fixtures after the main map mirror 2026-10-20 16:41:21 -07:00
Joshua Valluru
6a2253d458 test(mcp): register limit cases and discover configured tools 2026-10-20 16:37:13 -07:00
Joshua Valluru
e579750ad4 fix(deps): match main serde_with security version 2026-10-20 16:32:49 -07:00
Joshua Valluru
2bce4fc21f fix(deps): match main Next.js and sharp security versions 2026-10-20 16:31:21 -07:00
Joshua Valluru
80073e7dc7 test(mcp): distinguish call parameters in the SSE regression 2026-10-20 16:28:33 -07:00
Joshua Valluru
8962804ca6 fix(deps): align vulnerable Python packages with main 2026-10-20 16:08:25 -07:00
Joshua Valluru
5d70d0375e test(mcp): cover configured SSE limits in the legacy harness 2026-10-20 16:08:04 -07:00
Joshua Valluru
1e69fb070f chore(cost-map): mirror main at 4aec80f5ee 2026-10-20 16:05:54 -07:00
Joshua Valluru
32c77e6fe3 fix(mcp): validate backported SSE event limits 2026-10-20 16:05:54 -07:00
Joshua Valluru
6fa74f8296 Merge remote-tracking branch 'origin/stable/1.103.x' into litellm_backport_mcp_sse_1_103 2026-10-20 16:03:49 -07:00
yuneng-jiang
dce7feb75c
Merge pull request #47522 from BerriAI/patch_f62f7f90
Some checks are pending
LiteLLM Rust / rust-lint (push) Waiting to run
LiteLLM Rust / rust-test (push) Waiting to run
LiteLLM Rust / rust-wheel (push) Waiting to run
chore(release): v1.103.6 patch
2026-10-20 09:10:17 -07:00
Yuneng Jiang
fe02b14e96
chore: bump litellm 1.103.5 -> 1.103.6
litellm 1.103.5 already shipped, so the next release off this line is 1.103.6
2026-10-20 01:06:21 -07:00
Hektor Jacynycz Garcia
cd788ce1aa
fix(logging): log spend once for large non-streaming requests on the chat to Responses bridge (#44508)
* fix(logging): claim the async success dedup flag before the first await

Nested @client wrappers on the chat -> Responses bridge schedule two async
success tasks on one logging object. The dedup flag was checked at the top
of _async_success_handler_body but only set after several awaits; the
worker-thread base64 offload for messages >= 256 KiB yields there, so the
second task passed the same check and the request was logged twice
(two SpendLogs rows, key/team/daily spend counted twice).

Fixes #44500

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(logging): serialise async success handlers per logging object instead of claiming early

Claiming the dedup flag before the first await (previous commit) let a first
handler that is cancelled before its callbacks run (e.g. by the logging
worker's per-coroutine timeout) suppress the second one, losing the request's
success accounting. Serialise non-streaming handlers on the same Logging
object with an asyncio.Lock kept in a module-level WeakKeyDictionary: the
second handler waits, then skips if the first logged, or logs itself if the
first raised or was cancelled first. Streaming chunk logging is not locked.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* test(integration): pin one spend row and one key charge for large bridged chat completions

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(integration): wait for the large request's spend row before asserting

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(logging): use fixed timestamps in async success dedup tests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* style(logging): trim the async success dedup lock comment

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(logging): reset background interaction dedupe under the success dedup lock

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(logging): use a fixed start time in the interactions logging helper

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix: claim the async success log at schedule time instead of locking the handler

Nested @client wrappers (chat over the Responses bridge, Anthropic Messages over the chat adapter) exit with one shared Logging object and each queued their own async success handler. The handler checked has_logged_async_success before its awaited work and set it after, so both could pass the check and the request was logged and billed twice.

_schedule_async_success_logging now claims the log on the Logging object synchronously through claim_async_success_log, and a later wrapper returns without enqueuing. There is no await between the check and the decision, so no lock is needed. The per-object asyncio.Lock, the WeakKeyDictionary that held it and the locked block in async_log_background_interaction_completion are gone.

Tests: the regression test moves to tests/unit/test_utils.py and drives two _dispatch_success_logging exits with one Logging object through the logging worker, asserting one log with the inner result. It fails without the claim. The cancelled-handler test is dropped since a second wrapper no longer retries. The background interaction completion test stays.
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(logging): pin the background completion event order and name the innermost wrapper in the claim docstrings

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(integration): send one bridged request and assert the inner Responses result is the logged one

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: kerry <kerry@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 157d96dcd0)
2026-10-20 01:06:21 -07:00
devin-ai-integration[bot]
fb0f3b693a
test(realtime): drop legacy InvalidStatusCode tests and pin websockets imports (#42624)
The two redaction tests raised the deprecated InvalidStatusCode, which the
websockets 15 asyncio client never raises, and asserted the raw 403 close
code that the handshake refusal path replaced with 1008. The refusal path
builds its close reason from the status code alone, so there is no secret
to redact there, and the handshake refusal tests already cover the error
event and the 1008 close.

Those refusal tests only passed when run after a sibling test had imported
websockets.asyncio.client, since websockets lazy-loads its exceptions
submodule. Importing InvalidStatus, Response, and Headers from their own
submodules makes them pass in any order.

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
(cherry picked from commit 38f0eb876b)
2026-10-20 01:06:21 -07:00
devin-ai-integration[bot]
c66597f432
fix(realtime): surface an upstream handshake refusal as an error event and policy close (#42388)
* fix(realtime): surface an upstream handshake refusal as an error event and policy close

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* test(realtime): tidy the handshake refusal e2e

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(realtime): keep upstream exception text out of the Azure client error

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(realtime): map handshake refusal close codes with a lookup

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
(cherry picked from commit 2bab39e374)
2026-10-20 01:06:21 -07:00
Joshua Valluru
cbc4a0e50f test(mcp): use the legacy wire harness for large SSE results 2026-10-17 23:02:27 -07:00
Joshua Valluru
276778e680 test(mcp): register large SSE regression in 1.103 harness 2026-10-17 18:10:31 -07:00
Joshua Valluru
cac33fe1e2 fix(mcp): backport SSE event size fix to 1.103
Backport of #47034 (828c770857) for stable/1.103.x. Extend the existing protocol integration file because this line predates the transport test helpers
2026-10-17 17:42:43 -07:00
mrinal-berri
dec1691c90
Merge pull request #46949 from BerriAI/litellm_backport_responses_bridge_stable_1_103_x
Some checks failed
LiteLLM Rust / rust-test (push) Has been cancelled
LiteLLM Rust / rust-lint (push) Has been cancelled
LiteLLM Rust / rust-wheel (push) Has been cancelled
fix(responses): backport #46099 and #46109 to stable/1.103.x for v1.103.5
2026-10-16 20:50:39 -05:00
Mrinal Chanshetty
6ed7a3d042 bump: version 1.103.5 2026-10-16 13:41:01 -05:00
Mrinal Chanshetty
34996a0e1e test(integration): register the responses bridge fold contracts on stable/1.103.x
The line's integration conftest refuses any owned test missing from
contracts.json, so the backported #46099 and #46109 tests get covers marks
and manifest entries here; main has no manifest.
2026-10-16 13:39:11 -05:00
devin-ai-integration[bot]
fe622b8e0c fix(responses): number bridged chat tool calls 0, 1 and pin the remaining bridge shapes (#46109)
Backport of #46109 to stable/1.103.x.
Cherry-picked from b6df3d7fe5 (main).
Adapted to the line: unit tests live under tests/test_litellm/, and the
black-only reformat of the existing completion-responses tests is not carried.
2026-10-16 13:34:13 -05:00
devin-ai-integration[bot]
a70f1310ad fix(responses): fold bridged Responses output into one chat choice (#46099)
Backport of #46099 to stable/1.103.x.
Cherry-picked from 4b7b8efd4c (main).
Adapted to the line: unit test lives under tests/test_litellm/, and only this
PR's own tests are carried into the integration file.
2026-10-16 13:34:12 -05:00
devin-ai-integration[bot]
69ff376019 test(integration): add list_value helper
Prerequisite for the backport of #46099 to stable/1.103.x: its integration
tests import list_value, which reached main in #43981.
Hand-ported from 43f07d0bd8 (main).
2026-10-16 13:33:44 -05:00
yuneng-jiang
65e36b0298
Merge pull request #45011 from BerriAI/litellm_pgb_bump_1103
chore(docker): bump pgbouncer to 1.26.0
2026-10-07 10:32:50 -07:00
yuneng
497a3b406b chore(docker): bump pgbouncer to 1.26.0 2026-10-07 06:53:40 +00:00
yuneng-jiang
68b1fe1b66
Merge pull request #44776 from BerriAI/litellm_chore_8a10a6
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
chore(release): refresh dependencies on stable/1.103.x and cut 1.103.4
2026-10-05 22:27:42 -07:00
Yuneng Jiang
0e6c47f8d1
chore: refresh uv.lock for 1.103.4 2026-10-05 18:54:46 -07:00
Yuneng Jiang
d040262bf8
bump: version 1.103.3 → 1.103.4 2026-10-05 18:54:27 -07:00
Yuneng Jiang
dc36db371c
chore(deps): bump source-map-js in the vscode-extension lockfile 2026-10-05 18:52:52 -07:00
Yuneng Jiang
7679ae853f
chore(deps): bump source-map-js and smol-toml in the dashboard lockfile 2026-10-05 18:52:52 -07:00
Yuneng Jiang
0c1ed2e155
chore(deps): bump next, moment and brace-expansion in the dashboard 2026-10-05 18:52:51 -07:00
Yuneng Jiang
eb91e815c0
chore(deps): bump werkzeug to 3.1.9 2026-10-05 18:51:41 -07:00
Yuneng Jiang
9bfde413b3
chore(deps): bump multidict to 6.9.1 2026-10-05 18:51:40 -07:00
Yuneng Jiang
1f388e5221
chore(deps): bump mako to 1.4.2 2026-10-05 18:51:40 -07:00
Yuneng Jiang
0cc25f2f18
chore(deps): bump langgraph-sdk to 0.4.4 2026-10-05 18:51:39 -07:00
Yuneng Jiang
6db4026e27
chore(deps): bump oauthlib to 4.0.0 2026-10-05 18:51:39 -07:00
Yuneng Jiang
41017f478d
chore(deps): bump fsspec to 2026.6.0 2026-10-05 18:51:38 -07:00
yuneng-jiang
ecae261b10
Merge pull request #44437 from BerriAI/litellm_chore_bba82d
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
test(e2e): backport Together structured-output and text-completion fixes to stable/1.103.x
2026-10-03 14:11:07 -07:00
yuneng
ff6578183b test(e2e): align completion, SAIL, and spend-log fixtures with supported contracts (#43902)
Partial backport to stable/1.103.x: only the text completion endpoint test moves off the retired gpt-3.5-turbo-instruct to openai/gpt-5.4-nano with reasoning off. This line predates the OpenAI SDK rewrite of the test, so reasoning_effort goes through EndpointsClient.text_completions instead of extra_body. The SAIL, spend-log and coverage registry repairs are not needed for this line's e2e suite

(cherry picked from commit e61733b170)
2026-10-03 21:07:17 +00:00
yuneng
3896240d3b test(ci): repair stale tests and flaky CI infrastructure (#43983)
Partial backport to stable/1.103.x: only the Together AI structured-output e2e case moves to the hybrid reasoning backend with reasoning off, since the reasoning-only model it picked returned no content. The CI infrastructure and other test repairs are not needed for this line's e2e suite

(cherry picked from commit 6ca90b927c)
2026-10-03 21:07:17 +00:00