Commit graph

94 commits

Author SHA1 Message Date
yuneng-jiang
4f93e2c3da
test: point CircleCI-only suites at models still in the cost map (#42617)
* test: point CircleCI-only suites at models still in the cost map

#42435 removed cost map entries past their deprecation date and #42437 added
litellm_uisettings to the config-synced tables, but both only updated
tests/test_litellm. The CircleCI-only suites (local_testing, llm_translation,
logging_callback_tests, litellm_utils_tests, unit) kept using the removed
models or the old table list and went red on main.

Each test keeps its assertions and swaps the removed model for a current one
with the same provider and capabilities. The fireworks tests pick a vision
model from the cost map because #34941 set supports_vision false on
minimax-m3, and the vertex image provider test injects the image model set
because #42435 removed every vertex_ai-image-models entry.

* test(vertex_ai): register the image model through add_known_models in the provider test
2026-09-22 17:28:34 -07:00
devin-ai-integration[bot]
075536eca1
chore(cost-map): remove models past their deprecation date (#42435)
* chore(cost-map): remove models past their deprecation date

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

* test(cost-calc): drop the empty parametrize left behind by the gemini web search removal

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

* fix(cost-map): drop merge base block left by conflict resolution

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

* test(cost-calc): drop gemini image cost tests pinned on removed model

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>
2026-09-22 21:19:26 +00:00
devin-ai-integration[bot]
4b65ef6d64
test(response_metadata): make the detailed-timing receive-anchor test timezone independent (#42429)
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-09-22 10:49:37 -07:00
Mateo Wang
deba473821
fix(cost): bill batch prompts above 272K at OpenAI's long-context batch tier (#39861)
* fix(cost): bill batch prompts above 272K at OpenAI's long-context batch tier

* fix(cost): mirror batch long-context keys on custom pricing params

Register the two *_above_272k_tokens_batches keys on CustomPricingLiteLLMParams so a per-deployment override stays out of the shared backend key, add them to the inline model-info schema and alias-count tests, and build LiteLLM_Params and GenericLiteLLMParams through model_validate at the two dict-splat call sites so basedpyright's reportArgumentType budget ratchets down instead of blocking the new fields.

* fix(cost): add the gpt-5.5-pro batch long-context tier and ignore malformed batch tier keys

* fix(cost): bill cached batch tokens at OpenAI's cached batch rate

Adds cache_read_input_token_cost_batches and
cache_read_input_token_cost_above_272k_tokens_batches for the tiered
OpenAI entries at half the standard cached rate, bills cached batch
tokens at that rate per output line, and parses string-valued batch
rates in deployment-level model_info.

* fix(cost): bill batch cache writes at the batch cache-write rate and carry published batch rates for one-sided deployments

OpenAI's Batch table prices cache writes for gpt-6-astra, gpt-5.6, gpt-5.6-sol, gpt-5.6-terra and gpt-5.6-luna at half the standard cache-write rate, so the cost map gains cache_creation_input_token_cost_batches and its above_272k tier for those entries and batch cost pulls written tokens out of the input bucket at that rate; models without the key keep billing writes at the batch input rate.

A deployment declaring only one side of its batch pricing now carries every published batch rate of the other side (tier, cached, cache write), its own keys win, and a lone tier, cached or cache-write batch key counts as declared pricing instead of being ignored.

* fix(cost): select the batch long-context tier from any batch tier key

A deployment that declares its own flat standard input rate keeps every
published batch rate of the output direction, including the 272K output
tier, but the tier was only ever selected when an input tier key was also
present. Detect the crossed tier from any of the four batch tier keys so
the carried output, cache-read, and cache-write tiers bill at their tier
rate above 272K tokens.

* chore(proxy): keep the OpenAPI snapshot as CI generates it

* fix(cost): pick each batch price component's tier from its own keys

The batch rate picker crossed one threshold for every component, so a
deployment declaring only an output tier also moved its input, cached, and
cache-write rates to that cutoff. Each component now crosses its own
*_above_<N>k_tokens_batches keys and falls back to its flat key.

The JSON schema is regenerated with the generator as it is on main:
cost-map-guard renders the PR's cost map with the base branch's generator,
so the descriptions for the new batch cache keys move to a follow-up.

* chore(proxy): restore the lazy OpenAPI snapshot to what CI's Python 3.12 generates

The merge commit carried a snapshot regenerated on a Python 3.14 venv, which dedents
docstrings at compile time, so one description line differed from the file CI regenerates
on 3.12 and the schema.d.ts sync check went red. The snapshot is byte-identical to main again
2026-09-22 10:22:41 -07:00
devin-ai-integration[bot]
691c0d6596
test(unit): make bedrock collector and secret scan timing tests deterministic (#42405)
* test(unit): make bedrock collector and secret scan timing tests deterministic

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

* test(unit): count interpreter calls instead of wall clock in the secret scan scaling test

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

* test(unit): profile the secret scan with cProfile, restore the outer profiler and tighten the scaling bound

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>
2026-09-22 09:30:28 -07:00
devin-ai-integration[bot]
8603d6e259
fix(cost): honor per-second custom pricing on chat completions for every provider (#42403)
* fix(cost): honor per-second custom pricing on chat completions for every provider

* test(cost): assert a per-second priced deployment bills instead of staying at $0

The zero-cost diagnostic tests from #42345 used a per-second-only entry as their
misconfigured fixture, which this branch now bills. Switch that fixture to a
per-query-only entry, which is still selected as the deployment's own pricing and
still prices chat usage at $0, and add a per-second test asserting the call
duration is billed with no diagnostic

Also let a caller's explicit total_time outrank the logging window in
completion_cost, so the SDK precedence stays stamped response, caller, logging

* test(response_metadata): move the per-second pricing regression into the mapped tests/unit file

* fix(cost_calculator): keep media-mode per-second rates off the wall-clock path

A video, transcription, speech, or realtime entry's per-second rates price media seconds, which
their dedicated cost paths bill from the media itself. The generic per-second branch now skips
those modes, so a video status poll on a per-second video model bills nothing instead of the
seconds the poll took to answer.

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-09-21 22:15:35 -07:00
devin-ai-integration[bot]
3106d9c573
feat(rust-bridge): add cache and secret migration foundations (#42328)
* docs(rust): plan Python interop foundation

* fix(rust): preserve Python settings coercion at the native boundary

* chore(rust): drop interop planning note

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

* feat(rust): resolve OCR provider secrets through an async SecretSource before transformation

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

* feat(rust): project the Python secret manager into the bridge and resolve OCR secrets through it

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

* refactor(rust): drop premium_user from the secret manager snapshot

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

* fix(rust-bridge): read the private key management globals once in the settings snapshot

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

* fix(rust): bound the bridge secret manager state cache to the active snapshot

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

* test(rust): inline coercion unit tests

* fix(rust): preserve Python secret manager bindings

* refactor(rust-bridge): let settings projectors own their contract specs

Each settings group now declares its SettingSpec rows next to the projector
that reads them, and the manifest test derives python_settings.json from those
tables instead of a hand-copied duplicate. Field carries (group, name) instead
of a dotted path, and coercion gains the dict-item reader plus the Redis
Boolean, certificate-requirement, non-empty string, and numeric adapters that
the cache configuration projection adopts next.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* refactor(rust-bridge): capture the secret manager binding in one settings read

The secret_manager accessor now carries the live client and settings objects,
so the bridge classifies the binding from a single snapshot instead of
re-reading litellm globals. The unreachable native arm and the service alias
go away, the binding-to-state mapping moves next to the snapshot, and the
Python callback precomputes its key_manager name.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* refactor(rust-bridge): execute typed settings field declarations

* refactor(rust-bridge): compare cache backends by identity behind one exact trait

cache-response gains an object-safe ExactResponseCache so every exact-match
backend sits behind one pointer; WriteBuffer flushes through it. The bridge's
NativeResponseCache shrinks from nine variants and fifteen per-backend
accessors to an exact service plus the three semantic backends, and facade
mismatch detection compares BackendIdentity values instead of matching on
each backend type. Request projections move next to NativeRequest.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* refactor(rust-bridge): drive both Python-embedded semantic caches through one execution

Redis-semantic and Valkey-semantic operations now share one SemanticExecution
body: await the Python embedder, seed the task-local vector, run the native
backend, repeat per batch entry. Valkey drops its with_embedder path in favor
of the same seeded embedder, and each backend keeps its own embedding-failure
policy. PythonEmbedder exposes one call shape. Redis-semantic thresholds are
compared at the backend's f32 width, which un-breaks the redis-stack parity
tests that a 0.8 facade threshold failed before this branch.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* wip

* feat(rust-bridge): complete response cache runtime surface

* fix(rust-bridge): preserve secret manager callback exceptions

* refactor(rust-bridge): unify route cache and secret rollout catalog

---------

Co-authored-by: Yujong Lee <yujong@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-22 03:41:04 +00:00
devin-ai-integration[bot]
5dc6261ebb
fix(bedrock): sign batch S3 requests with s3_access_key_id and s3_secret_access_key (#42342)
* fix(bedrock): sign batch S3 requests with s3_access_key_id and s3_secret_access_key

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

* test(bedrock): keep S3 signer test additions scoped to new cases

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

* test(bedrock): drop e2e suite changes from the S3 signing fix

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

* fix(bedrock): build S3 credentials directly from the s3_* pair so ambient AWS_* env never mixes in

Restores the split-identity e2e coverage

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

---------

Co-authored-by: yucheng <yucheng@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 19:01:18 -07:00
ryan
baee50546f chore: merge main into litellm_cherry_pick_password_breach_reset
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 19:54:40 +00:00
Mateo Wang
e8d97d381a
Merge pull request #42080 from BerriAI/litellm_prompt_caching_affinity_lookback
fix(router): keep prompt caching affinity when the breakpoint moves
2026-09-21 12:44:34 -07:00
Mateo Wang
0e7cf5113e
Merge pull request #42069 from BerriAI/litellm_redacted_thinking_prompt_caching_pin
fix(token_counter): count replayed redacted_thinking blocks so prompt_caching keeps pinning
2026-09-21 12:35:14 -07:00
Mateo Wang
9a90adad32
Merge pull request #42275 from BerriAI/litellm_claude_platform_messages_beta_passthrough
fix(bedrock): forward anthropic-beta headers verbatim on the Claude platform messages path
2026-09-21 12:01:39 -07:00
mateo-berri
5ea4fe620f test(router): give each prompt caching check test a fresh callback registry 2026-09-21 11:55:58 -07:00
mateo-berri
f549c87091 Merge branch 'main' into litellm_prompt_caching_affinity_lookback 2026-09-21 11:55:40 -07:00
ryan
3fe405a5cc feat(auth): breached password detection, self-service change-password and forced password reset
Cherry-pick of merge commit b3882d8e43 (PRs #39321, #39562, #40107), which landed on litellm_internal_staging instead of main.

Co-authored-by: ojensen-berri <ojensen@berri.ai>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 18:48:35 +00:00
mateo-berri
e51ccbc759 fix(bedrock): forward anthropic-beta headers verbatim on the Claude platform messages path 2026-09-21 11:39:26 -07:00
Moe Khalil
83ec5d6101 fix(auto-router): skip JEV for encrypted delegated tasks
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 18:29:21 +00:00
mateo-berri
79d1af9d3c chore: merge origin/main to pick up the pre-call check test move 2026-09-21 11:28:04 -07:00
Moe Khalil
bb46e8b774 chore(auto-router): merge main and preserve JEV configuration
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 17:16:18 +00:00
yuneng
58729ac69f test(a2a): sort imports in merged bedrock agentcore test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-21 16:10:40 +00:00
yuneng
46383eec3c Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p17 2026-09-21 16:09:42 +00:00
yuneng
a220fb7d30 test(a2a): migrate a2a_protocol legacy tests to tests/unit
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 19:23:52 +00:00
yuneng-jiang
7c4b805ca0
Merge pull request #42145 from BerriAI/litellm_migrate_tests_p13
test: migrate legacy provider tests to tests/unit (wave 2, phase 13)
2026-09-20 10:50:18 -07:00
Moe Khalil
f9dc57a844 fix(auto-router): isolate JEV verdicts from logging failures
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
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 17:46:15 +00:00
yuneng
8554d1f827 test: prepare reference input before tracing path-sourced peak
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 17:08:16 +00:00
yuneng
e3911c71f7 test: make path-sourced streaming peak test differential
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 16:24:36 +00:00
yuneng
5ddf6ff396 test: restore pagination limit tests and realtime query param regression test
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 14:53:26 +00:00
Moe Khalil
8505d10017 chore(auto-router): merge main into JEV launch branch
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 14:53:05 +00:00
yuneng-jiang
0f7d4dc13b
Merge pull request #42136 from BerriAI/litellm_migrate_tests_p15
test: migrate phase 15 legacy tests to tests/unit
2026-09-20 07:49:31 -07:00
yuneng-jiang
e0c7a4b19e
Merge pull request #42137 from BerriAI/litellm_migrate_tests_p12
test: migrate phase 12 legacy llm provider tests to tests/unit
2026-09-20 07:49:20 -07:00
yuneng-jiang
317f7cb69a
Merge pull request #42123 from BerriAI/litellm_migrate_tests_p1
test: migrate wave 1 phase 1 legacy tests to tests/unit
2026-09-20 07:49:08 -07:00
yuneng
a5033fff6e test: define local_model_cost_map fixture for migrated context caching tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 14:20:04 +00:00
yuneng
e1556ce32b test: migrate legacy provider tests to tests/unit (wave 2, phase 13)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 14:18:49 +00:00
yuneng
d086f8574d test: add sync and async custom_llm_provider bridge propagation tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 13:46:52 +00:00
yuneng
30f3075010 test: use main's local_model_cost_map fixture in tests/unit/conftest.py
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 13:44:30 +00:00
yuneng
27dc080502 Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p15 2026-09-20 13:44:24 +00:00
yuneng
69133cc8cf Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p12 2026-09-20 13:44:19 +00:00
yuneng-jiang
8795d5f847
Merge pull request #42131 from BerriAI/litellm_migrate_tests_p16
test: migrate phase 16 legacy tests to tests/unit
2026-09-20 06:43:45 -07:00
yuneng-jiang
ec93936668
Merge pull request #42132 from BerriAI/litellm_migrate_tests_p14
test: migrate phase 14 wave 2 provider tests to tests/unit
2026-09-20 06:43:34 -07:00
yuneng-jiang
e5b2cabae5
Merge pull request #42128 from BerriAI/litellm_migrate_tests_p11
test: migrate openai, openai_like and openrouter legacy tests to tests/unit
2026-09-20 06:43:22 -07:00
yuneng
4fb1a3e610 test: add __init__.py to intermediate tests/unit packages
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 12:55:27 +00:00
yuneng
1ca0a662f0 Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p11 2026-09-20 12:55:05 +00:00
yuneng
affd2d0c30 merge: bring main (unit package markers) into litellm_migrate_tests_p3 2026-09-20 12:55:05 +00:00
yuneng
0237e69929 Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p16 2026-09-20 12:55:02 +00:00
yuneng
a7a790d10c Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p15 2026-09-20 12:55:00 +00:00
yuneng
432cf517ce Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p14 2026-09-20 12:54:59 +00:00
yuneng
ad0511ab64 Merge remote-tracking branch 'origin/main' into litellm_migrate_tests_p12 2026-09-20 12:54:55 +00:00
yuneng
b2ae0151e7 chore: merge main into litellm_migrate_tests_p1 2026-09-20 12:54:53 +00:00
yuneng
cd07acbdea test: add __init__.py to intermediate phase 12 unit test directories
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 12:37:21 +00:00
yuneng
42dd6a1300 test: add __init__.py to phase 12 unit test directories
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-20 12:36:15 +00:00