Commit graph

39980 commits

Author SHA1 Message Date
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
Marty Sullivan
52a596d2a4
Bedrock Model Updates 2026-03-26 (#24645)
* add new bedrock models & remove duplicate vertexai entry

* adding non-regional entry for minimax-2.5
2026-04-02 21:26:04 -07:00
ishaan-berri
1e5b79d887
[Bedrock] Fix Anthropic file_id support - async path + document URL→base64 + beta header filtering (#25047) (#25050)
Co-authored-by: Ishaan Jaffer <ishaanjaffer0324@gmail.com>
2026-04-02 21:13:56 -07:00
Joe Reyna
ee3e848ded
allow hashed token_id in /key/update endpoint (#24969) 2026-04-02 21:13:33 -07:00
Ryan Crabbe
adb7454f85
fix: address review feedback on guardrail registration
- Make team_id optional again, fall back to API key's team_id
  (preserves backwards compatibility)
- Add PROXY_ADMIN bypass for team membership check
  (admins can register guardrails for any team)
- Move get_team_membership import to module level
- Prevent extra_litellm_params spread from overwriting controlled
  fields (guardrail, mode, api_base) by spreading extras first
2026-04-02 18:08:22 -07:00
Ryan Crabbe
0d602857af
feat: wire guardrail submission to backend and allow internal user access
Backend:
- Add required team_id to RegisterGuardrailRequest body
- Validate team membership before allowing submission

Frontend:
- Add useRegisterGuardrail React Query mutation hook
- Wire form onFinish to mutation, pass team_id from dropdown
- Remove admin-only restriction on guardrails nav item
- Internal users see only Test Playground + Submitted Guardrails tabs
- Admins continue to see all 4 tabs
2026-04-02 18:00:58 -07:00
yuneng-jiang
4094801b3c
Merge pull request #25037 from BerriAI/litellm_fix_non_root_docker_build
[Fix] Dockerfile.non_root: install node-gyp for npm ci
2026-04-02 17:52:27 -07:00
Ryan Crabbe
fe8cc100de
feat: wire submit guardrail form to POST /guardrails/register
Backend:
- Add required team_id to RegisterGuardrailRequest body
- Validate team membership before allowing submission

Frontend:
- Add useRegisterGuardrail React Query mutation hook
- Wire form onFinish to mutation, pass team_id from dropdown
- Show notification and refresh submissions on success
2026-04-02 17:51:17 -07:00
Yuneng Jiang
d4813a2a0f
adding poetry lock 2026-04-02 17:31:16 -07:00
Yuneng Jiang
fa629c307c
[Fix] Dockerfile.non_root: install node-gyp for npm ci
The wolfi-base npm@11.12.1 package does not bundle node-gyp, causing
`npm ci` to fail with `Cannot find module 'node-gyp/bin/node-gyp.js'`
when building the Admin UI in the non-root Docker image.

Install node-gyp@12.2.0 globally and symlink it into npm's internal
node_modules where @npmcli/run-script expects to find it.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 17:29:47 -07:00
Ryan Crabbe
7a27434f89
feat(ui): add submit guardrail form to Submitted Guardrails tab
Wire the placeholder "Add Guardrail" button to open an antd Modal+Form
with team selector, guardrail name, mode, API base URL, optional extra
litellm_params JSON, and optional guardrail_info JSON. Backend call is
stubbed with a TODO for now.
2026-04-02 17:21:54 -07:00
yuneng-jiang
3604b600d3
[Infra] Merge internal dev branch with main (#25036)
* fix(proxy): enforce key-level model allowlist for custom auth

custom_auth_run_common_checks only runs common_checks (team/user/project model checks).
Custom auth now also enforces key-level model restrictions via can_key_call_model.

Move the custom-auth key-access regression tests to test_user_api_key_auth.py and keep test_custom_auth_end_user_budget.py focused on end-user budget behavior.

Made-with: Cursor

* fix(proxy): gate custom-auth key model checks behind opt-in

Keep key-level model allowlist enforcement in custom auth behind `custom_auth_run_common_checks` to preserve backwards compatibility, and update tests to verify default non-enforcement and opt-in enforcement behavior.

Made-with: Cursor

* test(proxy): isolate custom auth default check from shared settings state

Patch `proxy_server.general_settings` to an empty dict in the default custom-auth key-access test so it remains deterministic under shared module state.

Made-with: Cursor

* test(proxy): strengthen custom auth post-check assertions

Tighten custom auth regression tests by asserting exact can_key_call_model args and remove an unused common_checks mock from the default behavior path.

Made-with: Cursor

* fix(agentcore): parse A2A JSON-RPC responses in AgentCore provider

* fix(prompt-templates): ensure_alternating_roles handles tool-call chains

* feat(auth): add JWT claim routing overrides for OAuth2 validation

Made-with: Cursor

* docs(auth): document JWT-to-OAuth2 routing overrides

Add generic docs for running JWT and OAuth2 together, including routing_overrides YAML examples and list-based selector behavior for iss/client_id/aud.

Made-with: Cursor

---------

Co-authored-by: Milan <milan@berri.ai>
Co-authored-by: michelligabriele <gabriele.michelli@icloud.com>
2026-04-02 16:38:01 -07:00
shin-berri
f11cdf7934
Merge pull request #25034 from BerriAI/extras_apr2
[Infra] Bump extras version
2026-04-02 16:18:10 -07:00
Ryan Crabbe
f0bd33486e
fix: lazy import get_access_object to break cyclic import + short-circuit all-proxy-models display
- Remove get_access_object from module-level import in team_endpoints.py
  and use a lazy _get_access_object wrapper to avoid cyclic dependency
- Add _prisma_client is None early-exit guard in _resolve_access_group_resources
- Short-circuit UI to show "All Proxy Models" when team.models is empty
  or contains "all-proxy-models", skipping access group model resolution
2026-04-02 16:14:34 -07:00
Yuneng Jiang
3ad953e75c
bump: version 0.4.62 → 0.4.63 2026-04-02 16:10:32 -07:00
Ryan Crabbe
c19a63e2bf
docs: clarify that models sub-field only applies to SSO auto-created teams 2026-04-02 16:00:20 -07:00
David Chen
b7ccc5b691
[Test Fix] fix gov pricing tests (#25022)
* fix pricing tests

* fix mypy

* fix cost expectation since us based model is used now.

* fix test get model info
2026-04-02 15:55:55 -07:00
Ryan Crabbe
59b09102b9
docs: add default_team_params to config reference and update examples
- Add default_team_params to litellm_settings reference table in
  config_settings.md with all sub-fields documented
- Update self_serve.md and msft_sso.md examples to include
  team_member_permissions, tpm_limit, and rpm_limit
- Fix misleading comment that implied default_team_params only applies
  to SSO auto-created teams — it applies to all /team/new calls
2026-04-02 15:51:28 -07:00
Krrish Dholakia
06df8edf92
docs: cleanup (#25026) 2026-04-02 15:18:24 -07:00
Ryan Crabbe
bbe708b093
perf(teams): single-pass access group resolution + asyncio.gather in list endpoint
- Fetch each access group object once and extract all 3 resource fields
  in a single pass instead of 3 separate calls (3N → N lookups)
- Use asyncio.gather to resolve access groups across teams concurrently
  in list_team_v2 instead of sequential awaits
- Add 5 unit tests for _resolve_access_group_resources
2026-04-02 14:52:32 -07:00
yuneng-jiang
9c5fda435f
Merge pull request #25023 from BerriAI/litellm_/fervent-noether
[Infra] Harden supply chain: remove unused scripts, add pip binary-only install
2026-04-02 14:49:09 -07:00
Yuneng Jiang
51af6fedb3
[Infra] Harden supply chain: remove unused scripts, add pip binary-only install
Remove ci_cd/publish-proxy-extras.sh (dead, unreferenced PyPI publish script)
and .pre-commit-config.yaml (pulls external repos from GitHub on git commit).
Add --only-binary :all: to scripts/install.sh to prevent execution of
malicious setup.py during pip install.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 14:13:57 -07:00
Krrish Dholakia
cae8613660
Announce April Townhall (#25021)
* fix: replace hardcoded url

* docs: announce april townhall
2026-04-02 14:10:49 -07:00
yuneng-jiang
068e6e2a9e
Merge pull request #24951 from BerriAI/litellm_remove_neon_cli
[Fix] Remove Neon CLI and Pin All JS Dependencies
2026-04-02 12:47:46 -07:00
Ryan Crabbe
f62658795a
feat(teams): resolve access group models/MCPs/agents in team endpoints
Add access_group_models, access_group_mcp_server_ids, and
access_group_agent_ids to /team/info and /v2/team/list responses.
These fields contain resources inherited from access groups, kept
separate from direct assignments so the UI can distinguish the source.

Backend: _resolve_access_group_resources() helper resolves access
group resources via existing _get_*_from_access_groups() functions.

UI: Teams table and detail view show direct models as blue badges
and access-group-sourced models as green badges.
2026-04-02 12:25:48 -07:00
Sameer Kankute
ec004a54e9
feat(vertex_ai): propagate metadata labels to embedding, Imagen, rerank
- Add pop_vertex_request_labels / vertex_request_labels_from_litellm_params in common_utils
- Vertex embeddings: pass litellm_params, set predict body labels; Gemini uses shared helper
- Imagen: top-level labels from metadata; rerank: userLabels for Discovery Engine Rank API
- Thread litellm_params through rerank handler and all BaseRerankConfig implementations

Made-with: Cursor
2026-04-02 09:56:56 +05:30