Commit Graph
37403 Commits
Author SHA1 Message Date
yuneng-jiangandGitHub 643e941b64 Merge pull request #26026 from BerriAI/litellm_fixPrometheusHelpersPackageCollision
[Fix] Resolve prometheus_helpers file/package shadow breaking /global/spend/logs
2026-04-18 13:18:04 -07:00
Yuneng Jiang cfdf893226 [Fix] Merge prometheus_helpers.py into prometheus_helpers/__init__.py to resolve file/package collision
A previous refactor added `litellm/integrations/prometheus_helpers.py` as a
sibling to the existing `litellm/integrations/prometheus_helpers/` directory
(which contains `prometheus_api.py` and has no `__init__.py`). The file
shadowed the namespace-package directory, so any deferred
`from litellm.integrations.prometheus_helpers.prometheus_api import ...`
raised `ModuleNotFoundError: 'litellm.integrations.prometheus_helpers' is
not a package` at request time.

Two runtime call sites hit that path:
- /global/spend/logs (spend_management_endpoints.py) returned plain-text 500
  "Internal Server Error" for every call, breaking the Admin UI Usage tab
  and programmatic consumers.
- SlackAlerting.send_fallback_stats_from_prometheus silently failed inside
  its own try/except.

Fix: move prometheus_helpers.py content into prometheus_helpers/__init__.py
and delete the stray .py. The directory becomes a regular package, so both
the package-root import (from ...prometheus_helpers import X) and the
submodule import (from ...prometheus_helpers.prometheus_api import X)
resolve correctly. No call sites change.
2026-04-18 13:04:32 -07:00
yuneng-jiangandGitHub 8e00f61026 Merge pull request #26023 from BerriAI/litellm_/eloquent-feistel-b346ec
[Fix] UI - Keys: strip empty premium fields from key update payload
2026-04-18 13:01:38 -07:00
Yuneng Jiang cae8b74b0b Fall back to top-level keyData when resolving previous premium value
Premium fields like policies are echoed at the top level of the
/key/update response, not necessarily mirrored into metadata. Read
metadata first then fall back to the top-level property so an
intentional clear is preserved in either shape.
2026-04-18 12:23:58 -07:00
Yuneng Jiang 2c41f3c291 [Fix] UI - Keys: strip empty premium fields from key update payload
The /key/update response echoes top-level defaults like policies:[] into
client state. On a subsequent edit, the form resends policies:[], which
the backend treats as "user is setting policies" and blocks with a 403
enterprise check regardless of value.

Drop premium metadata fields from the update payload when the current
form value and the previously persisted value are both empty. Genuine
clears (non-empty -> empty) still pass through so premium users can
clear policies as intended.
2026-04-18 12:17:45 -07:00
ryan-crabbe-berriandGitHub fc35c68108 Merge pull request #26003 from BerriAI/litellm_fix-extra-headers-not-persisting
fix(ui): extra_headers not persisting on MCP server edit
2026-04-18 12:08:35 -07:00
Shivam RawatandGitHub f870095f3f Merge pull request #25991 from BerriAI/litellm_persist_default_router_end_budget
Litellm persist default router end budget.
2026-04-18 11:52:20 -07:00
ishaan-berriandGitHub d03c301c79 Merge pull request #25936 from BerriAI/litellm_health-check-reasoning-tokens
fix(proxy): prioritize reasoning health-check max token precedence
2026-04-18 11:35:04 -07:00
ishaan-berriandGitHub f476447875 Merge pull request #25846 from BerriAI/litellm_bedrock_cache_start_negative_cost
fix(bedrock): prevent negative streaming costs for start-only cache usage
2026-04-18 11:30:07 -07:00
Ishaan Jaffer 6bf90fb10a fix(mypy): cast msg and pending_delta in _promote_message_stop_usage to resolve union-attr and assignment errors 2026-04-18 10:37:30 -07:00
ishaan-berriandGitHub 319839d8d6 Merge pull request #25494 from jlav/jl/helm-tpl-extra-containers
feat(helm): add tpl support to extraContainers and extraInitContainers
2026-04-18 10:31:37 -07:00
ishaan-berriandGitHub d042b4418a Merge pull request #25929 from BerriAI/litellm_pages_support_for_ocr
feat(ocr/azure-di): support Mistral-style pages param via analyze query string
2026-04-18 10:26:59 -07:00
ryan-crabbe-berriandGitHub 55d3229a63 Merge pull request #25879 from BerriAI/litellm_chore-migrate-router-settings-page-off-of-tremor
chore(ui): migrate router_settings page from Tremor to antd
2026-04-18 10:23:10 -07:00
ryan-crabbe-berriandGitHub 2a76f10991 Merge pull request #25749 from BerriAI/litellm_chore-migrate-guardrail-test-playground-off-tremor
chore(ui): migrate GuardrailTestPlayground off @tremor/react to antd
2026-04-18 10:14:47 -07:00
Ryan Crabbe 545db8c4e1 Merge remote-tracking branch 'origin/main' into litellm_chore-migrate-router-settings-page-off-of-tremor 2026-04-18 10:10:12 -07:00
Ryan Crabbe 746d10f1dd Merge remote-tracking branch 'origin/main' into litellm_chore-migrate-guardrail-test-playground-off-tremor 2026-04-18 10:06:55 -07:00
yuneng-jiangandGitHub 18a5fe546a Merge pull request #25998 from BerriAI/litellm_/wonderful-bouman
[Feature] UI - Settings: Claude Code BYOK support
2026-04-18 09:29:41 -07:00
Ryan Crabbe e2e5b63b41 fix(ui): revert submit guard to allow intentional extra_headers clearing
The ?.length guard prevented intentional clears from persisting — send
the form value as-is since initialValues now populates it correctly.
2026-04-17 23:24:46 -07:00
Ryan Crabbe c28877757c fix(ui): extra_headers not persisting on MCP server edit
Set extra_headers explicitly in initialValues instead of relying on
a useEffect setFieldValue call that races with Antd form initialization.
Also avoid sending empty array on submit so the backend's exclude_none
doesn't overwrite stored values.
2026-04-17 22:48:39 -07:00
Yuneng Jiang e004876950 Merge remote-tracking branch 'origin/litellm_internal_staging' into litellm_/wonderful-bouman
# Conflicts:
#	tests/test_litellm/proxy/ui_crud_endpoints/test_proxy_setting_endpoints.py
2026-04-17 21:32:09 -07:00
Yuneng Jiang 6fe79035d9 [Fix] UI - Settings: clarify Max-subscription vs BYOK toggle descriptions (independent of each other) 2026-04-17 21:21:43 -07:00
Yuneng Jiang acb4f89254 [Fix] UI - Models: clarify Anthropic api_base label and tooltip to prevent recursive-loop misconfiguration 2026-04-17 21:18:35 -07:00
Shivam RawatandGitHub 37765e679f Merge branch 'litellm_internal_staging' into litellm_pages_support_for_ocr 2026-04-17 19:29:45 -07:00
shivam fad884e9a7 Merge branch 'litellm_internal_staging' into litellm_persist_default_router_end_budget 2026-04-17 19:06:32 -07:00
yuneng-jiangandGitHub 0b50a29baf Merge pull request #25995 from BerriAI/litellm_fixBedrockTestMergeMarkers
[Fix] Remove unresolved merge conflict markers in bedrock test file
2026-04-17 18:37:50 -07:00
Yuneng Jiang a282ac4170 [Fix] Remove unresolved merge conflict markers in bedrock test file
Fixes SyntaxError at pytest collection time caused by leftover
<<<<<<<, =======, >>>>>>> markers in test_bedrock_common_utils.py.
Keeps the assertion matching the model under test
(claude-haiku-4-5-20251001-v1:0).
2026-04-17 18:23:49 -07:00
bb9955beca [Fix] Budget reset job now resets implicitly-created end users with NULL budget_id
When litellm.max_end_user_budget_id is configured, implicitly-created end users
(via /chat/completions) have budget_id=NULL in the DB since the default budget
is only applied in-memory. The budget reset job filtered by budget_id, so these
users were never reset and eventually permanently blocked.

Fix: when the default budget is in the reset list, also query for and reset
end users with budget_id=NULL and spend > 0. This keeps the hot auth path
unchanged (no DB writes on every request).

Fixes #22019

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 17:49:33 -07:00
89365628c9 [Fix] Persist default end-user budget_id to DB so budget reset job picks up implicitly created users
Previously, _apply_default_budget_to_end_user() only set the budget in-memory,
leaving budget_id NULL in the database. This caused the budget reset job to skip
these users since it filters by budget_id. Now the function also persists
budget_id via a Prisma update call (non-fatal on failure).

Fixes #22019

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-17 17:48:54 -07:00
ishaan-berriandGitHub 1c128a86b8 Merge pull request #25256 from BerriAI/litellm_ishaan_april6
Litellm ishaan april6
2026-04-17 16:26:45 -07:00
Ishaan Jaffer e6a20af646 fix(proxy-extras): skip post-deploy sanity check when no migrations pending
When prisma migrate deploy reports 'No pending migrations to apply' the DB
already matches schema — running _resolve_all_migrations (migrate diff +
prisma db execute) adds 25+ seconds unnecessarily, causing the proxy to
miss the 90-second startup timeout in test_litellm_proxy_server_config_no_general_settings.
2026-04-17 15:59:41 -07:00
Ishaan Jaffer e073feec0a fix(ui): rename claude-code-plugins to skills in page_metadata.ts
page_utils.test.ts enforces that every menuGroups entry has a matching
description and vice versa. The left nav uses 'skills' but page_metadata.ts
still had 'claude-code-plugins', causing two test failures.
2026-04-17 15:49:24 -07:00
Ishaan Jaffer 33175a8ee7 fix(proxy-extras): fall back to prisma db execute when migrate diff fails on pooler URL
When DIRECT_URL is not set and DATABASE_URL is a Neon pooler URL, prisma migrate diff
fails (pooler doesn't support extended query protocol for schema introspection). Previously
_resolve_all_migrations returned early without applying any migrations, leaving the
budget_limits column missing and causing test_auth_callback_new_user to fail.

Now falls back to running each migration SQL file via prisma db execute --file, which
works with pooler URLs and is safe to re-run due to IF NOT EXISTS guards.
2026-04-17 15:38:48 -07:00
Ishaan Jaffer 70456fb8bb fix(ui): update add_plugin_form tests to match rewritten smart URL form 2026-04-17 15:17:21 -07:00
Ishaan Jaffer 33a2cee4af fix(proxy-extras): use DIRECT_URL for prisma migrate diff, tempfile for diff dir 2026-04-17 15:17:15 -07:00
Ishaan Jaffer 7c47bbd226 fix(migration): run schema sanity check after P3009/P3018 idempotent migration recovery 2026-04-17 15:01:10 -07:00
yuneng-jiangandGitHub 6a9f8f7772 Merge pull request #25972 from BerriAI/litellm_yj_apr16
[Infra] Merge dev branch
2026-04-17 14:58:52 -07:00
Ishaan Jaffer 9281147a1a fix(schema): add budget_limits Json? to LiteLLM_TeamTable and LiteLLM_VerificationToken 2026-04-17 14:47:18 -07:00
Ishaan Jaffer b91a6f52b7 fix(schema): add budget_limits Json? to LiteLLM_TeamTable and LiteLLM_VerificationToken 2026-04-17 14:47:12 -07:00
Ishaan Jaffer 7239ed60e9 fix(schema): add budget_limits Json? to LiteLLM_TeamTable and LiteLLM_VerificationToken 2026-04-17 14:47:05 -07:00
Ishaan Jaffer 7b3480a94a fix(team_delete): exclude budget_limits and default_team_member_models from deleted team record 2026-04-17 14:42:09 -07:00
Ishaan Jaffer 574633fcf1 fix(key_delete): exclude budget_limits from deleted verification token record 2026-04-17 14:21:39 -07:00
Ishaan Jaffer 6636329f69 fix(proxy): revert budget exceeded error code from 429 to 400 2026-04-17 14:02:04 -07:00
Ishaan Jaffer b4df07a244 style(prometheus): apply Black formatting to types/integrations/prometheus.py 2026-04-17 13:49:27 -07:00
Ishaan Jaffer 2808cb908c style(prometheus): apply Black formatting to prometheus.py 2026-04-17 13:49:24 -07:00
Ishaan Jaffer 7867497751 style(github_copilot): revert authenticator.py to origin/main formatting 2026-04-17 13:45:50 -07:00
Ishaan Jaffer 9de041f8ee style(prometheus): sync types/integrations/prometheus.py formatting with origin/main 2026-04-17 13:45:22 -07:00
Ishaan Jaffer 2395a2db4d style(prometheus): sync prometheus.py formatting with origin/main 2026-04-17 13:45:19 -07:00
Ishaan Jaffer b7aa045de1 style(github_copilot): shorten __init__ docstring to avoid Black edge case 2026-04-17 13:33:14 -07:00
Yuneng Jiang 1e25a00e5d [Docs] BYOK tutorial: document the UI-only configuration path 2026-04-17 13:32:17 -07:00
Yuneng Jiang 7eae18d158 [Feature] UI - Settings: toggle row for forward_llm_provider_auth_headers 2026-04-17 13:32:17 -07:00