Commit graph

8246 commits

Author SHA1 Message Date
Mark McDonald
75901ccbc6
fix: use x-gemini-service-tier header in response 2026-04-08 09:01:08 +05:30
Mark McDonald
7617d4e6db
chore: add a service_tier field mapping from openai to gemini 2026-04-08 09:01:08 +05:30
Mark McDonald
25b266fe2c
feat: support service_tier in gemini 2026-04-08 09:01:08 +05:30
Vasilisa Parshikova
00878a2be8
(sap) fix after bot review 2026-04-08 09:01:07 +05:30
Vasilisa Parshikova
ffeff446b4
(sap) fix after bot review 2026-04-08 09:01:07 +05:30
Vasilisa Parshikova
f3c1777b96
(sap) fix validate credentials, add negative tests for credential fetching 2026-04-08 09:01:07 +05:30
Vasilisa Parshikova
aabbe78a8a
(sap) fix validate credentials, add negative tests for credential fetching 2026-04-08 09:01:07 +05:30
Vasilisa Parshikova
a5df768e47
(sap) update test 2026-04-08 08:59:36 +05:30
Vasilisa Parshikova
5ec3f3e3dd
(sap) fix after bot review 2026-04-08 08:59:36 +05:30
Vasilisa Parshikova
1f0bdb10c1
(sap) fix after bot review 2026-04-08 08:59:36 +05:30
Vasilisa Parshikova
9b26087bca
(sap) fix after bot review 2026-04-08 08:59:36 +05:30
Vasilisa Parshikova
2723c69bfe
(sap) fix after bot review 2026-04-08 08:59:36 +05:30
Vasilisa Parshikova
476458311c
(sap) fix after bot review 2026-04-08 08:59:36 +05:30
Vasilisa Parshikova
7f5db2082c
(sap) fix after bot review 2026-04-08 08:59:36 +05:30
Vasilisa Parshikova
26bdc87f54
(sap) fix after bot review 2026-04-08 08:59:36 +05:30
Vasilisa Parshikova
85d9569ead
(sap) fix after review 2026-04-08 08:59:36 +05:30
Vasilisa Parshikova
70e64c572d
(sap) update logic of fetching creds, add additional tests 2026-04-08 08:58:46 +05:30
Vasilisa Parshikova
ff5ed4cc42
fix(sap): fix sap creds unit test 2026-04-08 08:58:46 +05:30
Vasilisa Parshikova
76292bc54e
fix(sap): change creds priority 2026-04-08 08:58:45 +05:30
Vasilisa Parshikova
a0994fe886
(sap) fix after bot review 2026-04-08 08:57:54 +05:30
Vasilisa Parshikova
58bea41d17
(sap) minor improve 2026-04-08 08:57:54 +05:30
Vasilisa Parshikova
6e8c993e08
(sap) commit for rerun bot review 2026-04-08 08:57:54 +05:30
Vasilisa Parshikova
9415f5864b
(sap) fix after bot review 2026-04-08 08:57:54 +05:30
Vasilisa Parshikova
8eb81b5202
(sap) fix after bot review 2026-04-08 08:57:53 +05:30
Vasilisa Parshikova
a099c2856d
(sap) add literals to models, add negative tests, fix test for tool transformation 2026-04-08 08:57:53 +05:30
Vasilisa Parshikova
6123651b30
(sap) fix after bot review 2026-04-08 08:57:53 +05:30
Vasilisa Parshikova
315f1755e8
(sap) fix after bot review 2026-04-08 08:57:53 +05:30
Vasilisa Parshikova
9bdf6e087f
(sap) fix after bot review 2026-04-08 08:57:53 +05:30
Vasilisa Parshikova
1bd5b6339f
(sap) fix after bot review 2026-04-08 08:57:53 +05:30
Vasilisa Parshikova
bde544cad7
(sap) fix after bot review 2026-04-08 08:57:53 +05:30
Vasilisa Parshikova
dc8e9d6438
(sap) fix after bot review 2026-04-08 08:57:53 +05:30
Vasilisa Parshikova
8f7018d83d
(sap) fix after bot review 2026-04-08 08:57:53 +05:30
Vasilisa Parshikova
834ed13534
(sap) Align embedding request transformation with current API 2026-04-08 08:57:53 +05:30
Vasilisa Parshikova
fe390e0b3c
(sap) update tests 2026-04-08 08:57:17 +05:30
Lin Xu
00adbca6c7
test(): add safeguard tests 2026-04-08 08:57:17 +05:30
Vasilisa Parshikova
78eb67a9d8
(sap) rename file 2026-04-08 08:57:17 +05:30
Vasilisa Parshikova
2ea74ecd9f
(sap) code refactoring 2026-04-08 08:57:13 +05:30
Vasilisa Parshikova
f7cfda452d
(sap) add tests and docs for new SAP modules 2026-04-08 08:56:38 +05:30
milan-berri
c6c8087488
fix(anthropic): pass logging_obj to client.post for litellm_overhead_time_ms (#24071)
When LITELLM_DETAILED_TIMING=true, litellm_overhead_time_ms was null for
Anthropic because the handler did not pass logging_obj to client.post(),
so track_llm_api_timing could not set llm_api_duration_ms. Pass
logging_obj=logging_obj at all four post() call sites (make_call,
make_sync_call, acompletion, completion). Add test to ensure make_call
passes logging_obj to client.post.

Made-with: Cursor
2026-04-08 08:55:34 +05:30
Josh
0033ac0b75
fix: 429s from batch creation being converted to 500 (#24703) 2026-04-08 08:53:42 +05:30
Josh
0f48f793ff
Feat - Add organization into the metrics metadata for org_id & org_alias (#24440)
* Add org_id and org_alias label names to Prometheus metric definitions

* Add user_api_key_org_alias to StandardLoggingUserAPIKeyMetadata

* Populate user_api_key_org_alias in pre-call metadata

* Pass org_id and org_alias into per-request Prometheus metric labels

* Add test for org labels on per-request Prometheus metrics

* chore: resolve test mockdata

* Address review: populate org_alias from DB view, add feature flag, use .get() for org metadata

* Add org labels to failure path and verify flag behavior in test

* Fix test: build flag-off enum_values without org fields

* Gate org labels behind feature flag in get_labels() instead of static metric lists

* Scope org label injection to metrics that carry team context, remove orphaned budget label defs, add test teardown

* Use explicit metric allowlist for org label injection instead of team heuristic

* Fix duplicate org label guard, move _org_label_metrics to class constant

* Reset custom_prometheus_metadata_labels after duplicate label assertion

* fix: emit org labels by default, remove flag, fix missing org_alias in all metadata paths

* fix: emit org labels by default, no opt-in flag required

* fix: write org_alias to metadata unconditionally in proxy_server.py
2026-04-08 08:53:41 +05:30
Josh
0873145727
feat(logging): add component and logger fields to JSON logs for 3rd p… (#24447)
* feat(logging): add component and logger fields to JSON logs for 3rd party filtering

* Let user-supplied extra fields win over auto-generated component/logger, tighten test assertions
2026-04-08 08:53:41 +05:30
michelligabriele
dbbc57ec63
fix(vertex_ai): support pluggable (executable) credential_source for WIF auth (#24700)
The WIF credential dispatch in load_auth() only handled identity_pool and
aws credential types. When credential_source.executable was present (used
for Azure Managed Identity via Workload Identity Federation), it fell
through to identity_pool.Credentials which rejected it with MalformedError.

Add dispatch to google.auth.pluggable.Credentials for executable-type
credential sources, following the same pattern as the existing identity_pool
and aws helpers.

Fixes authentication for Azure Container Apps → GCP Vertex AI via WIF
with executable credential sources.
2026-04-08 08:53:41 +05:30
milan-berri
bf8b615b64
fix(auth): support selective jwt override oauth2 routing (#25252)
Allow JWT tokens matching routing_overrides to use OAuth2 introspection without enabling global OAuth2 while keeping OAuth2 routing limited to LLM/info routes. Add regression coverage for management-route boundary and tighten opaque-token assertions; update docs to reflect selective-mode route scope.

Made-with: Cursor
2026-04-07 13:52:47 -07:00
Yuneng Jiang
184050e2a1
Merge remote main into litellm_ui_e2e_psql_pr 2026-04-07 10:27:12 -07:00
Yuneng Jiang
48a68230c8
fix(test): update check_responses_cost tests for _expire_stale_rows
PR #25258 changed _cleanup_stale_managed_objects from update_many to
execute_raw via _expire_stale_rows, but the tests were not updated.
The tests now mock _expire_stale_rows on the instance and assert
update_many calls only for job completion, not stale cleanup.
2026-04-07 10:09:11 -07:00
Yuneng Jiang
54f4be6ab6
Merge remote-tracking branch 'origin/main' into litellm_ui_e2e_psql_pr 2026-04-06 23:18:35 -07:00
Yuneng Jiang
965879e74f
fix: address Greptile review comments
- team-admin: assert Admin Settings is not visible (role-specific check)
- proxy-admin: use users[Role.ProxyAdmin].password from constants instead of duplicating the env var fallback inline
2026-04-06 23:12:40 -07:00
ishaan-berri
7a9a9f0c79
fix: batch-limit stale managed object cleanup to prevent 300K row UPD… (#25258)
* fix: batch-limit stale managed object cleanup to prevent 300K row UPDATE (#25257)

* Add STALE_OBJECT_CLEANUP_BATCH_SIZE constant

Configurable batch limit (default 1000) for stale managed object cleanup,
preventing unbounded UPDATE queries from hitting 300K+ rows at once.

* Batch-limit stale managed object cleanup with single bounded SQL query

Two fixes to _cleanup_stale_managed_objects:

1. Replace unbounded update_many with a single execute_raw using a
   subquery LIMIT, capping each poll cycle to STALE_OBJECT_CLEANUP_BATCH_SIZE
   rows. Zero rows loaded into Python memory — everything stays in Postgres.
   Uses the same PostgreSQL raw-SQL pattern as spend_log_cleanup.py
   (the proxy requires PostgreSQL per schema.prisma).

2. Extract _expire_stale_rows as a separate method for testability.

Keeps the file_purpose='response' filter to avoid incorrectly expiring
long-running batch or fine-tune jobs that legitimately exceed the
staleness cutoff.

* docs: add STALE_OBJECT_CLEANUP_BATCH_SIZE to env vars reference

* test: remove deprecated embed-english-v2.0 cohere embedding tests
2026-04-06 19:11:55 -07:00
ryan-crabbe-berri
3ac61a519b
Merge pull request #25239 from BerriAI/litellm_backfill-team-member-permissions
feat: add POST /team/permissions_bulk_update endpoint
2026-04-06 18:15:42 -07:00