Commit graph

45730 commits

Author SHA1 Message Date
mateo-berri
2112422c71 test(managed-files): read the scoped page id from the row's unified_file_id 2026-08-08 16:34:26 -07:00
mateo-berri
508e0dbb35 Merge remote-tracking branch 'origin/litellm_internal_staging' into devin_ai_fix_file_list_cursor_leak_36087 2026-08-08 16:31:33 -07:00
Yang Yang
a9277b4b6e style: black format xAI cost calculator tests 2026-08-08 16:22:06 -07:00
Yang Yang
74100989a2 revert: remove xAI-specific web search gate from shared cost tracking
Gate web search like OpenAI (output/annotations/web_search_requests).
xAI uses server_side_tool_usage_details only for per-call cost math, with
web_search_requests mirrored in llms/xai for existing gate compatibility.
2026-08-08 16:22:06 -07:00
Yang Yang
8ad0a57387 style: drop unused pytest import in xAI responses tests 2026-08-08 16:21:49 -07:00
Yang Yang
478118ac36 test(xai): expand cost_calculator coverage for web search helpers
Add unit tests for apply_server_side_tool_usage_details_to_usage edge
cases and model_info-driven web_search per-call pricing fallbacks.
2026-08-08 16:21:49 -07:00
Yang Yang
c03a6076ce test(xai): cover Responses tool usage attach helpers
Add unit tests for server_side_tool_usage_details extraction/attach and
streaming completed-event pass-through in XAIResponsesAPIConfig.
2026-08-08 16:21:49 -07:00
Yang Yang
ea493543d7 fix(xai): attach tool usage details on Responses stream terminal events
Apply server_side_tool_usage_details on completed/incomplete/failed
streaming events so stream=true web_search is billed like non-stream.
2026-08-08 16:21:49 -07:00
Yang Yang
7aaa9358aa fix(xai): read web_search per-call rate from model_info
Use search_context_cost_per_query from the model cost map (with $5/1k
fallback) so web search billing can change via pricing JSON updates.
2026-08-08 16:21:49 -07:00
Yang Yang
8687d7372a fix(xai): gate web search cost on server_side_tool_usage_details
Treat positive web_search_calls as a web-search signal in built-in tool
cost gating, and mirror counts onto prompt_tokens_details.web_search_requests
when attaching xAI tool usage details so charges are not skipped.
2026-08-08 16:21:49 -07:00
Yang Yang
ea98d8e116 fix(xai): read tool usage details from ResponseAPIUsage extras
Also inspect model_extra when attaching server_side_tool_usage_details
for Responses cost tracking.
2026-08-08 16:21:06 -07:00
Yang Yang
3aea951e6c refactor(xai): keep Responses tool usage pass-through in llms/xai
Revert shared responses/utils.py extras forwarding. Attach
server_side_tool_usage_details on chat Usage inside XAIResponsesAPIConfig
so cost calc keeps web_search_calls without provider logic in shared utils.
2026-08-08 16:21:06 -07:00
Yang Yang
014d59f4c4 refactor(responses): pass through extra usage fields generically
Avoid hard-coding provider-specific usage keys in shared Responses
utilities; forward any non-standard usage attributes onto chat Usage
for provider cost tracking (e.g. server_side_tool_usage_details).
2026-08-08 16:20:37 -07:00
Yang Yang
6963cfe047 style: apply black formatting to responses/utils.py 2026-08-08 16:20:09 -07:00
Yang Yang
25ad7dcb41 fix(xai): bill web_search from server_side_tool_usage_details
Use usage.server_side_tool_usage_details.web_search_calls at $5/1k calls
instead of legacy num_sources_used/web_search_requests. Preserve tool usage
details through Responses usage transform for accurate response cost.
2026-08-08 16:20:09 -07:00
yucheng-berri
efc4e6f28c
fix(batches): keep batch state in sync on a poll without claiming attribution (#34456)
A poll of a Vertex passthrough batch wrote nothing to the managed-object row,
so status and file_object stayed frozen at the create-time snapshot and
GET /v1/batches served a stale status and an empty output file id for the life
of the batch. Only the create may claim a batch, but every observation of one
may refresh its state.

store_unified_object_id takes create_if_missing, which the poll clears: it
refreshes status and file_object through update_many, and leaves a row that is
absent absent rather than creating one owned by the observer, since created_by
and team_id are written by whoever reaches the create branch. The update payload
is now shared with the upsert so it cannot drift into writing api_key,
request_tags, created_by or team_id.

The passthrough identity re-assertion that was previously part of this PR ships
separately in #36121, so this PR keeps only the batch attribution work.

The creating key owns user_api_key_alias only when it actually has one. Guarding
the overwrite on the presence of a key rather than on a resolved alias nulled the
field out for every key generated without key_alias, and for any key rotated or
deleted before its batch finished, losing the creating user's alias that the spend
row previously carried. The guard now matches the team-alias line below it.
2026-08-08 16:01:47 -07:00
Mateo Wang
805fc49776
chore: mention AI slop reason 2026-08-08 14:29:36 -07:00
yuneng-jiang
6a919aec6a
Merge pull request #36304 from BerriAI/litellm_internal_staging
Some checks failed
Unit Tests: LLM Provider Transformations / All Other Providers (push) Has been cancelled
Unit Tests: MCP, Secrets, Containers & Misc / misc (push) Has been cancelled
Unit Tests: Proxy Auth & Key Management / proxy-auth (push) Has been cancelled
Unit Tests: Proxy DB Operations / assert-shard-coverage (push) Has been cancelled
Unit Tests: Proxy API Endpoints / proxy-endpoints (push) Has been cancelled
Unit Tests: Proxy API Endpoints / proxy-server (push) Has been cancelled
Unit Tests: Proxy Infrastructure / proxy-infra (push) Has been cancelled
Unit Tests: Proxy Legacy Tests / auth-and-jwt (push) Has been cancelled
Unit Tests: Proxy Legacy Tests / key-generation (push) Has been cancelled
Unit Tests: Proxy Legacy Tests / proxy-config (push) Has been cancelled
Unit Tests: Proxy Legacy Tests / proxy-response-and-misc (push) Has been cancelled
Unit Tests: Proxy Legacy Tests / proxy-server (push) Has been cancelled
Unit Tests: Proxy Legacy Tests / proxy-server-extras (push) Has been cancelled
Unit Tests: Proxy Legacy Tests / proxy-token-counter (push) Has been cancelled
Unit Tests: Proxy Legacy Tests / proxy-user-auth-and-spend (push) Has been cancelled
Unit Tests: Proxy Legacy Tests / proxy-utils (push) Has been cancelled
Unit Tests: Responses, Caching & Types / responses-caching-types (push) Has been cancelled
GitHub Actions Security Analysis / zizmor (push) Has been cancelled
Unit Tests: Proxy DB Operations / auth-checks (push) Has been cancelled
Unit Tests: Proxy DB Operations / budgets (push) Has been cancelled
Unit Tests: Proxy DB Operations / custom-logging (push) Has been cancelled
Unit Tests: Proxy DB Operations / db-and-spend (push) Has been cancelled
Unit Tests: Proxy DB Operations / endpoints-and-responses (push) Has been cancelled
Unit Tests: Proxy DB Operations / guardrails-hooks (push) Has been cancelled
Unit Tests: Proxy DB Operations / jwt-and-keys (push) Has been cancelled
Unit Tests: Proxy DB Operations / key-generation (push) Has been cancelled
Unit Tests: Proxy DB Operations / logging-misc (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-runtime (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-server-core (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-utils (push) Has been cancelled
chore(ci): promote internal staging to main
2026-08-08 14:24:04 -07:00
yuneng-jiang
27d2fa8481
Merge pull request #36297 from BerriAI/litellm_/release-ui-build-528a42
chore: rebuild Admin UI bundle for the 2026-08-08 release
2026-08-08 14:21:24 -07:00
Mateo Wang
1f8964a4c4
chore: handwrite the rule 2026-08-08 14:20:13 -07:00
mateo
6e6e0d662b docs: frame the comment rule around AI slop and allow TODO/FIXME
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-08 21:07:40 +00:00
mateo
abbad8ad52 docs: limit the comment exception to tool-read directives
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-08 21:04:43 +00:00
mateo
8812debeff docs: allow functional comments as an exception in CLAUDE.md
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-08 20:58:30 +00:00
mateo
2d1ee3aab2 fix(proxy): keep the reservation when a disconnect happens while provider output is held back
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-08 20:39:55 +00:00
Yuneng Jiang
84d63cbdcf
chore: update Next.js build artifacts (2026-08-08 20:14 UTC, node v24.19.0) 2026-08-08 13:14:45 -07:00
yuneng-jiang
10798ca3d4
Merge pull request #36286 from BerriAI/litellm_internal_staging
chore(ci): promote internal staging to main
2026-08-08 13:11:47 -07:00
yuneng-jiang
97a59c8c90
Merge pull request #36293 from BerriAI/litellm_fix_circleci_88641_outdated_tests
test: repair stale CircleCI contracts
2026-08-08 13:08:22 -07:00
mateo
bb0bb48da8 fix(proxy): do not let held-back keepalive pings block the budget reservation refund on client disconnect
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-08 20:05:45 +00:00
tin-berri
e35ee4e5fa
feat(router): independent, default-on deployment affinity for the auto-router (#36146) 2026-08-08 13:02:29 -07:00
Mateo Wang
554f065361
Merge pull request #36296 from BerriAI/litellm_claude_md_descending_importance
docs: clarify guideline priority ordering in CLAUDE.md
2026-08-08 13:01:38 -07:00
mateo
ff5f8132d1 docs: clarify guideline priority ordering in CLAUDE.md
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-08 19:55:37 +00:00
Yuneng Jiang
1a40a67394
fix: stabilize generated user role ordering 2026-08-08 12:54:23 -07:00
Mateo Wang
334e6dabf4
Merge pull request #36295 from BerriAI/litellm_remove_pre_commit_rule
chore: remove pre-commit rule
2026-08-08 12:44:48 -07:00
mateo
cbefb1ce5f fix(anthropic): keep pinging while the held-back follow-up stream is in flight
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-08 19:41:42 +00:00
Shivam Rawat
7b89b3a29f
Merge pull request #35708 from BerriAI/devin_ai_lit_5033_websearch_interception_spend
fix(websearch_interception): bill intercepted searches to the calling key
2026-08-08 12:41:31 -07:00
devin-ai-integration[bot]
12aeb53aec
fix(otel): mark v2 server spans as failed for pre-call errors (#34546)
* fix(otel): mark v2 server spans as failed for pre-call errors (LIT-4780)

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

* fix(otel): authenticate malformed-body requests before rejecting them (LIT-4780)

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

* test(auth): cover malformed-body rejection when auth error is recovered

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

* fix(auth): skip authorization for a request whose body never parsed

Deferring the parse failure ran the full auth phase, including budget reservation, whose reserved amount is only released by the endpoint's post call path; the endpoint never runs, so malformed requests leaked reservations and locked a budgeted key out. Authorization now runs only when the body parsed, and a parse failure with a rejected key keeps returning the 400 it returned before.

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

---------

Co-authored-by: shivam <shivam@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-08 12:40:00 -07:00
Mateo Wang
4150248095
chore: remove pre-commit rule
some users do not use make pre-commit as it is a multi-minute process. I personally use it but I want users themselves to decide whether to pre-commit before each commit or not, based on what works best for them
2026-08-08 12:38:23 -07:00
mubashir1osmani
3725233736 Merge remote-tracking branch 'berri/litellm_internal_staging' into litellm_playground_shadcn
Some checks failed
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
# Conflicts:
#	ui/litellm-dashboard/src/components/llm_calls/fetch_models.tsx
2026-08-08 12:33:13 -07:00
devin-ai-integration[bot]
cfd64d45a8
fix(ui): show team BYOK models in team fallback settings (#36241)
* fix(ui): show team BYOK models in team fallback settings

Team router settings loaded fallback options from /model_group/info, which resolves models without a team, so a team's own BYOK deployments were never selectable in its own fallback config. Load the team-scoped listing when a team id is present.

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

* fix(ui): ignore stale team model responses in router settings

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

* refactor(ui): use react-query for fallback model listing in router settings accordion

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: ryan-crabbe-berri <ryan@berri.ai>
2026-08-08 19:28:57 +00:00
mateo
398e3d214c refactor(anthropic): trim hold-back commentary and drop dead rebuilt-content expression
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-08 19:28:40 +00:00
mubashir1osmani
f2e3b6a568 fix(ui): drop null guardrail names from MultiSelect options 2026-08-08 12:25:41 -07:00
Yuneng Jiang
0d7f7c689a
test: repair stale CircleCI contracts 2026-08-08 12:19:29 -07:00
mubashir1osmani
757d5a4dcd fix(ui): apply coy theme after code props on ReasoningContent 2026-08-08 12:19:17 -07:00
mubashir1osmani
4aff515a8e fix(ui): cast syntax highlighter theme through unknown 2026-08-08 12:15:09 -07:00
mubashir1osmani
38e1fe8ffd fix(ui): extract chat handlers and type MCP tool pool 2026-08-08 12:11:33 -07:00
Mateo Wang
8b16ee1dc2
Merge pull request #36277 from BerriAI/litellm_make_check_fallback
build(lint): rename make pre-commit to make check with a working-tree fallback
2026-08-08 12:08:34 -07:00
mubashir1osmani
01d55b9d0f fix(ui): guard null voice selection from shadcn Select 2026-08-08 12:07:36 -07:00
mubashir1osmani
d78a016bc5 fix(ui): green playground shadcn CI after staging merge
Normalize MCP description nullability for MultiSelect, preserve model
selection via functional setState, and update endpoint/vector-store
selector tests for the shadcn combobox API
2026-08-08 12:01:44 -07:00
mateo-berri
24888d56a6 Merge remote-tracking branch 'origin/litellm_internal_staging' into devin_ai_lit_5033_websearch_interception_spend
# Conflicts:
#	litellm/integrations/websearch_interception/handler.py
2026-08-08 12:00:06 -07:00
mubashir1osmani
0302283eba chore: merge litellm_internal_staging into playground shadcn stack 2026-08-08 11:56:47 -07:00