Commit Graph
34694 Commits
Author SHA1 Message Date
Joe ReynaandGitHub 36e04b6efe fix(tests): restore litellm_params=None on mock agent in a2a invoke test (#23125) 2026-03-09 07:16:02 -07:00
Joe ReynaandGitHub 0bc1bd6871 fix(tests): use AsyncMock for prisma find_unique in agent get-by-id test (#23122) 2026-03-09 07:13:50 -07:00
Sameer KankuteandGitHub ca4d4a0188 Merge pull request #23143 from giulio-leone/fix/gpt-5-4-pro-support
fix(models): set gpt-5.4-pro mode to responses — fixes #23014
2026-03-09 17:36:06 +05:30
Sameer KankuteandGitHub 20d911599c Merge pull request #23145 from BerriAI/litellm_publish_enterprise_pr_workflow
Fix enterpise bump yml
2026-03-09 17:28:07 +05:30
Sameer KankuteandGitHub b28d6eca67 Merge pull request #23144 from BerriAI/bump/enterprise-0.1.34
bump: litellm-enterprise 0.1.33 → 0.1.34
2026-03-09 16:44:12 +05:30
Sameer Kankute 0ee4d90d7e Fix enterpise bump yml 2026-03-09 16:43:40 +05:30
github-actions[bot] 6ff693149d bump: litellm-enterprise 0.1.33 → 0.1.34 2026-03-09 11:12:05 +00:00
Giulio Leone 556c64875e fix(models): set gpt-5.4-pro mode to responses instead of chat
gpt-5.4-pro and gpt-5.4-pro-2026-03-05 do not support the
/v1/chat/completions endpoint — OpenAI returns a 404 with
"This is not a chat model". These models are responses-only,
like o3-pro and o1-pro.

Changes:
- Set mode from "chat" to "responses" for both model entries
- Update supported_endpoints to ["/v1/responses", "/v1/batch"]
- Add regression test for responses API bridge routing

Fixes BerriAI/litellm#23014
2026-03-09 12:10:08 +01:00
Sameer KankuteandGitHub 7c668a8021 Merge pull request #23142 from BerriAI/litellm_publish_enterprise_pr_workflow
fix(enterprise): create PR for version bump instead of pushing to protected main
2026-03-09 16:39:58 +05:30
Sameer Kankute 4d92c720c7 Fix enterpise bump yml 2026-03-09 16:39:38 +05:30
Sameer Kankute a52a4fd28a fix(enterprise): create PR for version bump instead of pushing to protected main
Made-with: Cursor
2026-03-09 16:31:27 +05:30
Sameer KankuteandGitHub ba25d652e3 Merge pull request #23133 from BerriAI/litellm_fix_cicd_090326
Litellm fix cicd 090326
2026-03-09 16:14:16 +05:30
Sameer Kankute a8301d5614 Fix: varaitions endpoint geting 401 2026-03-09 12:51:21 +05:30
Sameer Kankute 4b1929ce93 Fix mistral ocr failing test 2026-03-09 11:29:33 +05:30
Sameer Kankute b20c0afb64 Fix test_anthropic_messages_openai_model_streaming_cost_injection & openrouter image gen 2026-03-09 11:29:04 +05:30
Sameer KankuteandGitHub 28b312f87a Merge pull request #22382 from davidvpe/add-gemini-3.1-flash-image-preview
[Feature] Add Gemini 3.1 Flash Image Preview pricing details
2026-03-09 09:02:31 +05:30
yuneng-jiangandGitHub 160e2d9642 Merge pull request #23098 from BerriAI/litellm_org_admin_team_fix
[Fix] UI - Agents: fix stale test assertions after AgentsPanel table refactor
2026-03-07 23:51:04 -08:00
yuneng-jiang 81b223138a fix(test): update agents.test.tsx for AgentsPanel table refactor
AgentsPanel no longer renders AgentCardGrid — it uses a Table directly.
The two tests that looked for agent-card-grid are updated to instead verify
the Actions column header appears for admins and is absent for non-admins.
2026-03-07 23:50:06 -08:00
yuneng-jiangandGitHub 5acb25fd9e Merge pull request #23095 from BerriAI/litellm_org_admin_add_user_e2e
[Feature] Org Admin Access to Team Management Endpoints
2026-03-07 23:29:38 -08:00
yuneng-jiangandClaude Opus 4.6 3a1ac964f7 fix: pass organization_ids=None in get_users test calls
When calling get_users() directly (not via FastAPI), Query() defaults
are not resolved. Pass organization_ids=None explicitly to avoid
'Query' object has no attribute 'split' error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-07 23:15:16 -08:00
yuneng-jiangandClaude Opus 4.6 70066426d0 fix: missing closing paren in agent_endpoints get_agents Query()
The `health_check` Query() call was missing its closing parenthesis,
causing a SyntaxError that blocked all proxy_server imports.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-07 23:13:42 -08:00
yuneng-jiangandClaude Opus 4.6 ac5128493e fix: repair test regressions from org admin auth changes
- test_get_users_*: pass proxy admin user_api_key_dict since get_users
  now calls _authorize_user_list_request which checks user_role
- test_validate_team_member_add_permissions_non_admin: set
  organization_id on mock team since _is_user_org_admin_for_team
  accesses it

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-07 23:10:53 -08:00
yuneng-jiangandClaude Opus 4.6 063198cf8e fix: push org filter into DB query for /team/list, fix agents.tsx build
- _authorize_and_filter_teams now uses Prisma WHERE clause
  (organization_id IN ...) instead of fetching the full team table
- Add missing Switch import in agents.tsx (pre-existing build error)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-07 23:04:08 -08:00
yuneng-jiang 8f33983389 Merge remote-tracking branch 'origin' into litellm_org_admin_add_user_e2e 2026-03-07 22:58:57 -08:00
yuneng-jiangandClaude Opus 4.6 f77b5a24c3 fix: resolve ruff PLR0915 and F401 lint errors
Extract _authorize_user_list_request and _authorize_and_filter_teams
helpers to reduce statement count in get_users and list_team. Remove
unused _is_user_team_admin import.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-07 22:49:26 -08:00
yuneng-jiangandClaude Opus 4.6 ce317148b9 feat: org admin access to team management — backend auth, UI visibility, tests
- Add _is_user_org_admin_for_team() reusable helper to common_utils.py
- Grant org admins access to /team/list, /team/info, /team/member_add,
  /team/member_delete, /team/member_update, /team/model/add,
  /team/model/delete, /team/permissions_list, /team/permissions_update
- Make validate_membership async with org admin fallback
- Add /user/list to self_managed_routes (endpoint handles own auth)
- UI: org admins see Members, Member Permissions, Settings tabs in team view
- UI: CreateUserButton uses useOrganizations() for org dropdown
- UI: org admin delete-member respects disable_team_admin_delete_team_user
- Add 16 unit tests for _is_user_org_admin_for_team, validate_membership,
  _user_is_org_admin route check, and privilege escalation prevention

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-07 22:43:09 -08:00
yuneng-jiangandClaude Sonnet 4.6 8bf3c0c67f fix: org admin invite user — multi-org selector, organizations list in POST body, auth check
- Thread org objects {organization_id, organization_alias} instead of bare IDs from
  users/page.tsx → view_users.tsx → CreateUserButton so the selector can show aliases
- Replace single-select org dropdown with multi-select; always shown when organizationIds
  is non-null; disabled/pre-selected for single-org admins; displays "Alias (id)"
- handleCreate: maps organization_ids → organizations before POST, removes redundant
  organizationMemberAddCall (backend _add_user_to_organizations handles it)
- _user_is_org_admin: also checks organizations list field in addition to singular
  organization_id so /user/new succeeds for org admins
- Add 5 backend unit tests for _user_is_org_admin and 2 frontend tests for new form behavior

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:34:12 -08:00
yuneng-jiangandClaude Sonnet 4.6 67884c279a fix: allow any authenticated user to call /user/available_roles
Org admins and team admins opening the invite-user modal could not see
the 4 global proxy roles because GET /user/available_roles has no
request body, so the org-admin route check (which requires
organization_id in the payload) always returned False and blocked them.

Add /user/available_roles to self_managed_routes so the route-access
check passes for any authenticated user. The endpoint's existing
Depends(user_api_key_auth) still requires a valid API key.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-07 20:11:35 -08:00
1c3787264b fix(bedrock): strip output_config from Bedrock Invoke requests (#23042)
* fix(bedrock): strip output_config from Bedrock Invoke requests

Bedrock Invoke API does not support the output_config parameter
(added to Anthropic Messages API). Requests with output_config cause
400 errors: 'extraneous key [output_config] is not permitted'.

Strip output_config in both Bedrock Invoke transformation layers
(messages and chat), consistent with how output_format is already
handled and how VertexAI strips both parameters.

Fixes: https://github.com/BerriAI/litellm/issues/22797

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test(bedrock): add output_config test for chat/invoke path

Addresses review feedback — the chat/invoke_transformations path now has
symmetric test coverage matching the messages/invoke_transformations path.

Fixes: https://github.com/BerriAI/litellm/issues/22797

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: giulio-leone <6887247+giulio-leone@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-07 19:33:53 -08:00
github-actions[bot]GitHubgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>
e156507ca7 chore: regenerate poetry.lock to match pyproject.toml (#23088)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-03-08 03:30:22 +00:00
Joshua BronsonandGitHub 5801f0b97f Don't pin to exact versions of optional deps (#23052) 2026-03-07 19:29:36 -08:00
52ae17746b docs: link dynamic TPM/RPM limiting to request prioritization doc (#22988)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-03-07 19:27:41 -08:00
cf439c269c Agents - add max budget + tpm/rpm limiting per agent AND per agent session (#22849)
* feat: enforce x-litellm-trace-id in header, if required

* feat: update spend for agent

* refactor: update agent table to follow similar format as other entities - also add a spend column - allows us to see spend of an agent

* fix: cleanup ui

* feat: return spend on agent endpoints

* feat: scope pr

* feat(agents/): support budgets + rate limiting on agents + agent sessions

* fix: address PR review feedback

- Add missing tpm_limit, rpm_limit, session_tpm_limit, session_rpm_limit
  columns to root schema.prisma to match proxy and extras schemas
- Add backwards-compatible fallback to key metadata for max_iterations
  so existing users don't silently lose enforcement

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: qa'ed RPM limiting on agents

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 19:12:42 -08:00
Krish DholakiaGitHubCursor AgentClaude Opus 4.6greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
03ca98123f Agents health checks (#23044)
* feat: add health check toggle to agents page

Backend:
- Add health_check query parameter to GET /v1/agents endpoint
- When health_check=true, performs concurrent GET requests to each agent's
  URL and filters out agents with unreachable URLs (5s timeout)
- Agents returning HTTP <500 are considered healthy; 5xx and connection
  errors mark agents as unhealthy

UI:
- Add Health Check toggle (Switch) to agents panel header
- Toggle triggers re-fetch with health_check=true, filtering the agent list
- Icon color changes (green/gray) to indicate toggle state
- Tooltip explains behavior: 'only agents with reachable URLs are shown'

Networking:
- Update getAgentsList to accept optional healthCheck boolean parameter

Tests:
- Backend: 9 new tests covering health check filtering, _check_agent_url_health
  helper (no URL, 200, 404, 500, connection error cases)
- UI: 3 new tests verifying toggle renders, initial fetch without health check,
  and fetch with health check after toggle click

Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>

* fix: fix greptile comment re: security issue

* fix: fix based on greptile feedback

* fix: align health check tests with implementation

- Rename test_should_return_unhealthy_when_no_url to
  test_should_return_healthy_when_no_url (implementation returns
  healthy=True for agents without a URL)
- Patch get_async_httpx_client instead of httpx.AsyncClient so mocks
  actually intercept the HTTP calls made by _check_agent_url_health
- Remove unnecessary __aenter__/__aexit__ context-manager mocks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* chore: undo _experimental/out renames from cherry-pick

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Update litellm/proxy/agent_endpoints/endpoints.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-03-07 18:32:47 -08:00
yuneng-jiangandGitHub 0a0c0d8017 Merge pull request #23080 from BerriAI/litellm_org_admin_invite_users
[Feature] UI - Internal Users: Allow Org Admins to View and Invite Users
2026-03-07 18:31:38 -08:00
e7714f0ce6 Fix CVEs: bump tar/minimatch/pypdf + harden Docker SBOM patching (#23082)
* fix(docker): bump tar/minimatch/pypdf for CVE fixes + harden SBOM patching

- Bump tar 7.5.8→7.5.10, minimatch 10.2.1→10.2.4, pypdf 6.6.2→6.7.3
- Add sed-based SBOM metadata patching with properly indented find/sed
- Add npm package manager cleanup (apk del / apt-get purge) to remove
  stale SBOM entries from image scanners
- Scope || true to only apk del via brace grouping { ... || true; }
- Guard npm root -g with non-empty assertion to prevent silent failures
- Scope minimatch sed regex to ^10.x to avoid matching other major versions

Addresses: CVE-2026-27903, CVE-2026-27904, GHSA-qffp-2rhf-9h96, CVE-2026-27888

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(docker): scope find to /usr/local/lib /usr/lib, drop autoremove

- Replace `find /` with `find /usr/local/lib /usr/lib` to avoid
  traversing /proc, /sys, /dev during SBOM metadata patching
- Remove `apt-get autoremove -y` from Debian-based Dockerfiles to
  prevent nodejs from being removed as an auto-installed dependency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 18:31:27 -08:00
yuneng-jiangandClaude Opus 4.6 fd29d15a64 fix: use comma-separated organization_ids param instead of repeated query params
UI sends organization_ids=org1,org2,org3 and backend parses the
comma-separated string, matching the existing pattern used elsewhere.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 18:30:59 -08:00
yuneng-jiangandClaude Opus 4.6 41d89ab84e fix: address review feedback for org admin user management
- Backend authorization: enforce server-side org scoping on /user/list.
  Non-proxy-admin callers must be org_admin; their permitted org IDs are
  fetched from the DB and intersected with any requested org filter.
- Race condition: gate userListQuery on org data being loaded for
  non-proxy-admin users (undefined = loading, null = no filter needed).
- Silent failure: surface organizationMemberAddCall errors via
  NotificationsManager instead of only console.error.
- Multi-org: org admins managing multiple orgs can choose which org to
  add the new user to via a dropdown (defaults to first org).
- Change organization_id param to List[str] (repeated query params)
  instead of comma-separated string.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 18:28:01 -08:00
yuneng-jiangandGitHub 9e531195ec Merge pull request #23057 from BerriAI/litellm_fix_user_filter_scope
[Fix] User Filter Scope - Make Org-Scoping Opt-In
2026-03-07 18:22:26 -08:00
yuneng-jiangandGitHub ec9791f72b Merge pull request #23085 from BerriAI/litellm_fix_team_info_test
[Fix] UI - Team: TeamInfo Virtual Keys Test Assertions
2026-03-07 18:20:09 -08:00
yuneng-jiangandClaude Haiku 4.5 efcde74711 fix(test): update TeamInfo virtual keys tests for removed member count display
Updates two tests in TeamInfo.test.tsx that were asserting for "X Members" text that was removed from the TeamVirtualKeysTable component in commit ec4ef9c924.

- Changed test "should display X Members in Virtual Keys tab when navigated to" to assert for pagination controls instead
- Changed test "should show Filters and pagination controls in Virtual Keys tab" to wait for Filters button instead of member count

All 29 tests now pass.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-07 18:10:49 -08:00
yuneng-jiangandClaude Opus 4.6 bd9fe1cd63 fix: improve error messages and extract helper to fix C901 complexity
- Extract _resolve_org_filter_for_user_search and _resolve_team_org_filter
  helpers from ui_view_users to bring complexity under the ruff C901 limit.
- Fix misleading error when a team admin searches but team has no org:
  now says "this team is not part of an organization" instead of the
  generic "only admins can search" message.
- Add distinct errors for team-not-found and not-a-team-admin cases.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:56:49 -08:00
Ishaan JaffandGitHub fc81edc4c4 revert: undo PR #22589 and follow-up vertex anyOf fixes (#23083)
* Revert "fix(vertex): drop bare {} schemas from anyOf before adding nullable=True (#23060)"

This reverts commit 3ad9a536d3.

* Revert "Merge pull request #22589 from Chesars/fix/vertex-preserve-any-type-schema"

This reverts commit da941e4261, reversing
changes made to f77f28a5f8.
2026-03-07 17:49:49 -08:00
yuneng-jiangandGitHub 906288a1b2 Merge pull request #23065 from BerriAI/litellm_fix_team_scoped_virtual_keys
fix: scoping virtual keys in the teams view to be applying the team filter
2026-03-07 17:43:25 -08:00
yuneng-jiangandClaude Opus 4.6 cb7da3044d feat: allow org admins to view Internal Users page and invite users
Org admins can now see the Internal Users page in the left nav, view
users scoped to their organization(s), and invite new users who are
automatically added to the org. Proxy admins remain unaffected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 17:40:29 -08:00
Ishaan JaffandGitHub 2b8db87a35 fix(pass_through): inject cost into Anthropic streaming chunks + fix SSE parsing in tests (#23078)
streaming_handler.py: EndpointType.ANTHROPIC was missing from the cost
injection block — only VERTEX_AI was handled, so Anthropic passthrough
streaming never got cost injected into message_delta chunks even with
include_cost_in_streaming_usage: true.

test_anthropic_passthrough.py: AnthropicResponsesStreamWrapper yields
full multi-line SSE frames as single bytes objects (e.g.
"event: message_delta\ndata: {...}\n\n"). The tests were checking
startswith('data: ') on the whole chunk, which starts with 'event:',
so every message_delta event was silently skipped. Fix: split each chunk
by \n before checking for the data: prefix. Also removes the
@pytest.mark.skip added with wrong diagnosis on the OpenAI model test.
2026-03-07 17:27:51 -08:00
yuneng-jiangandGitHub d1abe15bbe Merge pull request #23067 from BerriAI/litellm_fix_e2e_create_key
[Fix] Flaky E2E Tests for Create Key and Auth Redirect
2026-03-07 17:07:23 -08:00
Ishaan JaffandGitHub 517a929ccd fix(streaming): return None from count_reasoning_tokens when no reasoning content found (#23076)
Prevents spurious reasoning_tokens=0 from being injected into
completion_tokens_details for non-reasoning models (e.g. gpt-4o-audio-preview).

Previously count_reasoning_tokens always returned int (defaulting to 0),
so the if reasoning_tokens is not None guard in calculate_usage always
fired and wrote reasoning_tokens=0 into completion_tokens_details even
when the model never emitted any reasoning content. This caused
stream_chunk_builder to produce a usage dict with an extra
reasoning_tokens=0 field that was not in the original streaming chunk,
breaking the equality assertion in test_stream_chunk_builder_openai_audio_output_usage.

Fix: return Optional[int] -- None means no reasoning content seen,
0 means reasoning_content was present but counted zero tokens.
2026-03-07 17:03:53 -08:00
ryan-crabbeandGitHub ada8877aeb Merge pull request #23074 from BerriAI/litellm_fix_member_count_tests
tests: update tests to not assert member count text
2026-03-07 17:01:19 -08:00
Ishaan JaffandGitHub a30b71c946 fix(tests): generate square PNG in image_url fixture for DALL-E 2 variation test (#23073)
DALL-E 2 create_variation requires a square PNG. The old fixture fetched
the LiteLLM logo from S3 which is non-square, causing API rejections.
Replace with a programmatically-generated 1024x1024 RGBA PNG via Pillow.
2026-03-07 16:58:27 -08:00