Commit graph

51747 commits

Author SHA1 Message Date
joshua-berri
32bfdeaf31 fix(batches): retry confirmed pre-accounting failures (#47625)
Backport of #47625 to stable/1.103.x.
Cherry-picked from 6564a490f4 (main).
Adapted to the line: the batch accounting retry (track_batch_accounting in proxy_track_cost_callback and its use in check_batch_cost) is ported, while this PR's router-budget charge-once changes in router_utils/batch_utils, budget_limiter and model_max_budget_limiter are left out, since they refactor charge-once code from main (8a33b37c39, 9acf09f60d) that is not on this line. The write-started mark keys on a budget reservation only, as the search free tier is not on this line. Tests use the line's _ProxyDBLogger, and the router-budget and search-allowance assertions are dropped.
2026-10-20 17:35:56 -07:00
joshua-berri
2f3d44b469 fix(batch): preserve recoverable costs and prevent poll starvation (#47190)
Backport of #47190 to stable/1.103.x.
Cherry-picked from 0ede0e10e7 (main).
Ported from the stable/1.104.x hand-port (3b7b5ab319). Carries the small typed table helpers that port relies on (_ManagedObjectRow protocol and the _managed_object_table/_user_table/_token_table/_team_table accessors, from the stable/1.104.x base). The poll-starvation integration test is dropped since its base and harness (#42622, integration/_support/prisma_clients) are not on this line. The 404-recovery unit test resets the litellm callback lists so a callback left by an earlier test cannot shadow it.
2026-10-20 16:43:54 -07:00
joshua-berri
8bbd2c0601 fix(batches): preserve spend across malformed output and metadata failures (#47184)
Backport of #47184 to stable/1.103.x.
Cherry-picked from 3fb95c8fe3 (main).
Ported from the stable/1.104.x hand-port (f7b0b09e75) onto this line's poller, which keeps LiteLLM_ManagedObjectTable and direct prisma table access. Brings the managed-files postgres_storable_json sanitizer from #45703 that this fix needs. Test files keep the line's content plus this PR's own cases.
2026-10-20 16:43:54 -07:00
Paul El Khoury
ab69d8489c fix(openai): drop unsupported reasoning effort for gpt-6.1-sol (#43935)
Backport of #43935 to stable/1.103.x.
Cherry-picked from d7620c77a1 (main).
Ported from the stable/1.104.x adaptation (54f9259b40): the bridge check lives in litellm/main.py and the effort helpers keep the line's private names. Cost-map edits replay only this PR's reasoning-effort flags (gpt-6-astra and gpt-5.3-codex rows), plus supports_none_reasoning_effort=false on the azure gpt-6.1-sol rows from #46377, which the fix's tests key on. Tests built on gpt-6-sol rows (#42515), the Foundry tools-to-Responses bridge, or a full azure/eu/gpt-6-astra row are dropped since none of those are on this line.
2026-10-20 16:43:54 -07:00
devin-ai-integration[bot]
de7a2cda10 chore(cost-map): add azure and openrouter gpt-6.1-sol rows (#43744)
Backport of #43744 to stable/1.103.x.
Cherry-picked from bda2763f2c (main).
Prerequisite for #43935: adds the azure and openrouter gpt-6.1-sol rows that fix corrects. Cost-map conflict resolved by appending the new entries.
2026-10-20 16:43:54 -07:00
berriai-litellm-provider-info-sync[bot]
e2072b7aa8 chore(cost-map): add openai gpt-6.1-sol from the pricing page (#43738)
Backport of #43738 to stable/1.103.x.
Cherry-picked from a3552c451b (main).
Prerequisite for #43935: adds the gpt-6.1-sol entry that fix corrects. Cost-map conflict resolved by appending the new entry.
The cost-map schema and its schema test also allow the *_above_272k_tokens_batches keys this row carries, which main already allows.
2026-10-20 16:43:54 -07:00
Kerry Lu
396b817738 fix(logging): report the cost-map entry billing used in model_map_information (#47182)
Backport of #47182 to stable/1.103.x.
Cherry-picked from 1212260ab1 (main).
Test-file conflict resolved by keeping the line's file and appending this PR's tests.
Calls the line's _select_model_name_for_cost_calc, which is the private name on this line.
2026-10-20 16:23:41 -07:00
joshua-berri
b10a4e6e1a fix(batches): handle empty models when logging batch cost (#47155)
Backport of #47155 to stable/1.103.x.
Cherry-picked from 4143e0869e (main).
2026-10-20 16:23:41 -07:00
Mrinal Chanshetty
5a3cfacab2 test(integration): add the vertex service-account helper the safeguards wire test imports
Backport prerequisite for #43955 on stable/1.103.x.
Copied from tests/integration/_support/vertex.py on main (added by #43900).
2026-10-20 16:23:41 -07:00
devin-ai-integration[bot]
29ea13d508 fix(anthropic): add the dangerous-tool-use beta when a /v1/messages request carries safeguards (#43955)
Backport of #43955 to stable/1.103.x.
Cherry-picked from eb5295b20c (main).
Adapted to the line: the transformation lives under anthropic/experimental_pass_through, the integration tests live under tests/integration/providers, and the CLI-beta wire assertion change is dropped since that test is not on the line.
The github_copilot safeguards test uses the line's authenticator mock, since per-user Copilot sessions are not on this line.
2026-10-20 16:23:41 -07:00
mrinal-berri
2369b3ce52 fix(databricks): send a single plain text block as a string for non-Claude models (#45686)
Backport of #45686 to stable/1.103.x.
Cherry-picked from 1aee1a21ed (main).
Adapted to the line: unit test ported into tests/test_litellm; the databricks wire-test additions and the bridge-flag test edit are dropped since neither base test is on this line.
2026-10-20 16:15:54 -07:00
mrinal-berri
88ecaa08d9 fix(databricks): keep #/$defs refs in json_schema response_format (#45659)
Backport of #45659 to stable/1.103.x.
Cherry-picked from fa7ad80a62 (main).
Adapted to the line: unit tests ported into tests/test_litellm; the databricks chat wire-test additions are dropped since that file is not on this line.
2026-10-20 16:15:54 -07:00
devin-ai-integration[bot]
f02a05fb32 fix(model_prices): consolidate claude-haiku-5-5 over-100k pricing and capability flags (#45151)
Backport of #45151 to stable/1.103.x.
Cherry-picked from 46d440ae96 (main).
Adapted to the line: the model-catalog Rust crate is not on this line so its two files are dropped; tests live under tests/test_litellm; conflicts resolved by keeping the line's fields plus the over-100k fields this PR adds.
Prerequisite from #39861 ported minimally: the standard above-threshold loop skips *_batches keys, so a non-batch request over 100k is not billed at the batch tier. The batch long-context tier tests are dropped since this line's batch cost path has no long-context tiers, and the runtime profile test calls the line's private _is_adaptive_thinking_model.
2026-10-20 16:15:54 -07:00
Krrish Dholakia
5944ba05f7 feat(model_prices): add claude-haiku-5-5 model pricing (#45108)
Backport of #45108 to stable/1.103.x.
Cherry-picked from 5cd1126870 (main).
Prerequisite for #45151: adds the claude-haiku-5-5 entries that fix corrects. Cost-map conflicts resolved by appending the new entries; schema test lives under tests/test_litellm on this line.
The cost-map schema and its schema test also allow cache_creation_input_token_cost_batches, cache_read_input_token_cost_batches and supports_anthropic_compaction, which these entries carry and main already allows.
2026-10-20 16:15:54 -07:00
devin-ai-integration[bot]
a963fc135f fix(responses): report truncated bridged output as incomplete and echo request params (#44460)
Backport of #44460 to stable/1.103.x.
Cherry-picked from f81a3f5243 (main).
Conflict: took main's terminal_event declaration over the line's completed_event comment form.
2026-10-20 15:50:12 -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
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
yuneng-jiang
8a7280ee1b
Merge pull request #44404 from BerriAI/litellm_chore_35b6b0
chore(release): backport #44341, #44346 to stable/1.103.x
2026-10-03 12:00:31 -07:00
devin-ai-integration[bot]
94d97b26f0
fix(responses): merge bridged tool calls into the same choice as the text (#44346)
* revert(responses): revert "fix(responses): keep gpt-5.4/5.5 tool calls on chat and merge bridged tool calls into one choice" (#44295)

This reverts commit ca1994e403.

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

* fix(responses): merge bridged tool calls into the same choice as the text

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.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 5724117116)
2026-10-03 11:20:16 -07:00
devin-ai-integration[bot]
dabf756927
fix(proxy): stamp the client alias on a copy of each streamed chunk so pricing sees the deployment model (#44341)
* fix(proxy): stamp the client alias on a copy of each streamed chunk so pricing sees the deployment model

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

* test(spend): streamed alias matching a capability rule bills the deployment price

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

* test(spend): assert every streamed chunk carries the client alias

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

* fix(logging): log the client alias on the priced streamed response, the same as non-streamed

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.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 7b432d78d2)
2026-10-03 11:20:16 -07:00
yuneng-jiang
b74a2496c1
Merge pull request #44352 from BerriAI/litellm_chore_db5a8b
chore(deps): bump pyjwt, pypdf, tornado, urllib3 and gitpython for stable/1.103.x
2026-10-03 00:17:34 -07:00
yuneng
008bacc53f chore(deps): bump pyjwt, pypdf, tornado, urllib3 and gitpython in uv.lock for advisories
Lock-only bumps inside the existing pyproject ranges, each already at or below the version
main resolves: pyjwt 2.13.0 -> 2.15.0, pypdf 6.16.2 -> 6.19.0, tornado 6.5.8 -> 6.5.9,
urllib3 2.7.0 -> 2.8.0, gitpython 3.1.61 -> 3.1.62
2026-10-03 07:12:16 +00:00
yuneng-jiang
121ce723f5
Merge pull request #44309 from BerriAI/litellm_chore_ff7ad3
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): backport #42643 to stable/1.103.x
2026-10-02 19:03:44 -07:00
yuneng-jiang
0893321abf
chore(docker): bump wolfi-base digest to pick up glibc 2.44-r6 (#42643)
The pinned base's /etc/apk/world locks glibc-2.44=2.44-r1, so the apk upgrade in the runtime stage cannot move it. The new digest ships 2.44-r6 on amd64 and arm64

(cherry picked from commit bc911abdbb)
2026-10-02 18:58:46 -07:00