Commit graph

46618 commits

Author SHA1 Message Date
Mateo Wang
cfd9d27be2
Merge pull request #39038 from BerriAI/litellm_fix_pipeline_guardrail_list_clobber
fix(policy_engine): restore request guardrails list after pipeline allow
2026-09-01 10:13:30 -07:00
Mateo Wang
b86791b4b9
Merge pull request #38985 from BerriAI/litellm_fix_ocr_annotation_page_cost
fix(cost): bill OCR annotation pages via annotation_cost_per_page
2026-09-01 10:13:01 -07:00
mateo-berri
7abed91523 feat(cost): support day-of-week qualified off-peak windows 2026-09-01 10:11:25 -07:00
Mateo Wang
30bf592aaf
Merge pull request #35417 from BerriAI/litellm_fix_responses_bridge_tool_call_arguments_json
fix(responses): json-encode object tool call arguments in the chat completions bridge
2026-09-01 10:08:12 -07:00
milan
ab11613441 fix(bedrock): strip client_metadata from converse additionalModelRequestFields
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-01 16:50:24 +00:00
Yuneng Jiang
a5f9410681
test(ui): wait for the select popup before clicking its option
key_edit_view opened a select and then clicked the option it found by
title text or by raw text. Both queries match the moment the option
enters the DOM, which is one render before the popup finishes entering.
Until then the positioner still carries an inline pointer-events: none,
and user-event refuses to click through it.

That is a race, and a fast machine loses it. Five of the file's 84 tests
failed on every local run while CI stayed green, which is the worst shape
for a test to have: it is only ever red on the machine of whoever is
trying to change the code.

tests/test-utils.tsx already ships chooseSelectOption for exactly this.
It finds the option by role and waits for the positioner to release
pointer events before clicking. The five call sites now use it, and the
helper takes the direct user-event API as well as a setup() instance so
callers do not have to restructure to use it.

Five consecutive full-file runs pass where every previous run failed.

Also finishes this file's screen queries, which brings
prefer-screen-queries to its target of 18.
2026-09-01 09:46:43 -07:00
Yuneng Jiang
2757399c99
fix(ui): render the skill detail page with theme tokens
The page painted every surface, border and text color inline with a
fixed light palette (#202124, #5f6368, #dadce0, #f8f9fa, #fff), so in
dark mode it drew dark text on hardcoded white cards.

Move the whole component to the foreground/muted/border/card/info
tokens, which already resolve for both themes.
2026-09-01 09:43:47 -07:00
Yuneng Jiang
5c0e3d738f
fix(ui): render the logs Tools panel with theme tokens
The tool cards hardcoded light colors as inline styles (#fff, #fafafa,
#f0f0f0, #f6ffed), so in dark mode the theme's light foreground text
landed on a white card and became unreadable.

Swap the inline hex for the existing card/muted/border/success tokens,
which already carry both light and dark values.
2026-09-01 09:41:51 -07:00
ryan-crabbe-berri
4db165379a
Merge pull request #39119 from BerriAI/litellm_fix_mcp_alias_grant_persistence
fix(mcp): persist alias MCP grants verbatim instead of rewriting to local server ids
2026-09-01 09:11:44 -07:00
ryan-crabbe-berri
190b8c7d8e test(e2e): drop coverage registry cell for the alias-grant test 2026-09-01 09:03:47 -07:00
ryan-crabbe-berri
4118db5a50 test: drop litellm-internal patches from the cross-region alias test (TQ008)
The pure helpers express the same regression: the save-side drop must
leave the alias in place, and two registries must expand it to their
own ids. The full validate path is already covered by the
persists-verbatim test and the live e2e test.
2026-09-01 08:23:26 -07:00
ryan-crabbe-berri
7a761ccf5a test(e2e): cover alias MCP grant persisting verbatim on key generate
A single-instance run cannot reproduce the two-region setup, but the
regression is fully visible in one: the alias must survive to /key/info
unrewritten, and the alias-granted key must still list the server's
tools. The broken write path stored the resolved server id instead.
2026-09-01 08:10:41 -07:00
ryan-crabbe-berri
0d7035989c fix(mcp): persist alias MCP grants verbatim instead of rewriting to local server ids
Since PR #29128, key create/update/regenerate resolved every
object_permission.mcp_servers entry against the saving instance's
DB + config registry and persisted the resolved server ids. For
config-loaded servers the id is derived from a hash of the regional
URL, so in a shared-database multi-region deployment the rewrite baked
one region's ids into the row and every other region denied the key.
Grants written before v1.88.0 kept the raw alias and kept working,
which is why only newly provisioned keys broke.

Keep the validation and the stale-entry drop (the LIT-3278 fix), but
persist the caller's original identifiers for everything that resolves.
Read-time expand_permission_list already maps a name to each region's
local server id.
2026-09-01 08:10:36 -07:00
milan
e3b5cf13c6 feat(helm): add Argo CD PreSync hook and rollout strategy knobs to the componentized chart
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-01 14:14:50 +00:00
Devin AI
9a1aebc146 fix(registry): declare databricks deepseek cache-write rate at the input rate per repo convention
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-01 13:50:21 +00:00
Devin AI
5263570e68 Add cerebras/zai-glm-4.7 deprecation_date per Cerebras deprecations page
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-01 13:33:31 +00:00
Devin AI
7bfa0d7fb4 Registry audit: Fireworks DeepSeek V4 Flash 0731 pricing, Databricks DeepSeek V4 entries, provider deprecation dates
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-01 13:15:22 +00:00
Devin AI
40738355b4 Merge remote-tracking branch 'origin/litellm_internal_staging' into devin_ai_1788201394-veo31-pricing-tiers 2026-09-01 13:03:19 +00:00
yatishgoel
054acb2223 fix(ui): stop checkboxes stretching to the full width of a form field 2026-09-01 17:05:08 +05:30
Devin AI
5f44bdd1c1 test: trim mcp fixture docstring and reload comment
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-01 11:06:08 +00:00
mateo-berri
215bf03373 refactor(types): replace Any with precise types across 73 modules
Narrows reportAny / reportExplicitAny hot spots in provider transformations,
proxy endpoints, integrations and secret managers by introducing TypedDicts,
Protocols and object-typed boundaries instead of Any, then ratchets the
budget ceilings down to match.

reportAny 14765 -> 14076, reportExplicitAny 4493 -> 4128, ANN401 387 -> 307
2026-09-01 11:05:02 +00:00
Devin AI
95c7ca8801 fix(tests): restore module attributes after reload in mcp identity env tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-01 10:59:08 +00:00
Kris Xia
7ca035f310
fix(gemini): return enabled thinking content by default 2026-09-01 17:52:37 +08:00
Devin AI
2019c309ea merge: absorb litellm_internal_staging; drop python duplicate-issues closer fix superseded by ts rewrite
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-01 09:18:31 +00:00
Devin AI
d4fc54a11d chore(techdebt): clear fresh debt from the 2026-08-31 window
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-01 08:25:42 +00:00
Yuneng Jiang
c5ba2b5fcf
test(ui): query the screen instead of the render result
Two changes, both about finding elements the way a user finds them.

Twenty-six test files destructured queries off render and called them
bare. Those queries are scoped to the render container, so they quietly
miss anything portalled into the body, and they read as if they were
free functions. They now go through screen.

ChatMessageBubble and the key info panel derived elements by walking
closest/parentElement/firstElementChild and then asserted on the classes
they found. A wrapper element anywhere in between broke them. The bubble
surface, the avatar and the budget reset value now publish a test id, so
the assertions survive markup changes and still fail when the styling
they check actually regresses.

Budgets drop with the counts: prefer-screen-queries 221 to 21,
no-node-access 723 to 716.

The 21 remaining prefer-screen-queries are not all fixable: 18 of them
are within(dialog) results in MCPToolsetsTab, which the rule cannot tell
apart from a render result. Target is 18, not 0.
2026-09-01 00:26:49 -07:00
Yuneng Jiang
2fbea77afa
test(ui): assert DataTable behavior instead of DOM structure
The shared DataTable test reached for elements by CSS selector and by
walking parentElement chains, then asserted on Tailwind class strings. It
had no role queries at all, so a wrapper div anywhere in the render tree
broke it while changing nothing a user sees.

Columns, rows and headers are now found the way a user finds them: by
role and by the text on screen. The compact skeleton row is compared
against the loaded row's height rather than a hard-coded h-8, so renaming
the class no longer breaks the test but shrinking the row still does.

The fillHeight and maxBodyHeight cases stay class assertions. jsdom has
no layout engine, so there is nothing behavioural to assert there. What
they no longer do is derive their elements from incidental nesting: the
three layout wrappers and the header now publish a stable test id, which
is also why the resizer's write-only data-resizer attribute became one.

Budgets drop with the counts: no-container 150 to 133, no-node-access 760
to 723.
2026-09-01 00:19:27 -07:00
Yuneng Jiang
847d737b8e
test(ui): budget DOM-structure assertions in dashboard tests
Turn on testing-library/no-node-access, no-container and
prefer-screen-queries as warnings and baseline them in eslint-budgets.json
so the counts can only go down.

These three rules catch tests that assert on DOM structure rather than on
what a user can observe: reaching through parentElement chains, querying
the container by CSS selector, and destructuring queries off render
instead of going through screen. Those assertions break on refactors that
change nothing a user sees, and stay green when the behaviour underneath
is broken.

Baselines are the current counts, so nothing fails today.
2026-09-01 00:13:05 -07:00
Mateo Wang
ec3f8183c3
Merge pull request #39066 from BerriAI/litellm_aws_external_id_files_batches
fix(bedrock): forward aws_external_id in files and batches credential loading
2026-08-31 23:31:29 -07:00
Mateo Wang
9f6024bf97
Merge pull request #39044 from BerriAI/litellm_fix_bedrock_guardrail_token_log
fix(bedrock): mask signed request headers in guardrail debug log
2026-08-31 23:30:14 -07:00
Yassin Kortam
b11f0bcb92
fix(proxy): include litellm_model_table in GET /v2/team/list (#39045)
* fix(proxy): include litellm_model_table in GET /v2/team/list

GET /v2/team/list built its find_many queries without joining the
LiteLLM_ModelTable relation, so litellm_model_table (and the
model_aliases it carries) always read back as null there, same bug
class as GH #26312 which PR #33047 fixed on /team/info and /team/list
but never touched this endpoint.

* fix(test): assert observable output, not mock calls, in v2 team list test

The test-quality gate flagged the regression test for asserting on
find_many's call args instead of what the caller gets back. Rewritten
so the fake find_many only attaches litellm_model_table when its own
include kwarg asks for it, so the assertions are on the response.

* fix(proxy): drop invalid litellm_model_table include on deleted-team query

Greptile caught that LiteLLM_DeletedTeamTable has no litellm_model_table
relation in the Prisma schema, so passing that include on the deleted-team
find_many raised UnknownRelationalFieldError against a real database on
every GET /v2/team/list?status=deleted call. Confirmed live against
Postgres. Scope the fix to the active-team branch only, where the relation
exists; update the test to reflect that and assert the deleted branch no
longer requests it.
2026-08-31 23:19:45 -07:00
Tin Chi Lo
a27e12367e fix(bedrock): forward native structured outputs on Invoke instead of silently inlining the schema 2026-08-31 23:19:22 -07:00
tin-berri
db46973ec4
feat(ui): modality routing toggle on the auto-router create and edit forms (#39059) 2026-08-31 23:08:40 -07:00
yuneng-jiang
635a8ad308
Merge pull request #39073 from BerriAI/litellm_e2e_stored_credential_poll
test(e2e-ui): poll credential availability before Test Connect to deflake multi-instance runs
2026-08-31 23:07:34 -07:00
Mateo Wang
d83d9645fe
Merge pull request #39065 from BerriAI/litellm_fix_openai_alias_reasoning_effort
fix(openai): forward reasoning_effort for unknown model aliases instead of failing closed
2026-08-31 22:56:38 -07:00
Mateo Wang
b35aa7d2d9
Merge pull request #38796 from BerriAI/litellm_decrease_anys_opus5_r2
chore(typing): clear 1.1k basedpyright Any errors across 53 backend files
2026-08-31 22:56:35 -07:00
Yuneng Jiang
a48953a0a8
test(e2e-ui): require consecutive credential probe successes to cover multi-replica routing 2026-08-31 22:37:35 -07:00
mateo-berri
f65bee6d74 test(websearch): carry a reasoned test-quality suppression on the router patch 2026-08-31 22:32:05 -07:00
yuneng-jiang
c78f405473
Merge pull request #39051 from BerriAI/litellm_/non-admin-key-type-change-e76bec
fix(key_management): allow non-admin key_type preset transitions on /key/update
2026-08-31 22:24:29 -07:00
mateo-berri
191313e756 test(websearch): register configured search tool in pre-request hook test
PR #38113 made a configured search_tool_name fail fast when the router
does not carry a matching search tool, which broke
test_pre_request_hook_modifies_request_body: it names test-search-tool
but never registers it. Stub the proxy router with that tool so the test
exercises the conversion path again.
2026-08-31 22:22:05 -07:00
Yuneng Jiang
fae5aabc5c
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_/jovial-archimedes-1d743b 2026-08-31 22:21:35 -07:00
Yuneng Jiang
88501a074d
test(e2e-ui): poll credential availability before Test Connect to deflake multi-instance runs 2026-08-31 22:20:36 -07:00
yuneng-jiang
174acf90c1
Merge pull request #39025 from BerriAI/litellm_/jovial-archimedes-1d743b
test(e2e/ui): automate 8 manual QA checklist flows
2026-08-31 22:13:07 -07:00
tin-berri
4a24be886d
feat(ui): one classification frequency picker for complexity auto-routers (#39042)
Classification timing and session affinity are the same operator question,
so Advanced: Classification Method now carries a single "How often to
classify" radio: every request, every new user message, or once per session.
The session choice writes session_affinity and stays disabled on custom tier
sets, where the backend rejects it. Advanced: Affinity keeps the deployment
switch alone.

The serializer always writes classification_mode, matching session_affinity
on the line below it, so an explicitly stored every_request survives an
untouched save instead of being dropped back to the backend default.
2026-08-31 22:12:59 -07:00
Yuneng Jiang
81c48f810e
fix(key_management): keep read-only keys read-only in non-admin preset transitions
A non-admin could widen a read-only (info_routes) key to llm_api or full
access through the preset carve-out. Read-only keys now stay read-only
unless a proxy admin widens them; the other preset transitions, including
the LIT-4891 llm_api to full access switch, still work. Also converts the
transition tests to assert on a returned outcome so the no-403 cases
carry real assertions.
2026-08-31 22:09:21 -07:00
Yuneng Jiang
4bfc6766e7
refactor(key_management): immutable types in preset transition helper for lint budgets 2026-08-31 21:56:44 -07:00
Yuneng Jiang
8a83f9e3cc
refactor(key_management): extract allowed_routes update gate to keep complexity budget 2026-08-31 21:50:22 -07:00
yuneng-jiang
aabfbd6e37
Merge pull request #39055 from BerriAI/litellm_e2e_drop_unsafe_mgmt_registry_cells
test(e2e): drop the two mgmt registry cells no shared-proxy test can cover
2026-08-31 21:48:27 -07:00
mateo-berri
9e25dd708f feat(streaming): carry final response cost on streamed usage by default
Streamed responses through the proxy previously exposed no usable cost:
the x-litellm-response-cost header is unreadable mid-stream and the final
usage chunk carried only tokens, priced against an alias model name the
client cannot resolve. The include_cost_in_streaming_usage flag existed
but was off by default and only fixed the wire, not SDK clients.

Stamp usage.cost into the joined streaming response by default wherever a
final usage object is built: the chat-completions stream_chunk_builder,
the native /v1/responses RESPONSE_COMPLETED event, and synthetic response
events. Provider-reported cost always wins over the computed value, and
only positive computed costs are stamped so unpriceable alias responses
keep deferring to the logging object's own calculation. Per-chunk SSE
cost injection (/v1/messages, generateContent, passthrough) stays behind
the flag.

Also normalize non-litellm usage objects in stream_chunk_builder: openai
CompletionUsage lacks Usage.__contains__, so membership probes silently
returned False and client-side rebuilds dropped the wire cost and
recounted token usage locally. Wire token counts and cost now survive.

Resolves LIT-6427
2026-08-31 21:47:13 -07:00
mateo-berri
0a9676bd4f fix(openai): scope unknown-model reasoning_effort forwarding to the plain openai provider 2026-08-31 21:42:31 -07:00