Commit graph

43876 commits

Author SHA1 Message Date
ryan-crabbe-berri
fdfb122573
refactor(ui): convert caching page charts to shadcn/recharts (#32721)
* refactor(ui): convert caching page charts to shadcn/recharts

* test(ui): bind cache chart legend labels to fills so a category-order swap fails
2026-07-10 17:57:14 -07:00
Yuneng Jiang
a88a9bfcb2
feat(ui): add filter drawer and column visibility to shared DataTable
Adds server- and client-side column filtering to the shared DataTable via a
filterMode prop that mirrors the existing sorting and pagination modes, a global
search filter, a staged filter drawer ("Apply Filters" / "Reset") built on the
shadcn Sheet primitive (added via `npx shadcn add sheet`), and a table-aware
toolbar (search, refresh, active-filter chips, and a Columns menu). Also adds
skeleton loading rows, an icon empty state, and renders toolbar, table, and
pagination as a single card.

Migrates the two pilot tables onto the design as a proof of concept:
TeamVirtualKeysTable drives server-side filtering through the list API (key alias
via the search box, user via the drawer), and WorkflowRuns filters client-side in
memory. Both keep their existing behavioral tests green, with new coverage for the
filter drawer, the toolbar, the global search, and the server-filter query mapping.
2026-07-10 17:41:38 -07:00
Yuneng Jiang
8b31b200ca
refactor(guardrails): generalize _to_dict to any pydantic model
Addresses PR review: _to_dict special-cased LitellmParams and returned an
empty dict for any other pydantic model. Switch to isinstance(value,
BaseModel) so it coerces any pydantic model uniformly (BaseModel is already
imported for the response models), which also drops the now-unused
LitellmParams import. Behavior is unchanged for the current call sites.
2026-07-10 17:24:36 -07:00
Tin
1be846680a fix(mcp): show the upstream-mismatch warning on edit and return undefined from withoutMintedTokenCredentials so a restore never blanks a stored client 2026-07-10 17:22:33 -07:00
yucheng-berri
14338a2471
fix(redis): only use SSLConnection when ssl is truthy in connection pool kwargs (#32825) 2026-07-10 17:16:10 -07:00
tin-berri
ad224e74a8
Merge pull request #32847 from BerriAI/litellm_liccheck_authorize_expression
ci: authorize the expression package (MIT) in liccheck.ini
2026-07-10 17:13:58 -07:00
tin-berri
5205af9d13
Merge pull request #32815 from BerriAI/litellm_mcp_credential_class_merge
fix(mcp): merge credentials within the client-forwarded class on an auth-type switch
2026-07-10 17:06:31 -07:00
Yuneng Jiang
799a559871
fix(guardrails): show YAML-defined guardrails in the Guardrail Monitor
The /guardrails/usage/{overview,detail,logs} endpoints resolved guardrails only
from the litellm_guardrailstable Prisma table, so guardrails defined in
config.yaml (which live only in IN_MEMORY_GUARDRAIL_HANDLER) were invisible:
detail 404'd, overview omitted them or rendered them as Custom/Guardrail
orphans, and logs missed their logical-name alias.

Add config-owned accessors (list_config_guardrails, get_config_guardrail_by_id)
to the in-memory handler and use them in the usage endpoints, mirroring the
union/fallback already used by list_guardrails_v2 and get_guardrail_info. Also
preserve guardrail_info when storing a config guardrail (type/description were
dropped at initialize time) and read the Prisma-row / dict / LitellmParams
shapes uniformly.

Resolves LIT-2529
2026-07-10 16:49:30 -07:00
yucheng-berri
51f6e1b7a5
fix(proxy): match multi-mode guardrail_mode without false-COMPLIANT (#32832)
* fix(proxy): match list/dict guardrail_mode in compliance mode checks

* test(compliance): cover ComplianceChecker guardrail_mode shapes (str/list/dict/None)

* fix(proxy): trust only Mode.default in compliance mode matching (ignore tag overrides)

* fix(proxy): match dict guardrail_mode only when every branch runs in mode (no false-compliant)

* fix(proxy): treat multi-mode guardrail_mode as unresolved (no false-compliant)

The list branch previously counted a guardrail configured with mode:
[pre_call, post_call] under every listed mode. But when the writer cannot
infer the concrete hook that fired (apply_guardrail invocations), the raw
list is logged, and an image-only request that only reaches the post-call
path still records both modes. That let a pre_call compliance check pass on
a request that only ran post_call.

Match the tightened dict semantics: a list now counts for mode only when
every listed mode equals mode. Same trade-off (under-report instead of
false-COMPLIANT). Speculative set support is dropped (spend logs are
JSON-serialized, sets do not cross the wire).

Tests updated to reflect the tightened list semantics, deduplicated (single
TestModeMatching class), and shortened. The invariant is now expressed as
a computed check: True implies every branch runs in the matched mode.

---------

Co-authored-by: Marton Schneider <marton@schneider.co.nl>
2026-07-10 16:41:28 -07:00
tin-berri
8f24f2f767
Merge pull request #32794 from BerriAI/litellm_lit4338_envelope_edge_consumer
feat(mcp): add dcr_bridge envelope consumer helpers
2026-07-10 16:31:36 -07:00
Tin Chi Lo
e12f28ebed ci: authorize the expression package (MIT) in liccheck.ini 2026-07-10 16:19:08 -07:00
mateo-berri
e5421bfe1e
fix(model_cost): add missing backup entries for gemini image models
gemini/gemini-3.1-flash-image, vertex_ai/gemini-3-pro-image, and
vertex_ai/gemini-3.1-flash-image existed in the root pricing JSON but not in
litellm/model_prices_and_context_window_backup.json, leaving deployments with
LITELLM_LOCAL_MODEL_COST_MAP=True unprotected. Copies the root entries into
the backup verbatim and extends the regression test to cover all ten gemini
image models, asserting each exists in the local cost map so a missing backup
entry fails the test instead of passing vacuously
2026-07-10 23:16:09 +00:00
Yassin Kortam
4e3c437631
feat(deploy): make coordination redis a first-class chart and terraform surface (#32662)
Render a general_settings.coordination_redis block into the litellm-helm
proxy config when the bundled Redis is enabled, gated on a new
redis.coordination.enabled value and skipped when the user already
supplies their own block. Sentinel deployments render sentinel_nodes and
service_name rather than a host/port pair.

Also fixes litellm.redis.serviceName, which gated its sentinel branch on
standalone architecture. The bundled Redis subchart only serves sentinel
in replication mode, and renders no master Service there, so REDIS_HOST
pointed at a Service that never existed for every sentinel user.

Documents the coordination redis in the componentized chart and in the
terraform modules, whose existing REDIS_* exports now feed it directly.

Adds helm-unittest coverage for both charts' redis wiring, which had none
2026-07-10 16:16:09 -07:00
Yassin Kortam
3ea7f98725
feat(proxy): configure the coordination redis independently of the response cache (#32661)
* fix(proxy): build redis usage cache from REDIS_* env when cache backend is not Redis

Selecting a semantic (or any non-Redis-KV) response cache left
redis_usage_cache unset, silently downgrading cross-pod rate limits,
parallel-request limits, spend coordination, and the pod lock manager
to per-pod in-memory state. Fall back to a standalone RedisCache built
from REDIS_* environment variables, mirroring the existing
use_redis_transaction_buffer escape hatch, which now shares the same
helper.

Resolves LIT-3861

* feat(proxy): configure the coordination redis independently of the response cache

Adds general_settings.coordination_redis, an explicit block for the Redis
the proxy uses for cross-pod rate limits, parallel-request limits, spend
tracking, the pod lock manager, and shared health checks. Resolution order
is the explicit block, then a plain-Redis response-cache backend, then the
REDIS_* environment. Cluster and sentinel targets are supported, and a
cluster target now builds a RedisClusterCache so cluster-aware consumers
take the cluster path.

Admins can configure it from the Caching page of the dashboard via
/coordination_redis/settings, which reports which source is in effect,
redacts credentials on read, and offers a connection test. Settings saved
there are read back at startup so they take effect on restart.

Also fixes redis client construction so an explicitly configured host
outranks REDIS_URL in the environment. Previously the url branch stripped
the caller's host and port, so an explicit block, or a connection test
typed into the dashboard, silently targeted whatever REDIS_URL named

* fix(ui): move coordination_redis_settings into renamed _components directory

---------

Co-authored-by: Yucheng Zhu <yucheng@berri.ai>
2026-07-10 16:15:59 -07:00
Tin Chi Lo
8b8a28848c fix(ui): drop the saved qualifier from the OAuth client field labels
A plain optional label implies the field is persisted like any other form
field; the qualifier was only there to contrast with the removed not-saved
wording
2026-07-10 16:09:42 -07:00
Yassin Kortam
99b4c5ed3e
feat(otel): emit the gen_ai.client.operation.exception event on failed LLM calls (#32655)
* feat(otel): emit the gen_ai.client.operation.exception event on failed LLM calls

The GenAI semantic conventions record failures of a GenAI client operation as
a log-based event named gen_ai.client.operation.exception, carrying the
exception.type / exception.message / exception.stacktrace trio at severity
WARN and correlated to the failed span. OTel v2 never emitted it: a failed LLM
call produced only the deprecated error.* span attributes, a generic exception
span event without a stacktrace, and the stacktrace under the vendor key
litellm.provider.error.stack_trace.

Build the logs pipeline (LoggerProvider + console/OTLP log exporters mirroring
the metrics plumbing) and record the event behind the enable_events flag, which
until now was defined but consumed nowhere. An operator-configured LoggerProvider
global is reused so the events ride their existing logs pipeline; an explicit
NoOpLoggerProvider global is honored as an opt-out and builds no recorder at all.

The existing span-side error surface (error.type, error.message, the exception
span event, and the litellm.provider.error.* detail keys) is untouched for
backwards compatibility.

* fix(otel): always ride the semconv-required exception pair on the GenAI event

Filtering the event attributes on truthiness conflated "absent" with "empty",
so an empty exception.type or exception.message would have been dropped, leaving
an event with neither semconv-required field. Build the attributes so the pair is
unconditional and only the recommended stacktrace is omitted when the payload
carries none.

* docs(otel): document the events plumbing module in the package README

* test(otel): cover the log exporter selection and logs endpoint normalization

The new logs plumbing had no coverage for exporter-kind selection, the
console fallback for an unrecognized kind, the /v1/logs signal-path rewriting
that lets one OTEL_ENDPOINT serve every signal, or the simple-vs-batch
processor split.
2026-07-10 16:08:10 -07:00
Tin Chi Lo
3913a4af59 fix(ui): keep the original one-sentence DCR hint under the OAuth client ID field 2026-07-10 15:59:17 -07:00
Tin Chi Lo
2b4c054403 feat(ui): move the dcr_bridge toggle next to the OAuth app fields
Render DcrBridgeToggle inside PassthroughAuthorizeSection, after the OAuth
client ID/secret fields and just before the Authorize & Fetch Tools button,
in both the create and edit flows. Also update the section copy to say a
configured OAuth app is saved with the server, using the same wording as the
credential lifecycle rework in #32752 so whichever PR lands second rebases
cleanly
2026-07-10 15:47:05 -07:00
yuneng-jiang
eb7e4a567a
Merge pull request #32793 from BerriAI/litellm_/design-to-litellm-integration-7b0786
refactor(ui): full-height sidebar shell with content-scoped top bar
2026-07-10 15:31:48 -07:00
Tin Chi Lo
0053527ccf fix(mcp): keep bridge server-id match total on non-ascii and strip bearer with any whitespace 2026-07-10 15:30:03 -07:00
Yassin Kortam
d1ae9571ae
fix(proxy): build redis usage cache from REDIS_* env when cache backend is not Redis (#32635)
Selecting a semantic (or any non-Redis-KV) response cache left
redis_usage_cache unset, silently downgrading cross-pod rate limits,
parallel-request limits, spend coordination, and the pod lock manager
to per-pod in-memory state. Fall back to a standalone RedisCache built
from REDIS_* environment variables, mirroring the existing
use_redis_transaction_buffer escape hatch, which now shares the same
helper.

Resolves LIT-3861
2026-07-10 15:24:33 -07:00
Tin Chi Lo
9d87527671 fix(mcp): include scrypt p factor in the maxmem ceiling so it scales with every work factor 2026-07-10 15:21:17 -07:00
yuneng-jiang
94e8e69397
Merge pull request #32830 from BerriAI/litellm_/litellm-daily-oss-docs-7d2894
docs: point OSS contributors at the daily OSS branch
2026-07-10 15:07:59 -07:00
Yuneng Jiang
1c6d9faf7a
refactor(ui): move usage-card meter and sidebar button onto shared primitives
Addresses review nits on the sidebar shell. The Meter primitive now owns its bar color through a tone variant, so the usage card passes a tone instead of a bg-* class, and the near-limit tone goes back to 80% to match the previous usage indicator. The enterprise usage card is now explicitly gated on an active license, so it never renders for an unlicensed proxy rather than relying on seat/team data being null. The collapsed-rail control and the sidebar menu button render through the shadcn and Base UI button primitives instead of raw button elements; the menu button gains render/nativeButton passthrough while its group toggles stay native buttons, so the nav link leaves keep their link semantics. Adds a regression test that the card stays hidden without a license even when seat limits exist
2026-07-10 15:07:13 -07:00
mateo-berri
43b69d84b3 fix(model_cost): align backup gemini/gemini-3-pro-image entry with root pricing JSON 2026-07-10 22:06:25 +00:00
Tin Chi Lo
ef9637035b fix(mcp): derive bridge envelope keys with memory-hard scrypt, cached per master key 2026-07-10 15:04:37 -07:00
Deepanshu
fd862bb2b8
fix(model_cost): add supports_reasoning: false to gemini/gemini-3-pro-image 2026-07-10 22:04:02 +00:00
Deepanshu
aa717bc4d0
fix(model_cost): apply supports_reasoning: false to root pricing JSON
The backup file is used by tests; the root model_prices_and_context_window.json
is what gets published to the pricing URL and loaded by the proxy at runtime.
Without this, the proxy would continue resolving supports_reasoning via the
provider-level fallback and returning true for Gemini image generation models.

Also covers vertex_ai/gemini-3-pro-image and vertex_ai/gemini-3.1-flash-image
(non-preview variants) and gemini/gemini-3.1-flash-image which exist only in
the root JSON.
2026-07-10 22:04:02 +00:00
Deepanshu
75dd70a678
fix(model_cost): add supports_reasoning: false to Gemini image generation models
vertex_ai/gemini-2.5-flash-image, vertex_ai/gemini-3-pro-image-preview,
vertex_ai/gemini-3.1-flash-image-preview, gemini/gemini-3-pro-image-preview,
and gemini/gemini-3.1-flash-image-preview were missing supports_reasoning
entries; _supports_factory then fell through to the vertex_ai provider-level
config which returns true, causing requests with reasoning_effort to be sent
to an API that rejects them.
2026-07-10 22:04:02 +00:00
Yuneng Jiang
f72c7cc2db
docs: point OSS contributors at the daily OSS branch
The guard-main-branch error messages and the contributor docs still
pointed people at litellm_oss_staging. Redirect them to the current
daily OSS branch (litellm_oss_daily_YYYY_MM_DD), a fresh one of which
is cut each weekday, so contributors should target the most recent
2026-07-10 14:54:37 -07:00
Tin
1e78e96c5d fix(mcp): clear the DCR client ref and upstream warning on modal close, and reuse the ref in the temp OAuth payload 2026-07-10 14:45:54 -07:00
Tin Chi Lo
08963b744f feat(mcp): bind bridge envelope to its server, key derivation via HMAC, add producer + shape helpers 2026-07-10 14:36:56 -07:00
Tin Chi Lo
424532e63d feat(mcp): add dcr_bridge envelope consumer helpers (key derivation, authorization classifier) 2026-07-10 14:36:56 -07:00
yucheng-berri
6d17f9e85c
fix(proxy): add coordination_redis routes to component allowlist (#32823)
Some checks are pending
CodSpeed Benchmarks / benchmarks (push) Waiting to run
GitHub Actions Security Analysis / zizmor (push) Waiting to run
2026-07-10 14:31:54 -07:00
Mateo Wang
cc36d5469c
fix(bedrock): keep mid-conversation system messages in place for Claude Invoke (#32578)
Hoisting every role system entry into the top-level system field mutates
the cache prefix whenever a client such as Claude Code appends a new
mid-conversation system message, invalidating the prompt cache for the
entire message history on Bedrock Invoke. Bedrock only rejects a system
entry at messages.0, so hoist just the leading run and forward the rest
in place
2026-07-10 14:30:32 -07:00
tin-berri
ab53d06a2e
Merge pull request #32748 from BerriAI/litellm_lit4338_envelope_module
feat(mcp): add sealed envelope module for dcr_bridge client-held credentials
2026-07-10 14:28:36 -07:00
Tin
7d64f9d26b fix(mcp): merge credentials within the client-forwarded class on an auth-type switch 2026-07-10 14:15:24 -07:00
Tin Chi Lo
9176744735 perf(mcp): O(1) character precheck before the exact byte size guard in open_envelope 2026-07-10 13:56:49 -07:00
Tin
ececa9efcc test(mcp): speed up the auth-type-switch preserve tests so they do not time out under CI 2026-07-10 13:47:51 -07:00
Tin Chi Lo
2883e36a97 fix(mcp): measure envelope open-side size cap in utf-8 bytes to match mint 2026-07-10 13:32:00 -07:00
Tin Chi Lo
47f33bda3f feat(ui): dcr_bridge toggle for client-forwarded MCP auth modes 2026-07-10 13:17:19 -07:00
Tin Chi Lo
d6503d1d87 fix(mcp): make open_envelope total over hostile jwt claim types and cap candidate size 2026-07-10 13:16:10 -07:00
Tin Chi Lo
dd38e9f1a0 fix(mcp): return malformed_payload for signed envelopes with empty identity claims
A correctly signed JWT whose user_id or server_id claim was an empty string
passed claims validation but raised ValidationError from the EnvelopeIdentity
constructor inside open_envelope, breaking its never-raises guarantee. The
claims model now mirrors the identity's min_length constraints, so any claim
set that validates also constructs, and the empty-identity case maps to
MalformedPayload like every other bad claim shape.
2026-07-10 13:16:10 -07:00
Tin Chi Lo
65c80919aa feat(mcp): add sealed envelope module for dcr_bridge client-held credentials
Pure, unwired module: mints and opens the single client-held bearer that
carries both a litellm identity and the encrypted upstream OAuth grant with
zero server-side storage. HS256 JWT signing (same approach as the BYOK
session bearer) plus the existing encrypt_value/decrypt_value symmetric
helpers, with all key material and the clock injected as parameters. Opening
returns typed frozen error values (not_an_envelope, bad_signature, expired,
malformed_payload, decrypt_failed); minting rejects envelopes over
MAX_ENVELOPE_BYTES with a typed error instead of truncating. Error values
and reprs never carry token material.
2026-07-10 13:16:10 -07:00
tin-berri
34602ff627
Merge pull request #32753 from BerriAI/litellm_lit4337_dcr_bridge_facade
feat(mcp): dcr_bridge discovery facade and register relay
2026-07-10 13:14:43 -07:00
ryan-crabbe-berri
3afd4a2282
ci(ui): move frontend lint into its own "UI Lint" workflow (#32810)
The lint job lived in test-litellm-ui-build.yml (workflow name "UI Build
Check") next to the build job, so its check surfaced as the misleading
"UI Build Check / frontend-lint" even though it does prettier, eslint, lint
budgets, and knip, not building. Split it into test-litellm-ui-lint.yml
(name "UI Lint") so the check reads "UI Lint / frontend-lint". The build
workflow keeps only build-ui; the lint job (including the knip step) moves
over unchanged.

Note for whoever manages branch protection: this renames the lint required-
check context from "UI Build Check / frontend-lint" to
"UI Lint / frontend-lint"; update the required-check entry so PRs don't strand.
2026-07-10 13:08:15 -07:00
Tin
a2f8e80a7b fix(mcp): rework the credential-field lifecycle so the OAuth app is upstream-scoped 2026-07-10 13:03:10 -07:00
Tin Chi Lo
849ceb0c19 feat(mcp): relay upstream registration errors to the client on the dcr_bridge arm 2026-07-10 12:37:47 -07:00
Tin Chi Lo
b8d1b395d2 refactor(mcp): align register redirect_uris raise shape and forward client redirect_uris at the root path 2026-07-10 12:37:47 -07:00
Tin Chi Lo
04a11a439a feat(mcp): dcr_bridge discovery facade and register relay 2026-07-10 12:37:47 -07:00