Commit graph

17245 commits

Author SHA1 Message Date
Yujong Lee
d4869ba710 refactor: print rust and python traces independently 2026-09-14 11:48:25 -07:00
Yujong Lee
eb2ffaae79 fix(harness): rebuild bridge for trace parity 2026-09-14 11:48:25 -07:00
Yujong Lee
561533c596 wip 2026-09-14 11:48:24 -07:00
Yujong Lee
ad5b87eb91 fix: capture reused worker threads in Python traces 2026-09-14 11:47:30 -07:00
Mateo Wang
cab1e113f7
Merge pull request #40976 from BerriAI/litellm_azure_gpt_chat_latest_pricing
feat(pricing): add azure gpt-chat-latest rates and drop retired friendliai llama-3.1 entries
2026-09-14 11:21:20 -07:00
Yassin Kortam
08a78a3982
Merge pull request #41054 from BerriAI/litellm_gate_correlation_contextvar_stamp
perf(logging): skip correlation contextvar stamping when request_correlation_in_logs is off
2026-09-14 11:14:44 -07:00
Shivi Jain
f4e21430c0 test(auth): freeze prefetch cache clock so the org getter cannot miss on a slow runner
Prefetch still writes org entries with the 5s getter TTL. This test only asserts the SQL join, and wall-clock expiry on CI turned that into a MagicMock await TypeError.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 18:13:49 +00:00
Shivi Jain
75b16df6fa fix(auth): keep prefetched org entries on the 5s getter TTL
Organization mutations do not evict those cache keys, so stretching prefetch to the management TTL would leave stale org grants in L1.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 18:13:49 +00:00
Shivi Jain
abaa2f8b81 fix(auth): put TQ008 suppressions on the patch call lines
The test-quality gate attributes the comment to the `patch(` line, so reasons on the closing paren did not count and lint failed after format started passing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 18:13:49 +00:00
Shivi Jain
53ba8b9866 fix(auth): load team membership once per request and skip prisma on an L1 hit
common_checks was querying get_team_membership twice, and DualCache awaited Redis SET on the auth path, so LRU eviction plus a hung Redis write showed up as two postgres spans
2026-09-14 18:13:49 +00:00
Shivi Jain
70ddc7e492 fix(auth): load team membership once per request and skip prisma on an L1 hit
common_checks was querying get_team_membership twice, and DualCache awaited Redis SET on the auth path, so LRU eviction plus a hung Redis write showed up as two postgres spans
2026-09-14 18:13:49 +00:00
Shivi Jain
5457f48290 fix(auth): load team membership once per request and skip prisma on an L1 hit
common_checks was querying get_team_membership twice, and DualCache awaited Redis SET on the auth path, so LRU eviction plus a hung Redis write showed up as two postgres spans
2026-09-14 18:13:49 +00:00
joshua-berri
eceb67b69a test(model_armor): inject HTTP handler and token provider
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 18:03:22 +00:00
yucheng
4be84a859d Merge remote-tracking branch 'origin/main' into litellm_lit6314_guardrail_metadata_transfer 2026-09-14 18:01:01 +00:00
Yuneng Jiang
1d49e0ee7e
test: preserve immutable integration observations and cleanup outcomes 2026-09-14 10:58:36 -07:00
Yuneng Jiang
4ee73c49af
test: collect pricing observations immutably 2026-09-14 10:58:24 -07:00
Mateo Wang
6e9e08475a
Merge pull request #40627 from BerriAI/litellm_fix_realtime_cached_audio_cost
fix(cost): bill cached realtime audio tokens at the audio cache-read rate
2026-09-14 10:50:00 -07:00
yucheng
34e702c571 test(otel): build the clipped-blob conversation without mutating the payload
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 17:46:18 +00:00
yucheng
b4e3d7c533 chore: merge main into litellm_lit6314_guardrail_metadata_transfer
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 17:33:04 +00:00
yassin
83d16a4690 fix(proxy): read LITELLM_DISABLE_ACCESS_LOG_PATHS per record and match before redaction
Values loaded after import via proxy config environment_variables or dotenv
were ignored, and a long query string was truncated by the redaction filter
before the path filter could match it. Tests now go through the production
registration on the uvicorn.access logger instead of a hand-built filter.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 17:27:43 +00:00
Devin AI
66ce1eea97 test(proxy): cover non-string access log paths
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 16:54:38 +00:00
yassin
4b39344d13 fix(proxy): only treat a missing user as no memberships on team list, surface db errors
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 16:49:54 +00:00
Devin AI
2268bbaf5e feat(proxy): honor LITELLM_DISABLE_ACCESS_LOG_PATHS to drop noisy uvicorn access log lines
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 16:39:54 +00:00
yassin
dc30be006b refactor(proxy): read org admin's own team ids via get_user_object(check_db_only=True)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 16:27:31 +00:00
Yuneng Jiang
96fdf5d6f4
test: isolate management integration coverage from E2E registry 2026-09-14 09:23:00 -07:00
Yuneng Jiang
48ccdba129
test: decouple integration contracts from E2E coverage registry 2026-09-14 09:22:13 -07:00
yassin
d643909789 fix(proxy): read org admin's own team ids from db and assert v2 list results
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 16:03:23 +00:00
yassin
8d9edfc03c fix(proxy): keep /team/list self query for org admins membership-only across orgs
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 15:40:41 +00:00
yassin
58c3ccf668 fix(proxy): keep org admins' own team memberships in other orgs visible on team list
An org admin listing their own teams on GET /team/list and GET /v2/team/list
only saw teams in the orgs they administer. Teams they belong to in other
orgs were dropped because the org scope and the membership scope were ANDed.
A self query now unions the two, while a query for another user keeps the
org boundary intersection.

Resolves LIT-3723

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 15:27:06 +00:00
Yassin Kortam
9e1ed40db3
Merge pull request #40927 from BerriAI/litellm_per_issuer_virtual_key_claim_field
feat(jwt): allow virtual_key_claim_field per issuer
2026-09-14 08:00:25 -07:00
Yuneng Jiang
cfda6dea3e
test: cover persisted updates and warmed authorization policies 2026-09-14 04:20:06 -07:00
Yuneng Jiang
92e0b72e2d
test: add CircleCI integration contract foundation 2026-09-14 03:30:52 -07:00
Devin AI
a70f9a17cc perf(logging): skip correlation contextvar stamping when request_correlation_in_logs is off
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 08:54:34 +00:00
Devin AI
19c43eb875 test(cli): drop structural StrEnum source check; smoke job covers the 3.10 import
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 07:08:24 +00:00
Devin AI
03e6dd051c fix(cli): drop enum.StrEnum so the CLI imports on Python 3.10
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 06:59:10 +00:00
ryan
c25498b66d fix(proxy): remove a bulk-deleted user's email-only roster entries without touching same-email teammates
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 06:08:42 +00:00
ryan
dbb4de7bc2 fix(proxy): match bulk-deleted users on team rosters by user_id only and give /team/bulk_member_delete the 60s batch timeout
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 05:59:19 +00:00
ryan
d442d90411 test(proxy): add /team/bulk_member_delete behavior-suite scenarios for route coverage
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 05:56:52 +00:00
ryan
82872c9627 fix(proxy): run /user/bulk_delete team rewrites and user deletes in one transaction
Lock affected teams in sorted order inside a single 60s transaction so a
failure on any team rolls back every rewrite and every user row delete.
PrismaClient.tx() gains an optional timeout for the larger batch.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 05:35:55 +00:00
ryan
595aba3cb0 fix(proxy): evict deleted keys from the auth cache and make bulk user deletion transactional
/user/bulk_delete now deletes the users' keys, invitation links, org and team
memberships and user rows in one transaction and reports a rolled-back batch
per row instead of leaving partial deletes behind. Both bulk endpoints evict
the deleted keys (and deleted user objects) from the auth cache, so a deleted
key stops authenticating immediately rather than at TTL expiry.

/team/bulk_member_delete rejects member rows that carry both user_id and
user_email, reports repeated rows as duplicates, and only cleans up keys and
memberships of members it actually matched.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 05:12:34 +00:00
ryan
cd9c39921b feat(proxy): add POST /user/bulk_delete and POST /team/bulk_member_delete
Batch user deletion that also removes each user from every team they belong to, and batch removal of many members from one team. Each touched team is rewritten once under the team advisory lock from a roster re-read under that lock

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 04:55:39 +00:00
ryan
0c9e0c407e fix(proxy): keep a team on a /user/bulk_new row when the roster already lists that user id
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 03:37:20 +00:00
ryan
4285f1dfb0 fix(proxy): do not claim rows a concurrent request inserted when /user/bulk_new create_many fails
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 02:39:47 +00:00
ryan
24a1d772b6 fix(proxy): keep key policy fields and reconcile committed rows in /user/bulk_new
Rows opting into auto_create_key lost blocked, permissions, aliases, config,
agent_id, budget_fallbacks and budget_limits before reaching the key helper.
When create_many commits but the response is lost, re-read which ids landed
and retry only the rest so committed rows report success and get their teams.
Regenerate schema.d.ts and allowlist the endpoint in the Terraform audit.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 01:48:44 +00:00
ryan
ff5b59b173 feat(proxy): add POST /user/bulk_new for batched user and team membership creation
Creates up to 500 internal users in one request with set-based validation,
a single create_many for user rows, and one locked write per referenced team.
Rows fail independently, keys are opt-in per row via auto_create_key, and
send_invite_email is rejected for the batch.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-14 01:17:19 +00:00
yassin
a41b719920 fix(proxy): refund batch TPD reservation on failure and report active window reset time
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 10:56:17 +00:00
yassin
c47120cbf7 fix(proxy): add tpd_limit to deleted token table and fix CI fixtures
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 10:31:35 +00:00
mateo-berri
fff7a2cecf fix(responses): keep context-window events out of mid-stream fallback and fix stale exception assertions 2026-09-13 03:18:59 -07:00
yassin
438d46cb50 feat(proxy): add tpd_limit (tokens per day) for batch submissions
Adds a nullable tpd_limit column and field to keys, teams, budgets and end users. The batch submission limiter swaps the per-minute RPM/TPM descriptor of any scope that has a tpd_limit for a token-only 24h descriptor, so batch traffic is budgeted per day while online traffic keeps the existing per-minute limits. The Admin UI exposes the field on key, team and budget create/edit forms

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-13 10:06:07 +00:00
mateo-berri
2923c4ac55 fix(guardrails): read the rewrite from texts when a guardrail echoes every row back unchanged 2026-09-13 03:02:15 -07:00