Commit graph

42355 commits

Author SHA1 Message Date
Sameer Kankute
08df8643bf
fix(docker): include enterprise bridge in non-root runtime image (#24917)
Copy the /app/enterprise bridge package into the non-root runtime image so enterprise proxy hooks register correctly (including managed_files).
2026-04-04 14:04:31 -07:00
Ryan Crabbe
9dca431989
fix(ui): use entity key for export instead of extracting team_id from api_key_breakdown
The export utility always extracted team_id from api_key_breakdown
metadata to populate the entity label/ID columns. This worked for
team exports (where entity key = team_id) but was wrong for every
other entity type — tags, orgs, customers, agents, users all
showed the API key's team name (e.g. "admins") instead of the
actual entity value.

Replace extractTeamIdFromApiKeyBreakdown with resolveEntityDisplay
which uses the entity key directly. For teams the teamAliasMap
still resolves a human-readable alias; for all other types the
entity key itself is the correct label.
2026-04-04 13:54:42 -07:00
Ryan Crabbe
f0bbd415c8
fix(ui): require TPM or RPM when adding a per-model team rate limit
Previously, a row with a model selected but both limits blank was
silently dropped on save (neither model_tpm_limit nor model_rpm_limit
got the key), so the row disappeared on reload with no feedback.
Now the TPM field's validator blocks submission with "Set at least
one of TPM or RPM" when a row has a model but neither limit filled.
2026-04-04 13:50:19 -07:00
Ryan Crabbe
11a43d6e50
feat(ui): add per-model rate limits to team edit/info views
Exposes the backend's existing model_tpm_limit/model_rpm_limit fields
(which lived in team.metadata) through a new "Model-Specific Rate Limits"
form section on the team Settings tab. Limits round-trip through the
team-update API and render on the Overview card and Settings view.

Model picker is scoped to the team's currently-selected models (unfurls
wildcards, falls back to userModels for all-proxy-models / all-team-models).
2026-04-04 13:35:14 -07:00
ishaan-berri
4c06e4379b
Litellm ishaan april2 (#25113)
* feat: add brave/search to model_prices_and_context_window.json (#25042)

Brave Search is supported by litellm as a search provider (documented at
docs.litellm.ai/docs/search/brave and listed in provider_endpoints_support.json)
but was missing from model_prices_and_context_window.json, making it invisible
to any code that discovers search providers from litellm.model_cost.

Cost: $0.005/query ($5 per 1,000 requests) per https://brave.com/search/api/

* feat(models): add NVIDIA Nemotron 3 Super 120B on Bedrock (#24588)

* feat(models): add NVIDIA Nemotron 3 Super 120B on Bedrock

Add model definition for nvidia.nemotron-3-super-120b-a12b-v1 via
Bedrock Converse API with pricing, context window (256k/32k), and
capability flags (function calling, tool choice, system messages).

* fix model ID to nvidia.nemotron-super-3-120b + add tests

Correct the Bedrock model ID from nvidia.nemotron-3-super-120b-a12b-v1
(NVIDIA's internal name) to nvidia.nemotron-super-3-120b (the actual
AWS Bedrock programmatic model ID). Add unit tests verifying model
resolution, pricing, and context window.

* fix(proxy): allow JWT auth for /v1/mcp/server sub-paths (#24698)

mcp_routes only contained "/v1/mcp/server" (exact match). Starlette's
compile_path produces an end-anchored regex, so sub-paths like
/register, /health, /submissions, /oauth/* all failed the JWT
allowed_routes_check. Add a {path:path} wildcard entry so all
sub-paths are covered.

---------

Co-authored-by: Daniel Yudelevich <4537920+yudelevi@users.noreply.github.com>
Co-authored-by: michelligabriele <gabriele.michelli@icloud.com>
2026-04-04 12:31:49 -07:00
yuneng-jiang
24886394b3
Merge pull request #25133 from BerriAI/litellm_fix-vector-store-id-model-update
fix(ui): don't inject vector_store_ids: [] when editing a model
2026-04-04 12:12:35 -07:00
Ryan Crabbe
baeda235bb
feat(ui): expose Azure Entra ID credential fields in provider form
Adds tenant_id, client_id, and client_secret to the Azure provider entry
in provider_create_fields.json so the credential add/edit modals and the
add-model form surface Service Principal auth as an alternative to api_key.
The Azure handler already reads these fields from litellm_params at request
time via get_azure_ad_token(); this change makes them inputtable from the
UI without code changes to the React components (the form is driven by
GET /public/providers/fields).
2026-04-04 11:19:45 -07:00
yuneng-jiang
c898edbd14
Merge pull request #25136 from BerriAI/ui_build_apr4
[Infra] Building UI for Release
2026-04-04 11:12:04 -07:00
Ryan Crabbe
445c1fa0ec
fix(ui): preserve clear-vector-stores intent on model edit
Follow-up to the previous commit. The initial fix correctly prevented
injecting vector_store_ids: [] when the user never set any, but broke
the inverse case: a user who had ["vs_abc"] set and cleared the
selector would have their change silently ignored, because the handler
deleted the key from the PATCH payload and the backend's merge kept
the old value.

Distinguish "never touched" from "explicitly cleared" by initializing
the form field to undefined (not []) when the model has no stores, and
adding a middle branch in the submit handler that sends [] when the
form value is [] (user cleared) versus deleting the key when it's
undefined (user never touched).
2026-04-04 11:01:40 -07:00
Yuneng Jiang
1e414b5da5
chore: update Next.js build artifacts (2026-04-04 17:55 UTC, node v22.16.0) 2026-04-04 10:55:40 -07:00
Ryan Crabbe
fba3bbe47a
test(ui): add regression test for vector_store_ids edit-model bug
Verifies that saving an edit to a model without vector stores does not
inject vector_store_ids into the PATCH payload. The test fails against
the pre-fix handler (payload contains vector_store_ids: []) and passes
with the length-guard fix.
2026-04-04 10:42:47 -07:00
Ryan Crabbe
91d88737b4
fix(ui): don't overwrite vector_store_ids with empty array on model edit
The edit-model form initialized vector_store_ids to [] and then
unconditionally included it in the update payload. Editing any unrelated
field (e.g. temperature) on a model without vector stores would inject
vector_store_ids: [] into the model's litellm_params via the PATCH-merge
backend, which then propagated to inference requests and broke Anthropic
calls.

Mirror the cache_control_injection_points pattern directly below:
only include the field when length > 0, otherwise delete the key from
the payload so PATCH leaves the stored value untouched.
2026-04-04 10:29:02 -07:00
yuneng-jiang
fa9e3d82fc
Merge pull request #25119 from BerriAI/litellm_ryan-march-31
litellm ryan march 31
2026-04-04 10:24:24 -07:00
Ryan Crabbe
76c05913dd
chore: regen poetry.lock for litellm-proxy-extras 0.4.64 bump 2026-04-04 10:08:44 -07:00
Ryan Crabbe
ad81892f05
Merge remote-tracking branch 'origin/main' into litellm_ryan-march-31 2026-04-04 10:07:59 -07:00
Ryan Crabbe
ad203dc9a7
poetry 2026-04-04 09:58:55 -07:00
Ryan Crabbe
c495acda1b
fix(ui): send null (not '') for cleared organization_id on team update
AntD <Select allowClear> returns undefined when the user clears the
selection. Coalescing to "" caused the team-update payload to carry
organization_id: "" instead of null, relying on the backend to coerce
it. Send null directly so the intent is explicit at the source.
2026-04-04 09:47:38 -07:00
Ryan Crabbe
866c4a25ff
test(ui): update tests to match new team_id / access-group signatures
- useKeyAliases, PaginatedKeyAliasSelect: add trailing `undefined` to
  spy matchers for the new `team_id` param on `useInfiniteKeyAliases`
  and `keyAliasesCall`.
- EntityUsage: mock new `TeamMultiSelect` child so QueryClientProvider
  is not required for team-entity tests.
- ModelsCell: replace the overflow-accordion test with one that
  verifies the new collapse-on-`all-proxy-models` behavior (no
  accordion, single badge).
2026-04-04 09:47:34 -07:00
Ryan Crabbe
ce219fcc96
refactor(proxy): extract helpers to fix PLR0915 violations
Extract `_apply_non_admin_alias_scope` from `key_aliases`,
`_resolve_team_access_group_resources` from `team_info`, and
`_enforce_list_team_v2_access` from `list_team_v2` to bring each
function under ruff's 50-statement limit. No behavior changes.
2026-04-04 09:36:32 -07:00
Yuneng Jiang
f53db7f113
Merge remote-tracking branch 'origin/main' into litellm_ui_e2e_psql_pr 2026-04-03 23:49:39 -07:00
Yuneng Jiang
8a0ddd46d5
[Test] UI - Add Playwright E2E tests with local PostgreSQL
Add a self-contained Playwright E2E test suite that runs against a local
PostgreSQL database instead of Neon. Tests cover role-based access for all
5 user roles (proxy admin, admin viewer, internal user, internal viewer,
team admin) and authentication flows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 23:47:17 -07:00
yuneng-jiang
a5322c6efc
Merge pull request #24815 from joereyna/feat/re-add-codecov-ci
Fix broken codeql-action SHA in scorecard workflow
2026-04-03 20:59:47 -07:00
michelligabriele
4c1ef4234d
feat(ui): add guardrails support to project create/edit forms (#25100) 2026-04-03 20:41:24 -07:00
michelligabriele
a292add9bd
fix(a2a): preserve JSON-RPC envelope for AgentCore A2A-native agents (#25092) 2026-04-03 20:25:32 -07:00
michelligabriele
f74cd07419
feat(proxy): add project-level guardrails support (#25087) 2026-04-03 20:20:44 -07:00
ishaan-berri
127149c263
bump litellm-proxy-extras to 0.4.64 (#25121)
* bump litellm-proxy-extras version to 0.4.64

* bump litellm-proxy-extras==0.4.64 in requirements.txt

* bump litellm-proxy-extras==0.4.64 in pyproject.toml
2026-04-03 17:46:06 -07:00
ryan-crabbe-berri
0331fb5a8f
Merge pull request #25027 from BerriAI/litellm_add-access-group-to-model
feat(teams): resolve access group resources in team endpoints
2026-04-03 17:22:47 -07:00
Ryan Crabbe
93369bf60d
perf(teams): batch-fetch access groups in single DB query
Replace per-ID _resolve_access_group_resources loop with a single
find_many call that deduplicates IDs across all teams. Removes the
N+1 query pattern on cold cache for the team list endpoint.
2026-04-03 17:13:56 -07:00
Ryan Crabbe
bb03a11d7c
fix(ui): add missing access_group fields to TeamData.team_info type
The TeamData interface was missing access_group_models,
access_group_mcp_server_ids, and access_group_agent_ids fields,
causing a TypeScript build failure.
2026-04-03 16:59:47 -07:00
Ryan Crabbe
3bdd042507
fix(ui): remove model source legend from team detail view
The blue/green color distinction is self-explanatory; the legend added
visual clutter without providing enough value.
2026-04-03 16:49:55 -07:00
Ryan Crabbe
ea32cb58a8
fix: use direct attribute access with or [] fallback in _resolve_access_group_resources
Replace getattr(ag, "field", []) with ag.field or [] for cleaner
access and safe handling if a field is None.
2026-04-03 16:20:54 -07:00
Ryan Crabbe
38f6c9491d
fix(tests): correct mock targets in TestResolveAccessGroupResources
Three tests were patching the non-existent `get_access_object` instead
of `_get_access_object` (the lazy-import wrapper), causing AttributeError.
Also added missing `prisma_client` mock so tests get past the early-exit
guard and actually exercise the resolution logic.
2026-04-03 16:16:55 -07:00
ryan-crabbe-berri
eb780a85bb
Merge pull request #25032 from BerriAI/litellm_docs-default-team-params
docs: document default_team_params in config reference
2026-04-03 16:07:46 -07:00
ryan-crabbe-berri
20077fe478
Merge pull request #25095 from BerriAI/litellm_fix-ui-update-org-teams
fix(ui): allow changing team organization from team settings
2026-04-03 16:07:09 -07:00
ryan-crabbe-berri
0575c3f96c
Merge pull request #25107 from BerriAI/litellm_fix-team-id-search-filter
fix(ui): add paginated team search to usage page filter
2026-04-03 16:06:47 -07:00
ryan-crabbe-berri
1521004462
Merge pull request #25114 from BerriAI/litellm_fix-virtual-keys-team-filter-alias-dropdown
fix(ui): wire team_id filter to key alias dropdown on Virtual Keys tab
2026-04-03 16:06:03 -07:00
Ryan Crabbe
96b660b257
fix(ui): wire team_id filter to key alias dropdown on Virtual Keys tab
The Key Alias dropdown on the Virtual Keys page was showing aliases from
all teams regardless of which team was selected. The team_id was never
passed through the frontend chain to the backend /key/aliases endpoint.

- Backend: add optional team_id query param to /key/aliases endpoint
- networking.tsx: add team_id param to keyAliasesCall
- useKeyAliases: accept and forward team_id to API call and query key
- filter.tsx: pass allFilters context to custom filter components
- PaginatedKeyAliasSelect: read Team ID from allFilters and pass to hook
2026-04-03 15:38:16 -07:00
yuneng-jiang
48d4dec5c6
Merge pull request #25112 from BerriAI/worktree-vast-swinging-goose
bump: version 1.83.1 → 1.83.2
2026-04-03 15:24:24 -07:00
Ishaan Jaffer
a86f19f6da
bump: version 1.83.1 → 1.83.2 2026-04-03 15:08:14 -07:00
ishaan-berri
c6aa3ea452
Litellm ishaan april1 try2 (#25110)
* Litellm ishaan april1 (#25103)

* fix(proxy): enforce upperbound key params on key/update and add custom_key_update hook

The /key/update endpoint did not enforce upperbound_key_generate_params,
allowing users to bypass configured limits (tpm_limit, rpm_limit,
max_budget, duration, budget_duration) by updating an existing key
instead of generating a new one.

Extract the upperbound enforcement logic from _common_key_generation_helper()
into a standalone _enforce_upperbound_key_params() function and call it from
both the generate and update paths. For updates, None values are skipped
(not filled with defaults) since they mean "don't change this field".

Also adds a custom_key_update config option and user_custom_key_update global,
mirroring the existing custom_key_generate pattern, so custom key validation
logic can fire during key updates as well.

* fix(proxy): invoke custom_key_update hook in bulk update path

The user_custom_key_update hook was only called in update_key_fn
(single key update) but not in _process_single_key_update (bulk
update path), allowing custom validation to be bypassed via the
/key/update/bulk endpoint. Mirror the hook invocation in both paths.

* fix(proxy): pass UpdateKeyRequest to hook in bulk path, not BulkUpdateKeyRequestItem

Move the custom_key_update hook invocation to after UpdateKeyRequest
is constructed so the hook receives the same type in both single and
bulk update paths. Previously the bulk path passed
BulkUpdateKeyRequestItem (5 fields only), which would cause
AttributeError for hooks accessing fields like tpm_limit or models.

* fix(bedrock): promote cache usage to message_delta for Claude Code (#24850)

Ensure Bedrock/Anthropic-compatible streaming exposes cache usage where Claude Code reads it by promoting message_stop usage onto message_delta and preserving usage fields in fake-streamed message_delta events.

Made-with: Cursor

* fix(search): Support self-hosted Firecrawl response format in search transform (#24866)

The `transform_search_response` method only handled Firecrawl Cloud (v2)
response format where `data` is a dict with `web`/`news` keys. Self-hosted
Firecrawl (v1) returns `data` as a flat list of result objects, causing an
`AttributeError: 'list' object has no attribute 'get'`.

Detect the response format by checking if `data` is a list (self-hosted)
or dict (cloud) and handle both cases.

Cloud format:  {"data": {"web": [...], "news": [...]}}
Self-hosted:   {"success": true, "data": [{"url": "...", "title": "...", ...}]}

Co-authored-by: Synergy <synergyoclaw@gmail.com>

* feat: add environment and user tracking to prompt management (#24855)

* feat: add environment and user tracking to prompt management

- Add environment (development/staging/production) and created_by columns to LiteLLM_PromptTable
- Update unique constraint to [prompt_id, version, environment]
- All CRUD endpoints support environment filtering and user tracking
- Redesigned prompt detail page with environment tabs and version history
- UI: environment filter on list page, environment selector in editor
- 8 new tests for environment and user tracking

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: Black formatting and add environments to PromptInfoResponse TypeScript type

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address Greptile review findings

- P1: delete_prompt scopes in-memory cleanup to environment when provided
- P2: dotprompt_content parsed directly regardless of environment flag
- P2: use distinct for environments query
- P2: fix double-fetch on initial mount in prompt_info.tsx
- fix: remove unsupported select kwarg from find_many

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: address remaining Greptile review comments

- Remove unused useCallback import (index.tsx)
- Remove unused ENV_COLORS variable (prompt_info.tsx)
- P1: in-memory fallback in get_prompt_versions now respects environment filter
- P1: reset selectedEnv when promptId changes to avoid stale state
- Cyclic imports are pre-existing pattern, not introduced by this PR

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: scope patch_prompt to environment using primary key

- Add environment query param to patch_prompt endpoint
- Look up target row by composite key (prompt_id + version + environment)
- Update by primary key (id) to target exactly one row
- Fixes Greptile finding: patch with multiple environments no longer ambiguous

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: use actual start_time for failed request spend logs (#24906)

async_post_call_failure_hook set both start_time and end_time to
datetime.now(), making all failed requests show duration=0. Use the
actual start_time from litellm_logging_obj instead, so spend logs
reflect the real request duration on timeout and other failures.

Fixes #24888

* feat(bedrock): add nova canvas image edit support (#24869)

* feat(bedrock): add nova canvas image edit support

* fix(bedrock): support PathLike inputs for nova image edit

* chore: sync schema.prisma copies from root

* fix(mypy): correct type-ignore code for delta_usage arg-type

* fix(mypy): cast status_code to str, suppress intentional str yield

* fix(lint): extract _create_content_block_chunks to fix PLR0915

* fix(lint): extract helpers to fix PLR0915 in prompt endpoints

---------

Co-authored-by: michelligabriele <gabriele.michelli@icloud.com>
Co-authored-by: Sameer Kankute <sameer@berri.ai>
Co-authored-by: redhelix <amin.lalji@gmail.com>
Co-authored-by: Synergy <synergyoclaw@gmail.com>
Co-authored-by: Talha Anwar <37379131+talhaanwarch@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: madhu19991 <madhu@thunkai.com>
Co-authored-by: Srikanth @adobe <devarakondasrikanth@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix(test): update model armor streaming test to handle string or int error code

---------

Co-authored-by: michelligabriele <gabriele.michelli@icloud.com>
Co-authored-by: Sameer Kankute <sameer@berri.ai>
Co-authored-by: redhelix <amin.lalji@gmail.com>
Co-authored-by: Synergy <synergyoclaw@gmail.com>
Co-authored-by: Talha Anwar <37379131+talhaanwarch@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: madhu19991 <madhu@thunkai.com>
Co-authored-by: Srikanth @adobe <devarakondasrikanth@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-04-03 14:57:44 -07:00
Ryan Crabbe
1533f6896e
fix(ui): fix imports and update placeholder for team multi select 2026-04-03 14:36:46 -07:00
Ryan Crabbe
cd7b2620c7
fix(ui): add paginated team search to usage page filter
Replace the static team dropdown on the usage page with a new
TeamMultiSelect component that uses the paginated v2/team/list
endpoint with debounced server-side search and infinite scroll.
2026-04-03 13:59:46 -07:00
ishaan-berri
fc885af994
docs(blog): add security hardening April 2026 post (#25101) (#25102) 2026-04-03 13:06:14 -07:00
Ryan Crabbe
1bb726aa7a
fix(ui): only send organization_id when changed and use raw initial value 2026-04-03 12:15:45 -07:00
Ryan Crabbe
5a8f910fe3
add: making organizations a select instead of read only badges 2026-04-03 11:54:52 -07:00
joereyna
6cc56f58fd
Fix broken codeql-action SHA in scorecard workflow 2026-04-03 11:36:02 -07:00
Ryan Crabbe
a287154905
fix(ui): migrate guardrails tabs to antd and fix internal user view
- Replace Tremor TabGroup with antd Tabs (key-based matching) to fix
  blank content when conditional tabs are hidden for non-admins
- Skip /guardrails/submissions fetch for non-admin users via
  useAuthorized() hook (avoids 401 error)
- Move get_team_membership to inline import in register endpoint
- Non-admins default to Submitted Guardrails tab with Add Guardrail
  button visible
2026-04-03 09:34:29 -07:00
mubashir1osmani
d4a3a5e530
fix gpt-5.4 pricing (#24748) 2026-04-02 21:51:21 -07:00
yuneng-jiang
50f4fdea3e
bump: version 1.83.0 → 1.83.1 (#25054) 2026-04-02 21:43:42 -07:00
michelligabriele
a6dfd02610
fix(guardrails): return HTTP 400 instead of 500 for Model Armor streaming blocks (#24693)
When Model Armor blocks a streaming response, it correctly raises
HTTPException(status_code=400) but create_response() catches it with a
bare except Exception and hardcodes a 500 response, discarding the
original status code.

Fix create_response() to preserve status_code from HTTPException instead
of hardcoding 500. Also update Model Armor's streaming hook to yield an
SSE error event instead of raising (matching the Prisma Airs pattern),
and fix make_model_armor_request() to return 400 for upstream API
failures instead of passing through the upstream status code.
2026-04-02 21:28:52 -07:00