Commit graph

36782 commits

Author SHA1 Message Date
Ishaan Jaffer
e5824b1ec2
fix(docker): copy local litellm-proxy-extras migrations into Docker image to fix 500 errors
Some checks failed
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Has been cancelled
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Has been cancelled
Unit Tests: Security / security (push) Has been cancelled
2026-04-11 12:30:53 -07:00
Ishaan Jaffer
d22a07a9ba
Merge remote-tracking branch 'origin/main' into ci-fix-april6-fixes 2026-04-11 12:04:14 -07:00
Ishaan Jaffer
aff352b9e3
fix(team_endpoints): suppress type error on budget_limits assignment 2026-04-11 11:38:50 -07:00
Ishaan Jaffer
3df367bdb8
fix(reset_budget_job): use spend_counter_cache from proxy_server in reset_budget_windows 2026-04-11 11:38:47 -07:00
ryan-crabbe-berri
eabb6a31f1
Merge pull request #25542 from BerriAI/litellm_fix-timestamp
fix(spend): session-TZ-independent date filtering for spend/error log queries
2026-04-11 10:57:25 -07:00
Krrish Dholakia
01b9b50b43
Add Screenshots / Proof of Fix section to PR template (#25564)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Krrish Dholakia <krrish-berri-2@users.noreply.github.com>
2026-04-11 10:20:34 -07:00
Ryan Crabbe
423677f19e
fix(spend): convert string dates to tz-aware UTC datetimes in _get_spend_report_for_time_range
This helper takes start_date/end_date as plain strings and passed them
straight to query_raw. Prisma forwards untyped text to Postgres, which
parses `'2026-04-10'::timestamptz` using the session timezone because
there's no +00:00 offset to respect. Under a non-UTC session this shifts
the resolved instant by the session offset, and the AT TIME ZONE 'UTC'
wrap introduced in the previous commit then strips it to a plain
timestamp that's still offset by the same amount — producing the exact
4h drift that wrap was meant to prevent.

Normalize the strings to datetime(..., tzinfo=timezone.utc) at the top of
the function so Prisma serializes them with the explicit +00:00 suffix,
which makes the ::timestamptz cast session-TZ-independent. Also replaces
the $1::date comparison in the team_alias query with the same
::timestamptz AT TIME ZONE 'UTC' pattern used by every other site in
this PR, so both queries share one consistent shape.

Verified live on a real Postgres under session TZ America/New_York:
the function now returns exactly the April 10 UTC demo rows
($4.20 / 10 rows) whereas the previous shape returned 13 rows
(2 correct April 10 rows dropped, 5 rows from April 11 early-morning
wrongly shifted in).
2026-04-11 09:47:09 -07:00
Ryan Crabbe
c7934c460d
fix(spend): session-TZ-independent date filtering for spend/error log queries
The raw SQL queries in spend_management_endpoints.py, spend_tracking_utils.py,
and analytics_endpoints.py cast date params to ::timestamptz while comparing
against the plain-timestamp "startTime" column. Postgres resolves the type
mismatch by promoting the column using the DB session timezone, which drifts
the filter window and date_trunc buckets whenever session TZ is not UTC —
silently dropping rows at UTC day boundaries and, for narrow windows, losing
rows entirely.

Wraps every such comparison with `AT TIME ZONE 'UTC'` so the param side
resolves to a plain timestamp matching the column type. Both sides end up
as plain timestamp, Postgres does no implicit conversion, and session TZ
plays no role in the query. The fix is constant-foldable so the existing
startTime index (PR #17504) remains usable.

Also marks strptime-produced datetimes as tz-aware UTC at the call sites
for intent clarity and consistency with parse_date.

Fixes #22529 (Logs page missing recent rows under non-UTC session TZ) and
the Global Usage single-day-returns-two-days symptom reported internally.
2026-04-10 17:04:52 -07:00
Krrish Dholakia
4e12d3c562
docs: document april townhall announcements (#25537)
Some checks are pending
CodeQL / Analyze (actions) (push) Waiting to run
CodeQL / Analyze (javascript-typescript) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
CodSpeed Benchmarks / benchmarks (push) Waiting to run
Helm unit test / unit-test (push) Waiting to run
Read Version from pyproject.toml / read-version (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Waiting to run
Unit Tests: Proxy DB Operations / proxy-db (auth-checks, tests/proxy_unit_tests/test_auth_checks.py tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Waiting to run
Unit Tests: Proxy DB Operations / proxy-db (key-generation, tests/proxy_unit_tests/test_key_generate_prisma.py, 30, 0) (push) Waiting to run
Unit Tests: Proxy DB Operations / proxy-db (remaining, tests/proxy_unit_tests --ignore=tests/proxy_unit_tests/test_key_generate_prisma.py --ignore=tests/proxy_unit_tests/test_auth_checks.py --ignore=tests/proxy_unit_tests/test_user_api_key_auth.py, 20, 8) (push) Waiting to run
Unit Tests: Security / security (push) Waiting to run
GitHub Actions Security Analysis / zizmor (push) Waiting to run
* docs: document april townhall announcements

* docs: cleanup blog post
2026-04-10 16:12:06 -07:00
yuneng-jiang
d67b5f8b08
Merge pull request #25526 from BerriAI/litellm_yj_04_09_2026
[Infra] Merge Dev Branch with Main
2026-04-10 15:30:23 -07:00
yuneng-jiang
f2f2a91a29
Merge pull request #25480 from BerriAI/litellm_/eloquent-allen
[Fix] Flush Tremor Tooltip timers in user_edit_view tests
2026-04-10 15:11:27 -07:00
yuneng-jiang
9e4352afb4
Merge pull request #25528 from BerriAI/yj_bump_10
bump: version 1.83.5 → 1.83.6
2026-04-10 13:28:51 -07:00
Yuneng Jiang
1f148ea6a1
bump: version 1.83.5 → 1.83.6 2026-04-10 13:20:58 -07:00
yuneng-jiang
193a57b5d2
Merge pull request #25478 from BerriAI/litellm_align_list_response_field_handling
[Fix] Align v1 guardrail and agent list responses with v2 field handling
2026-04-10 13:12:17 -07:00
yuneng-jiang
576e6a06e3
Merge pull request #25517 from BerriAI/litellm_bedrock-messages-cache-prompt-double-count
fix(bedrock): avoid double-counting cache tokens in Anthropic Messages streaming usage
2026-04-10 12:54:59 -07:00
yuneng-jiang
ec524a0e7a
Merge pull request #25513 from BerriAI/litellm_fix_ws_duplicate_kwarg
[Fix] Responses WebSocket Duplicate Keyword Argument Error
2026-04-10 12:41:15 -07:00
Sameer Kankute
f0d2d26301
fix(bedrock): avoid double-counting cache tokens in Anthropic Messages streaming usage
Made-with: Cursor
2026-04-11 00:03:45 +05:30
Yuneng Jiang
2a4e5b59fd
fix(responses): prevent duplicate kwargs in WebSocket call
Filter all explicitly-passed keys from remaining_kwargs before
spreading into async_responses_websocket(). The router now injects
custom_llm_provider into kwargs (via #25334), which collides with
the explicit custom_llm_provider= argument.
2026-04-10 11:13:17 -07:00
yuneng-jiang
d0e347af32
Merge pull request #25473 from BerriAI/litellm_auth_rbac_cleanup
refactor: consolidate route auth for UI and API tokens
2026-04-10 09:14:42 -07:00
Ryan Crabbe
3af7de4222
retain ui_routes enum alias for JWT config backwards compatibility 2026-04-10 08:55:32 -07:00
Yuneng Jiang
a771e1939c
Fix unhandled "window is not defined" error in user_edit_view tests
Tremor's internal Tooltip component sets a setTimeout that fires after
the jsdom test environment tears down, causing a ReferenceError. Add
afterEach that flushes pending timers before cleanup.
2026-04-10 00:10:40 -07:00
Yuneng Jiang
28bce0b05e
fix: align v1 guardrail and agent list responses with v2 field handling 2026-04-10 00:00:53 -07:00
yuneng-jiang
5666ed04ca
Merge pull request #25475 from BerriAI/litellm_harden_skill_file_paths
[Fix] Harden file path resolution in skill archive extraction
2026-04-09 23:00:57 -07:00
Yuneng Jiang
9a4f5d7316
fix: remove unnecessary f-string prefix in SQL query 2026-04-09 22:47:13 -07:00
Yuneng Jiang
820b45784c
Merge remote-tracking branch 'origin/main' into litellm_harden_skill_file_paths 2026-04-09 22:46:23 -07:00
Yuneng Jiang
6a15adcd64
fix: harden file path resolution in skill archive extraction 2026-04-09 21:59:23 -07:00
Yuneng Jiang
e828a91eee
[Docs] Add missing MCP per-user token env vars to config_settings
MCP_PER_USER_TOKEN_DEFAULT_TTL and MCP_PER_USER_TOKEN_EXPIRY_BUFFER_SECONDS
were added in #25441 but not documented, causing test_env_keys.py to fail.
2026-04-09 21:49:06 -07:00
joereyna
b7d7b93eb9
fix(responses-ws): use urllib.parse to append model param, fix test mocking 2026-04-09 21:49:06 -07:00
joereyna
1264bf3f8e
fix(responses-ws): append ?model= to backend WebSocket URL 2026-04-09 21:49:06 -07:00
Yuneng Jiang
236bb4f59f
address greptile review feedback (greploop iteration 1)
Remove leftover 10000ms per-test timeout in add_model_tab.test.tsx that was
missed in the initial sweep. The test now inherits the 30000ms global.
2026-04-09 21:49:06 -07:00
Yuneng Jiang
06f3679778
[Test] UI - Unit tests: raise global vitest timeout and remove per-test overrides
Raise vitest testTimeout from 10s to 30s and drop per-test timeout overrides
across UI unit tests. Group CreateUserButton and TeamInfo tests under nested
describe blocks to make the most flaky suites easier to scan.
2026-04-09 21:49:06 -07:00
Yuneng Jiang
df3ddd7a81
[Fix] Let setSecureItem propagate storage errors to callers
Remove the silent try/catch from setSecureItem so OAuth hooks can
surface actionable "enable storage" guidance instead of a cryptic
"state lost" error after the round-trip. Add a local try/catch in
ChatUI where the storage write is non-critical.
2026-04-09 21:49:06 -07:00
yuneng-jiang
4e068718c9
Update docker/Dockerfile.custom_ui
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-04-09 21:49:06 -07:00
Yuneng Jiang
464c98878e
[Fix] Address review feedback on storage utility and Dockerfiles
- Dockerfile.health_check: HEALTHCHECK now verifies the script is intact
  instead of unconditionally exiting 0
- secureStorage.ts: replace deprecated escape/unescape with
  encodeURIComponent/decodeURIComponent; don't delete legacy values on
  decode failure so in-flight flows can time out naturally
- OAuth callback: add same-origin check before redirecting to stored
  return URL
2026-04-09 21:49:06 -07:00
Yuneng Jiang
4272d80c83
fix(docker): add non-root USER and HEALTHCHECK to Dockerfile.custom_ui
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 21:49:06 -07:00
Yuneng Jiang
a12ba1f4d1
[Fix] UI: resolve CodeQL security alerts and Dockerfile.health_check hardening
Port security fixes from litellm_v1.82.3.dev.6:
- Use secureStorage (sessionStorage wrapper) instead of raw storage for tokens
- Add URL validation for stored worker URLs to prevent open redirects
- Add same-origin checks before redirecting to stored return URLs
- Harden Dockerfile.health_check with non-root user and exec-form HEALTHCHECK
2026-04-09 21:49:06 -07:00
Chetan Soni
8dc5ab39f0
feat(mcp): add per-user OAuth token storage for interactive MCP flows 2026-04-09 21:49:06 -07:00
joereyna
f8ae642736
format vertex test file 2026-04-09 21:49:06 -07:00
joereyna
fb527ae250
fix(test): mock headers in test_completion_fine_tuned_model 2026-04-09 21:49:06 -07:00
Ryan Crabbe
26e99f22b3
refactor: consolidate route auth for UI and API tokens
Unify UI and API token authorization through the shared RBAC path
and backfill missing routes in role-based route lists.
2026-04-09 21:36:35 -07:00
yuneng-jiang
9e6d2d2069
Merge pull request #25468 from BerriAI/litellm_/compassionate-shannon
[Test] UI - Unit tests: raise global vitest timeout and remove per-test overrides
2026-04-09 21:35:43 -07:00
Yuneng Jiang
c7f610c57e
Merge remote-tracking branch 'origin/main' into litellm_/compassionate-shannon 2026-04-09 21:15:03 -07:00
yuneng-jiang
42e5583788
Merge pull request #25471 from BerriAI/litellm_doc_mcp_per_user_token_env_vars
[Docs] Add missing MCP per-user token env vars to config_settings
2026-04-09 21:13:10 -07:00
Yuneng Jiang
ce0b57b4ff
[Docs] Add missing MCP per-user token env vars to config_settings
MCP_PER_USER_TOKEN_DEFAULT_TTL and MCP_PER_USER_TOKEN_EXPIRY_BUFFER_SECONDS
were added in #25441 but not documented, causing test_env_keys.py to fail.
2026-04-09 21:04:34 -07:00
yuneng-jiang
1214dc93b3
Merge pull request #25467 from jaydns/fix/parameterize-combined-view-query
fix(proxy): use parameterized query for combined_view token lookup
2026-04-09 21:03:24 -07:00
yuneng-jiang
9b33d9d427
Merge pull request #25445 from jaydns/fix/proxy-input-validation
fix(proxy): improve input validation on management endpoints
2026-04-09 21:02:52 -07:00
Yuneng Jiang
92dbd2c491
address greptile review feedback (greploop iteration 1)
Remove leftover 10000ms per-test timeout in add_model_tab.test.tsx that was
missed in the initial sweep. The test now inherits the 30000ms global.
2026-04-09 20:54:36 -07:00
yuneng-jiang
aa0fa104ba
Merge pull request #25437 from joereyna/litellm_fix_responses_websocket_model_query_param
fix(responses-ws): append ?model= to backend WebSocket URL
2026-04-09 20:46:47 -07:00
Yuneng Jiang
3a316b9131
[Test] UI - Unit tests: raise global vitest timeout and remove per-test overrides
Raise vitest testTimeout from 10s to 30s and drop per-test timeout overrides
across UI unit tests. Group CreateUserButton and TeamInfo tests under nested
describe blocks to make the most flaky suites easier to scan.
2026-04-09 20:42:30 -07:00
jayden
4dc416ee74
fix(proxy): use parameterized query for combined_view token lookup 2026-04-09 20:10:40 -07:00