Commit graph

4746 commits

Author SHA1 Message Date
Yuneng Jiang
28c1e43196
feat(ui): standardize the Teams page header 2026-08-14 00:01:16 -07:00
Mateo Wang
784259bbd9
Merge pull request #36769 from BerriAI/litellm_nvidia_riva_ui_provider
fix(ui): add nvidia riva to the model provider list
2026-08-13 20:39:24 -07:00
yucheng-berri
0a25756e78
fix(ptu): stop per-token billing on a PTU-configured deployment (#36829)
A deployment with PTU flat-cost attribution also billed every request per
token, so a team paid for reserved capacity and again for the traffic that
capacity serves. Nothing set the per-token price and an unset price falls
back to the public cost map, which made the double charge the default.

/model/new and /model/{id}/update now store zero for every pricing field the
cost map could otherwise fill, refuse a price the caller supplies alongside
PTU config with a 400 naming the field, zero a price already on the row
rather than rejecting later edits of unrelated fields, and drop the zeros
again when the PTU config goes.

A PTU deployment is no longer read as a free model by the budget checks,
which would have waived every budget for it.
2026-08-13 20:16:12 -07:00
mateo-berri
ea4316b245 fix(ui): resolve provider dropdown enum keys in getPlaceholder 2026-08-13 19:58:06 -07:00
mateo-berri
60c6c2c703 test: drop redundant explanatory comments from riva provider tests 2026-08-13 19:24:45 -07:00
mateo
a0a536216f Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_model-deprecation-alerts-55bc
Some checks failed
Terraform Modules / fmt, validate, test (aws) (push) Has been cancelled
Terraform Provider / gofmt, vet, build, test (push) Has been cancelled
Terraform Provider / Provider endpoints vs proxy OpenAPI schema (push) Has been cancelled
2026-08-14 02:19:03 +00:00
Yassin Kortam
909a2e6232
perf(spend-logs): bound retention cleanup so one run cannot saturate the database (#36594) 2026-08-13 18:56:37 -07:00
yuneng-jiang
89f81919cc
Merge pull request #36832 from BerriAI/litellm_/quizzical-jennings-5df447
refactor(ui): migrate guardrails to shadcn
2026-08-13 18:30:56 -07:00
yuneng-jiang
2913ee811c
Merge pull request #36847 from BerriAI/litellm_/awesome-shirley-6a1a86
refactor(ui): migrate playground to shadcn
2026-08-13 18:30:48 -07:00
yuneng-jiang
6797327dc8
Merge pull request #36838 from BerriAI/litellm_/brave-hermann-3d77ac
refactor(ui): migrate guardrails-monitor to shadcn
2026-08-13 18:30:40 -07:00
yuneng-jiang
ce3a56dce6
Merge pull request #36834 from BerriAI/litellm_/compassionate-jones-9c0d5c
refactor(ui): migrate usage to shadcn
2026-08-13 18:30:30 -07:00
Yassin Kortam
b344043eaf
fix(ui): stop a deselected MCP server keeping its grant on a virtual key (#36840)
* fix(ui): stop a deselected MCP server keeping its grant on a virtual key

The key editor sent `mcp_tool_permissions` unfiltered, and the MCP resolver
counts a server named only under `mcp_tool_permissions` as entitled, unioning
`tool_perm_servers` into `all_servers` at four sites in
`user_api_key_auth_mcp.py`. Deselecting a server, or removing the access group
that supplied it, therefore left a stale entry that kept the key reaching that
server with its old tool allowlist attached.

Reuse `extractMcpEntitlement`, which already landed for the internal-user
surface, so the key surface drops an entry only once the server is known and no
longer granted, and keeps it whenever a retained access group or toolset could
still supply it. The helper moves to a shared module so the key template does
not import a users page component.

Setting the map unconditionally is part of the same fix: the old
`Object.keys(...).length > 0` guard let the previous map ride through the
`object_permission` spread, which filtering to an empty map would otherwise hit
in exactly the case the fix is for.

* fix(ui): resolve retained MCP groups and toolsets per server when pruning tool permissions

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

* test(ui): mock the MCP toolsets hook in the key update suite

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

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-13 18:00:42 -07:00
Yassin Kortam
e0f388cb5c
feat(ui): render request metrics on the /ui/chat surface (#36845)
/ui/chat never rendered a metrics bar. The Responses helper already parses
usage off the response.completed event, but the chat page passed positional
undefined where onTimingData, onUsageData and onTotalLatency sit, ChatMessage
had nowhere to hold them, and ChatMessages never rendered ResponseMetrics.

Thread the three callbacks through, persist the values on the assistant
message, and reuse the playground's ResponseMetrics to show latency, TTFT,
input/output/total tokens and cost. Also map the cost the proxy reports on the
streamed usage object, which only the chat-completions helper did before.
2026-08-13 17:31:13 -07:00
Yuneng Jiang
62523c1734
fix(ui): restore pattern search and popup layering in the guardrail wizard
Two behaviour differences the port introduced, both found in browser QA

The antd Select matched a prebuilt pattern on its display_name and its
internal name; a Base UI Combobox only searches itemToStringLabel, so
queries like "amex" and "sg" stopped matching. Restore the second field
with a filter predicate on the Root, covered by a regression test that
searches on a token the visible label does not contain

Base UI portals a popup into a positioner whose "isolate z-50" is fixed
in the primitive, so inside an antd Modal at z-index 1000 the options
were visible but not clickable. antd hid this because its own dropdowns
and tooltips already sat above its Modal. The positioner is not reachable
from the call site, so this needs one app-wide rule keyed on an antd
modal being present, and it becomes deletable when the last one goes
2026-08-13 17:27:26 -07:00
tin-berri
83e890bdde
feat(ui): shadow evals tab beside auto-router usage (#36588) 2026-08-13 17:19:45 -07:00
Yassin Kortam
b72dab8049
feat(ui): show provider prompt cache tokens in chat response metrics (#36827)
The chat metrics bar reported In/Out/Reasoning/Total/cost only, so a
playground user had no signal that provider prompt caching worked. The
cached-token counts were already visible in the Logs drawer, which meant
the answer to "does caching work here" lived on a different page.

Adds cacheReadTokens and cacheCreationTokens to TokenUsage and renders
them as two chips, reusing the prompt-cache tooltip wording already
introduced for the Logs drawer so both surfaces say the same thing.

A single helper, extractPromptCacheTokens, normalizes the three usage
shapes the playground consumes: Anthropic Messages
(cache_read_input_tokens / cache_creation_input_tokens), chat
completions (prompt_tokens_details) and the Responses API
(input_tokens_details). All three producers call it instead of parsing
per surface. Counts that are absent, zero or non-finite are dropped, so
providers without prompt caching render exactly what they render today.
2026-08-13 16:58:14 -07:00
Yuneng Jiang
0ebbda92d7
style(ui): drop the playground migration's explanatory comments
The repository's comment policy keeps reasoning out of the source, so the
notes on the delete dialog, the tooltip wrapper, and the test query choices
move to the pull request instead.
2026-08-13 16:51:22 -07:00
Yuneng Jiang
615de5d922
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_/awesome-shirley-6a1a86 2026-08-13 16:32:16 -07:00
Yuneng Jiang
30b933dd5e
test(ui): drop the metric grid class assertion
The assertion pinned the Tailwind track string, which jsdom can never
evaluate: it does no layout, so the test could not fail for the reason
that matters, and its pattern accepted any minmax minimum, staying green
if that minimum changed enough to break the layout outright.

Only a viewport-resize browser test can observe this, which belongs in
tests/e2e/ui rather than a route's unit tests. The responsive behaviour
itself is unchanged; the widths it reproduces are recorded in b341a22339
2026-08-13 16:21:01 -07:00
Yuneng Jiang
9a26da90a4
refactor(ui): migrate playground to shadcn
Replaces antd and Tremor with shadcn primitives across the six route-owned,
form-free playground components: the compare view and its panel, message input
and unified selector, plus the realtime playground and the agent builder.

Markup only, no behaviour change. The characterisation tests added in the
previous commit are untouched here and stay green through the swap.

Adds ui/slider.tsx via the shadcn CLI and retires the six antd
no-restricted-imports suppressions the migration made obsolete.
2026-08-13 15:59:53 -07:00
Yuneng Jiang
b341a22339
fix(ui): keep the guardrails metric cards wrapping at narrow widths
The antd Row and Col the migration replaced never squeezed the summary
cards below their content width; they wrapped onto a second line instead.
Measured on a live dashboard, antd laid out five per row at 1280 and 1024,
then four plus one at 900 and three plus two at 820, never narrower than
about 126px. A fixed grid-cols-5 kept all five on one line and compressed
them to 86px at 820, so the metric values overflowed their cards.

An auto-fit track with a 7rem minimum reproduces antd's wrap points and
card widths exactly at all four measured viewports, and is identical at
1280, so the route's visual baseline is unchanged.

The added test fails against grid-cols-5 and passes against the track
2026-08-13 15:57:03 -07:00
Yuneng Jiang
923a49a6f8
test(ui): pin playground behaviour with library-agnostic queries
Rewrite the playground tests that reached for antd class names so they
locate controls by role, text, placeholder or lucide icon instead. Add
characterisation suites for AgentBuilderView and RealtimePlayground,
which had none, including tab state that must survive a round trip
through another tab.

Every assertion here passes against the current antd components.
2026-08-13 15:56:45 -07:00
Yuneng Jiang
5af59f3d53
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_/brave-hermann-3d77ac 2026-08-13 15:30:24 -07:00
ryan-crabbe-berri
262ed530f8
fix(proxy): honor explicit null budget_duration on team and key create + clearable UI dropdowns (#36699)
* fix(proxy): honor explicit null budget_duration over default_team_params on /team/new

* fix(ui): clearable team budget reset with explicit Never resets option

* docs(proxy): align default_team_params docstrings with actual all-teams scope

* fix(proxy): honor explicit null budget_duration on /key/generate over configured defaults

* fix(proxy): keep upperbound_key_generate_params filling explicitly-null key params

* fix(proxy): restrict explicit-null default opt-out to budget_duration
2026-08-13 15:22:11 -07:00
Yuneng Jiang
355ef22257
refactor(ui): drop narration comments from the migrated usage components 2026-08-13 15:22:03 -07:00
Yuneng Jiang
7c9cd2b3df
refactor(ui): migrate guardrails-monitor to shadcn
Replaces the antd Button, Row, Col, Spin and Typography usage in
GuardrailsOverview with the shadcn button, a CSS grid and the house
loading wrapper, and swaps the ant-design icons for lucide equivalents
that the already-migrated GuardrailDetail sibling uses. The busy state
keeps the aria-busy attribute the antd Spin exposed, so the loading
contract is unchanged for assistive tech.

The route's other analyzer-listed file, GuardrailsMonitorView, keeps its
DateRangePickerValue type import because the shared AdvancedDatePicker
prop contract requires it, so there is nothing to migrate there.

Retires the file's now unused no-restricted-imports suppression
2026-08-13 15:21:54 -07:00
Yuneng Jiang
4beac28ab5
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_/quizzical-jennings-5df447
# Conflicts:
#	ui/litellm-dashboard/eslint-suppressions.json
2026-08-13 15:06:03 -07:00
Yuneng Jiang
771c36c1ee
refactor(ui): migrate guardrails route to shadcn
Ports the 21 route-owned guardrails components off antd and Tremor onto the
installed shadcn base-vega primitives. Forms, tables and shared components stay
where they are: the route analyzer buckets add_guardrail_form, guardrail_info
and six others as DEFERRED, and eleven components under src/components as
SHARED, so none of them are touched here.

Three behaviours needed explicit handling because Base UI does not match antd by
default. Base UI Tabs mounts only the active panel, so the playground draft and
every panel's local state would reset on a tab switch; TabsContent now carries
keepMounted. ComboboxList takes a function child to render the filtered items,
and mapping over the array instead renders everything and silently disables the
type to filter behaviour antd gave for free. SelectContent gets
alignItemWithTrigger={false} so popups anchor below the trigger the way antd's
did, which also removes a focus race that made the template picker
intermittently unclickable.

The three dialogs reached from inside the still-antd wizard need a layer above
its z-index of 1000 to be visible at all.

Adds three tests rather than editing the characterisation tests from the
previous commit: a guard that every tab panel stays mounted, and one filtering
regression each for the pattern and mode dropdowns.

Prunes the guardrails entries from eslint-suppressions.json.
2026-08-13 15:05:09 -07:00
Yuneng Jiang
2d7581e32e
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_/compassionate-jones-9c0d5c 2026-08-13 15:02:48 -07:00
Yuneng Jiang
b69177712e
refactor(ui): migrate usage to shadcn
Replaces antd and Tremor markup on the usage route with the installed shadcn
base-vega primitives. Behaviour is unchanged: the route's characterisation
tests were rewritten to role and text queries in the previous commit, proven
green against the antd components, and pass through this commit unedited.

Tremor tab panels stayed mounted once rendered, so every migrated TabsContent
and the collapsible model sections in activity_metrics carry keepMounted to
keep view-mode and expansion state alive across tab switches.
2026-08-13 15:02:40 -07:00
devin-ai-integration[bot]
87736a767c
feat(ui): highlight Auto Router in the navbar announcement (#36315)
* chore(ui): remove Agent Platform announcement bell from navbar

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

* feat(ui): highlight Auto Router in the navbar announcement

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

* fix(ui): open Auto Router docs link in a new tab

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

* Revert "fix(ui): open Auto Router docs link in a new tab"

This reverts commit 3be861bafe.

* chore(ui): title the navbar announcement LiteLLM Auto Router

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

---------

Co-authored-by: Mubashir Osmani <mubashir@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-13 21:57:14 +00:00
Yuneng Jiang
c5c98cf706
test(ui): characterise GuardrailsOverview before the shadcn migration
Covers the header and export action, all five summary metric cards, the
table toolbar heading, the evaluation settings modal wiring, the busy
state and the request failure message. Every assertion is role, title or
text based so it holds against both the antd markup and its shadcn
replacement, letting the migration commit land without editing this file
2026-08-13 14:56:58 -07:00
Yuneng Jiang
28032eb4c9
test(ui): decouple usage-route tests from antd and Tremor markup
Rewrites the usage route's library-coupled assertions to role and text
queries so they characterise behaviour rather than the widget library that
happens to render it. Every test here is green against the current antd and
Tremor components and is meant to survive a migration unedited.

Drops the wholesale vi.mock of antd, @ant-design/icons and @tremor/react in
UsagePageView, UsageViewSelect and activity_metrics, and drives the real
controls instead. Two of those mocks were hiding behaviour: activity_metrics
asserted panel order through a heading role that only existed because the
mock faked an h2, and the Tremor tab stubs flattened panel selection away
entirely.

Replaces DOM-shape lookups with anchors that do not move: a chart is found
from its own heading rather than a fixed wrapper depth, an active panel is
identified by the inactive markers both tab libraries set, and select options
are matched by text since antd's real options carry no option role.

Adds the missing characterisation test for team_multi_select, and covers the
mount contracts the route depends on: Tremor keeps every tab panel mounted,
and antd Collapse keeps a section mounted once it has been expanded, which is
what preserves the view-mode state a model section owns.
2026-08-13 14:23:26 -07:00
mubashir1osmani
2a7f5f270c Merge remote-tracking branch 'berri/litellm_internal_staging' into litellm_playground_shadcn
# Conflicts:
#	ui/litellm-dashboard/eslint-suppressions.json
2026-08-13 13:54:11 -07:00
Yuneng Jiang
8ada34fe2c
test(ui): characterise guardrails route behaviour before shadcn migration
Rewrite the PatternModal test off antd class selectors onto role and text
queries, and add characterisation tests for the guardrails components that
had none: the keyword modal, the content filter display and configuration,
the guardrail garden and the custom code modal.

Also covers two behaviours the migration must preserve: the action and
severity dropdowns in the content filter tables, and test playground state
surviving a tab switch away and back.

Every assertion here passes against the current antd and Tremor components
so the same file can prove the shadcn versions unedited.
2026-08-13 13:49:46 -07:00
Yuneng Jiang
1dc0ea3d11
Merge branch 'litellm_internal_staging' into litellm_shadcn_logs_drawer_header_0813 2026-08-13 13:33:00 -07:00
Yuneng Jiang
9f947a7406
Merge branch 'litellm_internal_staging' into litellm_/quirky-mcnulty-e432c4 2026-08-13 13:23:51 -07:00
Yuneng Jiang
2f7602b028
Merge branch 'litellm_internal_staging' into litellm_/eloquent-wu-3ab1d5 2026-08-13 13:16:48 -07:00
yuneng-jiang
c9b543dbfe
Merge pull request #36737 from BerriAI/litellm_/gifted-colden-355244
refactor(ui): migrate SimpleMessageBlock and SimpleToolCallBlock to shadcn
2026-08-13 13:16:22 -07:00
tin-berri
d8fda675cc
feat: pre-adoption shadow eval for the auto-router (blind pairwise judge, derived state) (#36587) 2026-08-13 13:15:45 -07:00
Yuneng Jiang
b71e7a3213
Merge branch 'litellm_internal_staging' into litellm_/gifted-colden-355244 2026-08-13 13:07:51 -07:00
mubashir1osmani
f3f8c48b1d style(ui): format new playground tests and drop suppressions this stack fixed
Prettier flagged the two test files added while fixing review findings.
Migrating these components off Ant Design also retired the lint suppressions
they carried, so prune those 15 entries and leave the unrelated ones for the
PRs that made them stale.
2026-08-13 12:55:43 -07:00
yuneng-jiang
b8577516d4
Merge branch 'litellm_internal_staging' into litellm_/quirky-mcnulty-e432c4 2026-08-13 12:51:53 -07:00
yuneng-jiang
21dbd3381e
Merge branch 'litellm_internal_staging' into litellm_/eloquent-wu-3ab1d5 2026-08-13 12:51:51 -07:00
yuneng-jiang
229d258664
Merge branch 'litellm_internal_staging' into litellm_/gifted-colden-355244 2026-08-13 12:51:50 -07:00
yuneng-jiang
6f9ee6e28f
Merge branch 'litellm_internal_staging' into litellm_/interesting-meitner-e88370 2026-08-13 12:51:48 -07:00
Yuneng Jiang
81f324dc15
Merge branch 'litellm_internal_staging' of github.com:BerriAI/litellm into litellm_shadcn_logs_drawer_header_0813 2026-08-13 12:51:37 -07:00
Yuneng Jiang
dfdafbf89b
fix(ui): keep the tools panel mounted so a tool's expanded detail survives
antd's Collapse kept the panel mounted once opened, so a tool a user had
expanded stayed expanded after closing and reopening Tools. Base UI renders
only the open branch, so the migration silently reset every ToolItem.

The regression test passes against the antd original, fails against the
migration without keepMounted, and passes with it.
2026-08-13 12:50:56 -07:00
Yuneng Jiang
b4092f476f
test(ui): find the section copy button by role instead of the antd icon
InputCard and OutputCard located SectionHeader's copy button by querying for a
descendant with aria-label="copy", which is the antd CopyOutlined icon. That
selector reaches into SectionHeader's internals, so migrating it off antd left
copyButton undefined and failed four tests.

getByRole("button", { name: /copy/i }) is green against both the antd and the
shadcn SectionHeader, verified by running these two files against each.
2026-08-13 12:47:45 -07:00
mubashir1osmani
8fd97803ce Merge remote-tracking branch 'berri/litellm_playground_shadcn' into litellm_playground_shadcn 2026-08-13 12:44:01 -07:00