Commit graph

5645 commits

Author SHA1 Message Date
Yassin Kortam
367393405c
Merge pull request #41170 from BerriAI/litellm_prometheus_401_failed_requests_metric
fix(prometheus): count 401 auth failures in litellm_proxy_failed_requests_metric
2026-09-15 13:13:49 -07:00
Yassin Kortam
0e5be275b0
Merge pull request #41283 from BerriAI/litellm_writer_pinned_raw_sql_writes
fix(proxy): keep access-group raw SQL writes on the writer while writer_unavailable is stale
2026-09-15 13:13:30 -07:00
tin-berri
d07b2e87d2
Merge pull request #41270 from BerriAI/litellm_capability_classifier_pr
feat(router): add capability classifier as Fuse foundation
2026-09-15 13:04:21 -07:00
yassin
264305de23 fix(proxy): keep access-group raw SQL writes on the writer while writer_unavailable is stale
A stale RoutingPrismaWrapper.writer_unavailable flag made WriterPinnedClient hand back the routed wrapper, where query_raw is classified as a read, so the access-group UPDATE statements behind /key/regenerate, /key/generate with access_group_ids and model rename/delete went to the read replica and failed with SQLSTATE 25006. Route those raw statements through the underlying writer regardless of the flag; a raw SQL write has no replica fallback. WriterPinnedClient keeps yielding to the replica for degraded reads.

The model sync's backing-row count stays on the writer too: it runs right after the row delete/update on the writer and a lagging replica could still report the removed row, which would leave the group naming a model nobody serves.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 19:55:07 +00:00
Yassin Kortam
4d526ad747
Merge pull request #41216 from BerriAI/litellm_cache_custom_hf_tokenizer
fix(utils): cache custom HuggingFace tokenizers across /utils/token_counter requests
2026-09-15 12:51:18 -07:00
Yassin Kortam
d5b96648ea
Merge pull request #41161 from BerriAI/litellm_headroom_protect_cached_prefix
fix(headroom): protect the cached prefix through the last cache_control breakpoint
2026-09-15 12:49:50 -07:00
Yassin Kortam
c190f0f4b9
Merge pull request #41125 from BerriAI/litellm_alert_5xx_http_exceptions
fix(alerting): send llm_exceptions Slack alert for 5xx HTTPException and ProxyException
2026-09-15 12:48:58 -07:00
Yassin Kortam
a7b894f91b
Merge pull request #41271 from BerriAI/litellm_org_zero_max_budget
fix(proxy): enforce organization budgets when max_budget is 0
2026-09-15 12:47:18 -07:00
Yassin Kortam
60808520df
Merge pull request #40904 from BerriAI/litellm_jwt_agent_id_claim
feat(proxy): bind JWT claims to registered agents via agent_id_jwt_field
2026-09-15 12:46:18 -07:00
yassin
d350aaf8bd Merge remote-tracking branch 'origin/main' into litellm_prometheus_401_failed_requests_metric 2026-09-15 19:43:47 +00:00
Yassin Kortam
501be3143d fix(proxy): enforce organization budgets when max_budget is 0
_organization_max_budget_check returned early whenever org_max_budget
was <= 0, so an organization with an explicit max_budget of 0 was
treated as unlimited instead of zero allowance. Key, team, and user
budget checks already skip only on None; align organization budgets
with that convention.

validate_team_org_change had the same defect in a different shape: it
used a truthy check on the org's max_budget when validating a team
move, so an explicit 0 there silently skipped the guard too.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-15 11:49:05 -07:00
Yassin Kortam
837423237a
Merge pull request #36775 from MvdB/litellm_presidio_new_entities
feat(guardrails): add new upstream presidio pii entities including german set
2026-09-15 11:26:21 -07:00
Tin Chi Lo
2da9bbfc0f chore: merge main into capability classifier copy 2026-09-15 11:24:01 -07:00
tin-berri
3ac79757f4
Merge pull request #41175 from BerriAI/litellm_team_member_auto_routers
feat(auto-router): allow opted-in team members to manage their routers
2026-09-15 11:19:58 -07:00
Yassin Kortam
dfcefd8298
Merge pull request #41256 from BerriAI/litellm_team_model_access_error_lists_all_models
fix(proxy): list directly assigned team models in model access errors
2026-09-15 11:16:25 -07:00
ryan-crabbe-berri
8b6c398b92
Merge pull request #41039 from BerriAI/litellm_bulk_user_delete
feat(proxy): add POST /user/bulk_delete and POST /team/bulk_member_delete
2026-09-15 11:12:40 -07:00
ryan
6ea1085bc3 Merge branch 'main' into litellm_bulk_user_delete
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 18:03:15 +00:00
ryan-crabbe-berri
08b433267e
Merge pull request #40917 from BerriAI/litellm_credential_conflict_409
fix(credentials): answer 409 on a credential name collision, make Terraform adoption opt-in
2026-09-15 10:58:26 -07:00
ryan-crabbe-berri
6dcca8c4ae
Merge pull request #41028 from BerriAI/litellm_bulk_new_user
feat(proxy): add POST /management/v1/users/bulk for batched user and team membership creation
2026-09-15 10:57:46 -07:00
ryan-crabbe-berri
81806f33cf fix(credentials): answer 409 on a name collision, let PATCH resolve values from model_id
POST /credentials let a duplicate name hit the unique index and handed back
Prisma's "Unique constraint failed" as a 500, so callers string-matched that
message to tell a caller mistake from a server fault. The unique violation now
maps to a 409 whose message names the PATCH route, two concurrent creates of
one name agree on it, and the detection lives in a repository helper the five
hand-rolled copies can move onto later

PATCH /credentials/{name} took a CredentialItem body, so the model_id the
Terraform adopt path sent was dropped. It now accepts UpdateCredentialItem and
shares the deployment lookup with create. Both handlers take the router as a
FastAPI dependency instead of reading the proxy global, which is what the
tests override
2026-09-15 10:41:43 -07:00
Devin AI
79450121f8 test(proxy): document access group test seam
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 17:00:11 +00:00
Devin AI
56d0f953f5 fix(proxy): list directly assigned team models in model access errors
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 16:33:41 +00:00
mateo-berri
1f2d050386 Merge remote-tracking branch 'origin/main' into litellm_unified_key_policy_hook 2026-09-15 05:11:29 -07:00
yassin
b64e430e93 test(proxy): record custom tokenizer loads with a mock instead of a mutable list
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 09:37:53 +00:00
yassin
0c611e63c8 fix(utils): cache custom HuggingFace tokenizers across /utils/token_counter requests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 09:12:49 +00:00
Mateo Wang
3ed6c19b8d
Merge pull request #40915 from BerriAI/litellm_internal_copy_37075
fix(vertex-live): bill Gemini Live sessions end to end (internal copy of #37075)
2026-09-15 02:06:49 -07:00
Mateo Wang
80b9ed4f2c
Merge pull request #41191 from BerriAI/litellm_router_test_cap_resets_per_fallback_hop
fix(router): count num_retries_per_request across fallback hops
2026-09-15 01:13:41 -07:00
Mateo Wang
e5cb8b7534
Merge pull request #40984 from BerriAI/litellm_anthropic_guardrail_system_and_tool_use
fix(guardrails): scan the Anthropic top-level system prompt and tool_use arguments
2026-09-15 00:55:42 -07:00
mateo-berri
1b040af414 test(router): type the retry-cap tests this PR adds or touches 2026-09-15 00:34:38 -07:00
mateo-berri
4f27573424 merge: origin/main into litellm_internal_copy_37075 2026-09-15 00:34:18 -07:00
tin-berri
feab83aae1
Merge pull request #41186 from BerriAI/litellm_statusline_router_cost_label
fix(cli): label savings cost bars with the auto-router name
2026-09-15 00:32:08 -07:00
mateo-berri
f80cb5cb46 fix(router): ignore planted request_retry_count seeds and cover the rust OCR cap path
The router clamps a negative request_retry_count found in request metadata before counting a failure, and the proxy strips a client-supplied request_retry_count with the other router-reserved metadata fields. The rust OCR lifecycle test that trips the per-request cap now plants request_retry_count instead of attempted_retries, which the cap no longer reads since the previous commit
2026-09-15 00:04:02 -07:00
Tin Chi Lo
109ca70f66 feat(auto-router): allow opted-in team members to manage their routers 2026-09-14 23:56:55 -07:00
Tin Chi Lo
d0fdf1c237 fix(cli): show only the routed model in the footer header 2026-09-14 23:54:50 -07:00
Tin Chi Lo
4fca818f34 fix(cli): align wide and combining Unicode cost labels 2026-09-14 23:45:48 -07:00
tin-berri
4805c6d51f
Merge pull request #41072 from BerriAI/litellm_lit5201_provider_split
fix(router): honor team and key provider weights
2026-09-14 23:41:45 -07:00
Tin Chi Lo
398300c4e7 fix(router): honor team and key provider weights 2026-09-14 23:31:52 -07:00
Mateo Wang
b52de1675a
Merge pull request #40994 from BerriAI/litellm_sdk_exception_body_headers
fix(sdk): keep body and proxy headers on BadRequestError mapped from a litellm_proxy 400
2026-09-14 23:27:29 -07:00
mateo-berri
62b2b36ce9 test(proxy): drop the reformat-only diff of the request processing tests
The proxy edge test file no longer carries any test of this change, and
the remaining diff was the scoped format gate reflowing the whole file to
the 120 limit, so it goes back to the merge base bytes
2026-09-14 22:39:19 -07:00
yucheng-berri
91588221cd
Merge pull request #39050 from BerriAI/litellm_lit6314_guardrail_metadata_transfer
fix(guardrails): record not_run evaluation when scoping leaves nothing to scan
2026-09-14 22:31:16 -07:00
Mateo Wang
a78b24c195
Merge pull request #41172 from BerriAI/litellm_azure_spend_log_zero_cost
fix(proxy): log the provider usage on deferred /v1/messages calls and price cache writes without a creation rate
2026-09-14 22:26:22 -07:00
mateo-berri
6a635cbb64 fix(sdk): carry a litellm_proxy error's headers on e.response, not e.headers
A mapped litellm_proxy exception now attaches an httpx.Response that
carries the proxy's response headers whenever the handler attached a
header-less synthetic one, on every status branch and on the relay
path. BadRequestError keeps its base-class contract: .headers stays the
proxy-supplied channel, so the proxy edge keeps forwarding an upstream
proxy's headers under the llm_provider- prefix and the date and server
edge change is no longer needed.
2026-09-14 22:22:26 -07:00
mateo-berri
04410967ff Merge remote-tracking branch 'origin/main' into litellm_anthropic_guardrail_system_and_tool_use
main's test_one_text_per_row_over_a_system_prompt_is_rejected_by_name assumed the
top-level system prompt stays out of the scanned texts. This branch scans it, so one
text per structured row now lines up and the rewrite is applied; the test asserts that,
and a multi-block system prompt keeps the length-guard rejection covered.
2026-09-14 22:19:18 -07:00
yucheng
9acdebf563 chore: merge origin/main into litellm_lit6314_guardrail_metadata_transfer
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 05:03:31 +00:00
Mateo Wang
c16c172a65
Merge pull request #40939 from BerriAI/litellm_responses_per_message_guardrail_rewrite
fix(guardrails): write per-message guardrail rewrites back onto Responses input items
2026-09-14 21:57:29 -07:00
mateo-berri
8573241c49 fix(cost): resolve a missing 1h cache write rate after off-peak pricing
The one-hour cache write fallback now takes the applied cache write rate, so an off-peak write price carries into it instead of the input rate

The cost estimate test for a cost-map model without cache prices now expects writes at the input rate, which is what the proxy bills

The recording logger in the deferred guardrail test types its callback parameters
2026-09-14 21:46:33 -07:00
mateo-berri
f4f1e2eace refactor(sdk): move the None sentinel to constants and freeze the init kwargs filter 2026-09-14 21:46:22 -07:00
Tin Chi Lo
bebc76316c fix(cli): label savings cost bars with the auto-router name 2026-09-14 21:42:57 -07:00
mateo-berri
f8c2539ba7 Merge remote-tracking branch 'origin/main' into litellm_azure_spend_log_zero_cost 2026-09-14 21:37:19 -07:00
mateo-berri
e01d97ea08 fix(guardrails): read Prompt Security modified rows with the slot count's own predicate
A chat row whose content carried an empty text part counted two slots in the
chat completions handler while Prompt Security read one text out of the
modified row, so the structured rewrite was dropped and the request got the
named rejection. One shared helper now lists a row's slot texts and both the
slot count and the modified-row reader use it.
2026-09-14 21:31:22 -07:00