Commit graph

39980 commits

Author SHA1 Message Date
harish-berri
ce087aa796 refactor(proxy): update documentation and code references for enable_redis_auth_cache
- Removed the deprecated enable_redis_auth_cache field from ConfigGeneralSettings.
- Updated references in proxy_server.py to use litellm_settings for enable_redis_auth_cache.
- Clarified documentation to reflect the new configuration structure and its impact on Redis integration for user_api_key_cache.
2026-04-24 23:44:57 +00:00
mateo-berri
68d4420233 fix(ci): strip trailing class segment from JUnit classnames before pytest
Pytest tests inside a class produce JUnit XML classnames like
'tests.local_testing.test_file_types.TestFileConsts' (module + class).
The previous awk preprocessor would convert this to
'tests/local_testing/test_file_types/TestFileConsts.py', which doesn't
exist, causing pytest to collect 0 items on rerun.

Strip a trailing '.<UppercaseSegment>' before the dot-to-slash
conversion. Module path segments are lowercase (test files start with
'test_'), and the class name is the only segment beginning with an
uppercase letter, so this is unambiguous.

Verified affected files in tests/local_testing/: test_file_types.py
(TestFileConsts), test_gcs_cache_unit_tests.py, test_disk_cache_unit_tests.py,
test_docker_no_network_on_deploy.py, test_sagemaker_nova_integration.py,
test_cache_preset_key.py.
2026-04-24 16:42:21 -07:00
Milan
69c5840e5f
Test cleanup of multiple expired UI session keys
Made-with: Cursor
2026-04-25 02:21:28 +03:00
Yuneng Jiang
ae9f12fb8a
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_yj_apr23 2026-04-24 16:13:52 -07:00
Milan
60f6a5dcfa
Tune expired UI session cleanup lock logging
Made-with: Cursor
2026-04-25 02:12:31 +03:00
yuneng-jiang
70a986e689
Merge pull request #26457 from BerriAI/litellm_enterpriseLicenseMetadata
[Infra] Declare proprietary license in litellm-enterprise metadata
2026-04-24 16:10:32 -07:00
ryan-crabbe-berri
c91a22a001
Merge pull request #26438 from BerriAI/litellm_fix-jwt-admin-bypass
fix(jwt-auth): apply team TPM/RPM + attribution for admins using x-litellm-team-id
2026-04-24 16:07:50 -07:00
ishaan-berri
7cf6a95b62
fix(vertex passthrough): log :embedContent and :batchEmbedContents responses (#26146)
* fix(vertex passthrough): log :embedContent and :batchEmbedContents responses

* test(vertex passthrough): add unit tests for :embedContent and :batchEmbedContents logging

* fix(vertex passthrough): extract input text from request body for embedContent token counting

* fix(vertex passthrough): add embedContent and batchEmbedContents to TRACKED_VERTEX_ROUTES

* fix(vertex passthrough): detect Google AI Studio URLs in embedContent handler

* test(vertex passthrough): add unit test for Google AI Studio URL embedContent provider detection

* style: black format vertex_passthrough_logging_handler
2026-04-24 16:07:11 -07:00
Milan
21cf42f568
Add expired UI session key cleanup job
Made-with: Cursor
2026-04-25 01:57:22 +03:00
Yuneng Jiang
ea5a34c59a
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_sendInviteEmailToggle 2026-04-24 15:34:34 -07:00
mateo-berri
c3338384c9 test: register supports_low_reasoning_effort in cost-map JSON schema
The strict 'additionalProperties: false' schema in
test_aaamodel_prices_and_context_window_json_is_valid rejected the new
flag added in this PR's earlier commit. Register it alongside the other
supports_*_reasoning_effort entries so the schema validation passes.
2026-04-24 15:33:30 -07:00
mateo-berri
94f8f12a00 feat(openai): add supports_low_reasoning_effort flag; reject low on gpt-5.5-pro
gpt-5.5-pro only accepts reasoning_effort in {medium, high, xhigh}
(verified live against OpenAI's API on 2026-04-24). LiteLLM previously
had no way to express this constraint — the existing JSON schema
covered none/minimal/xhigh but not low. Result: drop_params=true users
saw an avoidable 400 from OpenAI.

Add supports_low_reasoning_effort following the existing opt-out
pattern (default-allow, explicit false to block). Mirror the minimal
branch in OpenAIGPT5Config.map_openai_params so 'low' goes through the
same _is_reasoning_effort_level_explicitly_disabled gate.

Set the flag to false on gpt-5.5-pro and gpt-5.5-pro-2026-04-23 in
both model_prices JSON files (kept in sync). Other models leave the
key absent so behavior is unchanged.

Tests cover: rejection on pro variants (no drop_params), drop on pro
with drop_params=True, passthrough on gpt-5.5 chat, passthrough on
unknown models, and the helper-level _is_reasoning_effort_level_explicitly_disabled
contract.
2026-04-24 15:05:43 -07:00
Yuneng Jiang
5d8ef97fa1
chore(packaging): declare proprietary license in litellm-enterprise metadata
The enterprise package ships under the BerriAI Enterprise License defined
in enterprise/LICENSE.md, which is not an SPDX-listed license. Declare it
via PEP 639's LicenseRef-Proprietary expression so metadata-reading tools
(PyPI classifiers, Nexus IQ, pip-licenses) resolve it instead of reporting
License-None. The existing license-files entry already ships the full terms.
2026-04-24 14:56:28 -07:00
shin-berri
082a8faf46
Merge pull request #26454 from BerriAI/litellm_remove_docs_repo_moved
[Infra] Remove docs/my-website, point contributors to litellm-docs repo
2026-04-24 14:54:35 -07:00
Ryan Crabbe
a0bba43cea
fix(jwt-auth): soft-fail unresolvable x-litellm-team-id for admins
Previously, an admin JWT sending a stale/typo'd/missing x-litellm-team-id
on an LLM API route received a hard 404 from get_team_object, blocking the
request. Restore pre-PR admin behavior: if the header can't be resolved,
skip team attribution and proceed with admin access, logging a warning
with the header value and route so the misconfigured caller is diagnosable.
2026-04-24 14:31:36 -07:00
mateo-berri
34c93645e9 fix(openai): gpt-5.5 does not support reasoning_effort=minimal
Verified against OpenAI's live Chat Completions API on 2026-04-24:

  POST /v1/chat/completions
  {"model": "gpt-5.5", "reasoning_effort": "minimal", ...}
  -> 400 Unsupported value: 'reasoning_effort' does not support 'minimal'
     with this model. Supported values are: 'none', 'low', 'medium',
     'high', and 'xhigh'.

  POST /v1/chat/completions
  {"model": "gpt-5.5-pro", "reasoning_effort": "minimal", ...}
  -> 400 Unsupported value: 'minimal' is not supported with the
     'gpt-5.5-pro' model. Supported values are: 'medium', 'high', and
     'xhigh'.

Set supports_minimal_reasoning_effort=false on all four entries
(gpt-5.5, gpt-5.5-2026-04-23, gpt-5.5-pro, gpt-5.5-pro-2026-04-23) so
OpenAIGPT5Config._is_reasoning_effort_level_explicitly_disabled fires
and LiteLLM either drops the param (drop_params=True) or raises a
local UnsupportedParamsError, instead of round-tripping to OpenAI for
a 400.

Adds a parametrized test_gpt55_reasoning_effort_flags_match_live_openai_api
test that pins supports_{none,minimal,xhigh}_reasoning_effort on each
entry to OpenAI's actual API contract.

Note: gpt-5.5-pro additionally rejects 'none' and 'low'. 'none' is
already handled (supports_none_reasoning_effort=false). 'low' is not
representable in the current JSON schema (no supports_low flag);
filing separately.
2026-04-24 14:30:41 -07:00
Yuneng Jiang
d42281338e ci: check out litellm-docs directly into docs/my-website
Replaces the rm-and-symlink hack with a plain actions/checkout
using path: docs/my-website. The previous approach failed on this
branch because docs/my-website no longer exists in the repo (its
parent docs/ directory was also removed), so ln -s had nowhere
to create the symlink.

Also adds the same checkout step to test-unit-documentation.yml,
which was silently relying on docs/my-website existing in-tree
for test_env_keys.py and test_router_settings.py.
2026-04-24 14:21:18 -07:00
Yuneng Jiang
c35f3a50ae docs: remove docs/my-website, point contributors to litellm-docs
The documentation source has moved to a separate repository,
BerriAI/litellm-docs, served at docs.litellm.ai. This PR removes
docs/my-website/ from this repo and updates README.md, AGENTS.md,
and CLAUDE.md to direct doc contributions to the new repo.

Also fixes a broken relative link in
litellm/integrations/levo/README.md.

The existing CI symlink in .github/workflows/test-code-quality.yml
(which clones litellm-docs and symlinks docs/my-website to it for
tests/documentation_tests/*) continues to work without change.
2026-04-24 14:17:46 -07:00
Mateo Wang
d21e90f683
[Feat] Day-0 support for GPT-5.5 and GPT-5.5 Pro (#26449)
* feat(openai): day-0 support for GPT-5.5 and GPT-5.5 Pro

Add pricing + capability entries for the new GPT-5.5 family launched by
OpenAI on 2026-04-24:

- gpt-5.5 / gpt-5.5-2026-04-23 (chat): $5/$30/$0.50 per 1M
  input/output/cached input
- gpt-5.5-pro / gpt-5.5-pro-2026-04-23 (responses-only): $60/$360/$6
  per 1M input/output/cached input

Other fees (long-context >272k, flex, batches, priority, cache
discounts) follow the same ratios as GPT-5.4, with context window
retained at 1.05M input / 128K output.

No transformation / classifier code changes are required:
OpenAIGPT5Config.is_model_gpt_5_4_plus_model() already matches 5.5+ via
numeric version parsing, and model registration is driven from the
JSON. The existing responses-API bridge for tools + reasoning_effort
(litellm/main.py:970) already covers gpt-5.5-pro.

Tests:
- GPT5_MODELS regression list now covers gpt-5.5-pro and dated variants
- New test_generic_cost_per_token_gpt55_pro cost-calc test
- Updated test_generic_cost_per_token_gpt55 for long-context fields

* fix(openai): mirror reasoning_effort flags onto gpt-5.5 dated variants

gpt-5.5-2026-04-23 and gpt-5.5-pro-2026-04-23 were missing the
supports_none_reasoning_effort, supports_xhigh_reasoning_effort, and
supports_minimal_reasoning_effort flags that their non-dated
counterparts define. Reasoning-effort routing in OpenAIGPT5Config is
fully capability-driven from these JSON flags — since an absent flag
is treated as False for opt-in levels (xhigh), users pinning to a
dated snapshot would silently lose xhigh support and diverge from the
base alias on logprobs + flexible temperature handling.

Copy the flags onto both dated variants so every dated snapshot
inherits the base model's reasoning-effort capability profile.

Adds a parametrized regression test that asserts
supports_{none,minimal,xhigh}_reasoning_effort parity between each
dated variant and its non-dated counterpart, preventing future drift
when new snapshots are added.
2026-04-24 14:10:42 -07:00
Yuneng Jiang
b300dc3e54
Preserve UISettings docstring on effective class for GET schema
create_model does not inherit the base class docstring, so once an
extension registered a field the effective class had no description.
The UI renders schema.description as a header paragraph — losing it
broke the 'Configuration for UI-specific flags' text. Pass __doc__
through explicitly and add a regression test.
2026-04-24 13:56:59 -07:00
mateo-berri
ed0a965208 fix(ci): convert dot-notation test paths to file paths for CircleCI rerun
CircleCI's 'Rerun failed tests' feature passes test identifiers from the
JUnit XML classname attribute (dot notation, e.g.
'tests.local_testing.test_router') via stdin. pytest receives these paths
and collects 0 items, causing the rerun to exit 123 with no tests run.

Add an awk preprocessor before xargs that detects dot-notation module
paths and converts them to file paths (tests/local_testing/test_router.py).
File paths already containing '.py' are passed through unchanged.

Applied to all three jobs using the 'circleci tests run' + 'xargs pytest'
pattern: local_testing_part1, local_testing_part2, and the router test job.
2026-04-24 13:40:02 -07:00
Ryan Crabbe
e1bb542556
chore: fix linting (ruff PLR0915, black) on admin team-header fix
Extract the admin team-header attachment into a helper so
auth_builder stays under the 50-statement lint threshold; apply
black formatting to the two files flagged on the prior commit.
No behavior change.
2026-04-24 13:38:28 -07:00
Yuneng Jiang
85b6cae508
Type _get_effective_ui_settings_class as Type[UISettings] for mypy 2026-04-24 13:19:02 -07:00
Yuneng Jiang
32d4ae79f6
Validate UI settings PATCH body against effective class
GET /get/ui_settings returns a schema built from the effective UISettings
class (base + enterprise-registered fields), but PATCH /update/ui_settings
declared its body as the base UISettings. Enterprise fields still worked
via extra="allow", but the OpenAPI schema was asymmetric between GET and
PATCH.

Accept the body as a dict and validate with the effective class so both
sides are in sync and enterprise-registered fields are type-checked.
2026-04-24 13:09:16 -07:00
yuneng-jiang
51d4c6c2f2
Merge pull request #26274 from stuxf/fix/mcp-byok-oauth-auth
fix(mcp): harden OAuth authorize/token endpoints (BYOK + discoverable)
2026-04-24 13:05:44 -07:00
yuneng-jiang
29ca1dc1f9
Merge pull request #26279 from stuxf/fix/post-auth-enforcement
fix(auth): centralize common_checks to close authorization bypass
2026-04-24 13:04:29 -07:00
yuneng-jiang
1a3db6dfa4
Merge pull request #26365 from stuxf/fix/deps-security-bumps
chore(deps): bump vulnerable dependencies
2026-04-24 13:02:58 -07:00
yuneng-jiang
3c3ef7ec9f
Merge pull request #26369 from stuxf/fix/license-metadata
chore(packaging): declare MIT license in litellm-proxy-extras metadata
2026-04-24 13:01:52 -07:00
Yuneng Jiang
e7f4e77af0
Bound _get_masked_values recursion depth
Add _depth/_max_depth guards (default 20) so the nested dict masking
cannot run away, and allowlist the function in the recursive_detector
CI check alongside the other bounded recursive helpers.
2026-04-24 13:00:33 -07:00
Yuneng Jiang
d747e4c248
Remove stale test_project_endpoints_prisma.py path from proxy-db workflow
The file was moved to tests/enterprise/litellm_enterprise/proxy/management_endpoints/
and is covered by the CircleCI litellm_mapped_enterprise_tests job. The stale path
was causing pytest to error with 'file or directory not found'.
2026-04-24 12:52:51 -07:00
Yuneng Jiang
000ce70127
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_migration_projects
# Conflicts:
#	litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py
#	uv.lock
2026-04-24 12:52:10 -07:00
Yuneng Jiang
96ba35eed4
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_guardrail_param_masking 2026-04-24 12:49:14 -07:00
shin-berri
ca443a957c
Merge pull request #24374 from BerriAI/litellm_staging_03_22_2026
Litellm staging 03 22 2026
2026-04-24 12:38:47 -07:00
yuneng-jiang
9dd7e37530
Merge pull request #25359 from BerriAI/litellm_Sameerlite/openai-chat-to-responses
feat(openai): add route_all_chat_openai_to_responses global flag
2026-04-24 12:06:19 -07:00
user
fea402c580
fix(mcp): fail closed on DB outage in BYOK credential check
`_check_byok_credential` previously returned silently when `prisma_client`
was None, bypassing BYOK ownership validation during database-outage
windows. Any proxy-authenticated user could invoke BYOK-protected MCP
tools without a stored credential during the outage window.

Now raises HTTP 503 with a structured error so the flow fails closed.

Regression test asserts 503 is raised when `prisma_client` is None.

Reported by @brodmart in GHSA-6762-2m23-5mxp.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 18:44:57 +00:00
Yuneng Jiang
1b07ef9e72
fix: apply team scoping to in-memory-only guardrails in list endpoint 2026-04-24 11:36:12 -07:00
Ryan Crabbe
f9bce31a79
type: narrow _ORG_ADMIN_FEATURE_LABELS annotation to dict[str, str] 2026-04-24 10:18:35 -07:00
Ryan Crabbe
4cdcd87bd6
feat: add UI settings to restrict org admins from creating keys, teams, models
Adds three new UISettings flags gated by check_org_admin_feature_access:
- disable_key_generate_for_org_admin
- disable_team_create_for_org_admin
- disable_model_add_for_org_admin

When enabled by a proxy admin, users with the ORG_ADMIN role receive a 403
on /key/generate, /team/new, and /model/new respectively. All other roles
(proxy admin, internal user, team) are unaffected and continue through
their existing auth checks. Flags are persisted to litellm_uisettings and
synced into general_settings via _RUNTIME_GENERAL_SETTINGS_FLAGS so the
enforcement helper can read them at request time.
2026-04-24 10:18:35 -07:00
yuneng-jiang
09f0a3380f
Merge pull request #26362 from BerriAI/litellm_fix_proxy_test_master_key_leak
[Fix] Tests - Proxy: Isolate master_key/prisma_client module globals between tests
2026-04-24 10:04:09 -07:00
Sameer Kankute
a0c52cda6e
docs(proxy): clarify x-litellm-model-group vs provider model id (#25497)
Made-with: Cursor
2026-04-24 16:59:03 +00:00
yuneng-jiang
8dda834cf9
Merge pull request #25842 from BerriAI/litellm_docs-gemini3-thinking-defaults
docs(gemini): Gemini 3 thinking_level defaults and release note
2026-04-24 09:45:24 -07:00
yuneng-jiang
023dad5bde
Merge pull request #25932 from BerriAI/litellm_docs-code-block-padding-parity
feat(docs): align fenced code block padding on blog and doc pages
2026-04-24 09:45:08 -07:00
yuneng-jiang
61ad127a75
Merge pull request #25935 from BerriAI/litellm_anthropic-stream-strip-gemini-thought-tool-id
fix(anthropic): strip Gemini thought suffix from streaming tool_use id
2026-04-24 09:43:27 -07:00
yuneng-jiang
4e3feda952
Merge pull request #26221 from BerriAI/litellm_responses_strip_custom_tool_call_namespace
feat(responses): strip custom_tool_call namespace for all providers
2026-04-24 09:42:55 -07:00
yuneng-jiang
d73b790cae
Merge pull request #26248 from BerriAI/litellm_anthropic_messages_call_type_fix
fix(proxy): preserve anthropic_messages call type for /v1/messages logging
2026-04-24 09:42:36 -07:00
Ryan Crabbe
6ea95a6379
fix(jwt-auth): apply team TPM/RPM + attribution for admins using x-litellm-team-id
Scope the header-driven team fetch to LLM API routes so admin
management routes keep the pre-existing bypass behavior (no
phantom teams, no 404s on mgmt calls). Team context is threaded
onto UserAPIKeyAuth so spend logs, rate limits, and team_models
attribution are correctly applied when admins act on behalf of
a team via x-litellm-team-id.
2026-04-24 09:40:59 -07:00
Yuneng Jiang
4d5c3476a4
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_docs-gemini3-thinking-defaults 2026-04-24 09:40:04 -07:00
Yuneng Jiang
b2afc70080
Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_docs-code-block-padding-parity 2026-04-24 09:39:06 -07:00
yuneng-jiang
78d171b2b9
Merge pull request #26115 from BerriAI/litellm_gpt54_mini_nano_versioned_models
feat(models): add versioned GPT-5.4 mini/nano snapshots
2026-04-24 09:34:55 -07:00
harish-berri
a9761e1e74 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_token_verification_query_opt 2026-04-24 16:31:10 +00:00