Commit graph

34478 commits

Author SHA1 Message Date
ryan-crabbe
8020276711
Merge pull request #21430 from BerriAI/litellm_perf_headers_caching
perf: use cached _safe_get_request_headers instead
2026-02-24 15:22:12 -08:00
Ryan Crabbe
9971b67587 fix: convert remaining dict(request.headers) to _safe_get_request_headers
Missed conversions in user_api_key_auth.py and litellm_pre_call_utils.py.
Both call sites are read-only so no .copy() needed.
2026-02-24 15:21:43 -08:00
Ryan Crabbe
53c10b0b64 Merge origin/main and address Greptile review feedback
- Resolve merge conflict in pass_through_endpoints.py
- Add .copy() to proxy_server_request headers to prevent cache corruption
- Add test for request.state unavailable fallback path
2026-02-24 15:13:19 -08:00
ryan-crabbe
e9a45bf75b
Merge pull request #20032 from ryan-crabbe/fix/mcp-server-unreachable-error-handling
fix: dead code cleanup in MCP server error handler
2026-02-24 15:03:01 -08:00
ryan-crabbe
56a507073b
Merge pull request #21690 from BerriAI/litellm_perf_o_series_short_circuit
perf: optimize is_model_o_series_model with startswith
2026-02-24 14:59:53 -08:00
ryan-crabbe
253792a1d1
Merge pull request #21611 from BerriAI/litellm_perf_skip_throwaway_usage
perf: skip throwaway Usage() construction in ModelResponse.__init__
2026-02-24 14:53:17 -08:00
Ryan Crabbe
6a0dd0a45f Merge remote-tracking branch 'origin/main' into litellm_perf_skip_throwaway_usage
# Conflicts:
#	tests/llm_translation/test_llm_response_utils/test_convert_dict_to_chat_completion.py
2026-02-24 14:51:57 -08:00
Ryan Crabbe
68a30a39e6 fix(proxy): add LPOP pipeline error checking and fix org spend ServiceType
- Add per-command error check in _pipeline_lpop_helper to match _pipeline_rpush_helper, preventing silent data loss on WRONGTYPE errors
- Fix pre-existing bug: org spend queue metric was using REDIS_DAILY_SPEND_UPDATE_QUEUE instead of REDIS_DAILY_ORG_SPEND_UPDATE_QUEUE
- Add test for per-command LPOP pipeline error propagation
2026-02-24 14:22:57 -08:00
yuneng-jiang
80ebe722d9
Merge pull request #22029 from BerriAI/litellm_spend_tracking_logging
[Infra] Add Spend Tracking Lifecycle Logging
2026-02-24 12:52:32 -08:00
yuneng-jiang
2cabbccf6f address greptile review feedback (greploop iteration 3)
- Add missing traceback to team member spend enqueue error log
2026-02-24 12:49:48 -08:00
Ryan Crabbe
98b4964330 perf(proxy): pipeline Redis RPUSH/LPOP in spend update cycle
Replace 14 sequential Redis round-trips (7 RPUSH + 7 LPOP) per spend
update cycle with 2 pipelined calls (1 RPUSH pipeline + 1 LPOP pipeline).
This reduces connection pool contention at scale (50+ pods).

- Add RedisPipelineRpushOperation and RedisPipelineLpopOperation TypedDicts
- Add async_rpush_pipeline() and async_lpop_pipeline() to RedisCache
- Refactor store_in_memory_spend_updates_in_redis() to use pipeline
- Add get_all_transactions_from_redis_buffer_pipeline() for batched drain
- Update _commit_spend_updates_to_db_with_redis() to use pipeline drain
- Existing individual methods preserved for backward compatibility
2026-02-24 12:46:52 -08:00
yuneng-jiang
8b56e1d969 trigger review 2026-02-24 12:37:43 -08:00
Ishaan Jaff
33719e6b38
docs: update v1.81.12-stable release notes to point to v1.81.12-stable.1 (#22036) 2026-02-24 12:30:18 -08:00
yuneng-jiang
70ef4d0d69 address greptile review feedback (greploop iteration 2)
- Remove re-raise in _store_transactions_in_redis so one Redis
  push failure doesn't drop remaining transaction types
- Downgrade per-push success log from info to debug to reduce noise
- Fix misleading error message in update_database — entity spend
  updates run as independent tasks and are not affected by this catch
2026-02-24 12:10:19 -08:00
Sameer Kankute
5219b1d0c3
Merge pull request #22035 from BerriAI/litellm_openai_codex_day_0_codex_5.3
[Feat] OpenAI codex 5.3 day 0 support
2026-02-25 01:29:27 +05:30
yuneng-jiang
235d60eb88 address greptile review feedback (greploop iteration 1)
- Add traceback to cache update warning logs (user, end_user, team, tag)
- Remove duplicate info log in non-redis commit path
2026-02-24 11:58:59 -08:00
Ishaan Jaff
c343bfffda
fix(router): emit x-litellm-overhead-duration-ms header for streaming requests (#22027)
* fix(router): preserve _hidden_params in FallbackStreamWrapper so x-litellm-overhead-duration-ms is emitted for streaming requests

* test(router): add regression test for FallbackStreamWrapper _hidden_params preservation
2026-02-24 11:56:16 -08:00
Ishaan Jaff
e44b9b6b35
feat(prometheus): add opt-in stream label to litellm_proxy_total_requests_metric (#22023)
Set prometheus_emit_stream_label: true in litellm_settings to emit a
stream label (True/False/None) on litellm_proxy_total_requests_metric.

Opt-in to avoid breaking cardinality on existing deployments.
2026-02-24 11:51:42 -08:00
Sameer Kankute
5d291c739f Fix phase docs link 2026-02-25 01:21:38 +05:30
Sameer Kankute
74abf0c8e6 Fix phase docs link 2026-02-25 01:19:10 +05:30
Julio Quinteros Pro
db3d61f433 feat(ci): add duplicate issue detection and auto-close bot
Add a Python script that detects duplicate issues using title similarity
(difflib.SequenceMatcher) and closes them via the gh CLI. Two-tier system:
- 0.6 threshold: informational comment via existing wow-actions step
- 0.85 threshold: auto-close with comment, label, and not_planned reason

Includes a workflow_dispatch workflow for one-time batch scans and
integrates auto-close into the existing check_duplicate_issues workflow
for newly opened issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:49:06 -03:00
Sameer Kankute
aded14a55a Fix release version for gpt-5.3-codex 2026-02-25 01:04:12 +05:30
Ryan Crabbe
4c5963fdb9 test: exercise production deepcopy path in agent payload test 2026-02-24 10:49:16 -08:00
yuneng-jiang
c43a8dc842 feat(proxy): add warning/error level logging throughout spend tracking lifecycle
Elevate silent debug-level and bare except:pass error paths to
warning/error so spend tracking failures are visible in production logs.

All new log messages are prefixed with "Spend tracking -" for easy
filtering. Changes cover the full request-to-DB lifecycle:
enqueue, in-memory flush, Redis buffer push/pop, DB commit,
cache updates, spend log writes, and pod lock management.

Also fixes a copy-paste bug in _update_team_cache that logged
"end user" instead of "team".
2026-02-24 10:17:35 -08:00
yuneng-jiang
4321bc9285
Merge pull request #21985 from BerriAI/litellm_ui_testing_coverage_00
[Fix] UI - Virtual Keys: restrict Edit Settings to key owners
2026-02-24 10:16:40 -08:00
Sameer Kankute
1c48d8fda7 Add gpt-5.3-codex in model cost map 2026-02-24 23:37:09 +05:30
Ryan Crabbe
86ec2fbf84 perf(proxy): batch 11 create_task() calls into 1 in update_database()
Replace 11 separate asyncio.create_task() calls per request with a
single batched task that runs all spend-update helpers sequentially.
This reduces task scheduling overhead at high RPS (11,000 -> 1,000
tasks/sec at 1K RPS) and cuts 5 copy.deepcopy(payload) calls to 1
shared copy.

Also fixes a mutation bug where the daily agent spend handler received
the raw payload without deepcopy, unlike all other daily helpers.
2026-02-24 10:04:43 -08:00
Zero Clover
a5b4dfe6be
test(image_generation): add tests for extra_headers propagation
Verify that extra_headers are correctly forwarded to OpenAI's
images.generate() in both sync and async paths, and that they
are absent when not provided.
2026-02-25 01:51:18 +08:00
Ishaan Jaff
5e9f24f74c
fix(bedrock): pass timeout param to bedrock rerank http client (#22021)
* fix(bedrock): pass timeout to bedrock rerank http client

* refactor: extract large functions to fix PLR0915 ruff lint errors
2026-02-24 09:32:11 -08:00
Zero Clover
a1c939b2ef
fix(image_generation): propagate extra_headers to OpenAI image generation
Add headers parameter to image_generation() and aimage_generation() methods
in OpenAI provider, and pass headers from images/main.py to ensure custom
headers like cf-aig-authorization are properly forwarded to the OpenAI API.
Aligns behavior with completion() method and Azure provider implementation.
2026-02-25 01:29:06 +08:00
Sean Marsh Glover
4652c73259
feat(proxy): limit concurrent health checks with health_check_concurrency (#20584)
* staged first pass

* black

* Update litellm/proxy/health_check.py

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

* simpler

* restore cached logo

* fix tests for perform_health_check max_concurrency arg

* implement pr suggestion

* and the helm chart

* add configureable resources and probes to the deployment in the helm chart

* more helm chart unittests

* move some background healthcheck loggin to debug

---------

Co-authored-by: Sean Glover <sglover@athenahealth.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-24 08:16:59 -08:00
Harshit Jain
1fa0aad3f2
Merge pull request #22008 from BerriAI/litellm_fix_CVE
security: fix critical/high CVEs in OS-level libs and NPM transitive
2026-02-24 21:44:19 +05:30
Harshit28j
132e2ed671 Merge branch 'main' of https://github.com/BerriAI/litellm into litellm_fix_CVE
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2026-02-24 21:09:16 +05:30
Harshit28j
3e6c10a071 security: fix critical/high CVEs in OS-level libs and NPM transitive 2026-02-24 19:40:09 +05:30
Sameer Kankute
a37cd0fe7c
Merge pull request #22005 from BerriAI/litellm_mcp_server_ui_fix
Fix: Transport Type for OpenAPI Spec on UI
2026-02-24 19:38:34 +05:30
Sameer Kankute
c17caf4cc7
Merge pull request #21992 from BerriAI/litellm_fix_oauth_mcp
fix: Missing OAuth session state
2026-02-24 19:37:09 +05:30
Sameer Kankute
6531d01959
Merge pull request #21982 from BerriAI/litellm_fix_pat_token_mcp
Fix: skip health check for MCP integration with passthrough token auth
2026-02-24 19:36:08 +05:30
Sameer Kankute
7a8499e89f
Merge pull request #21940 from BerriAI/litellm_oss_staging_02_23_2026
litellm oss staging 02 23 2026
2026-02-24 19:32:56 +05:30
Sameer Kankute
b38059b014
Merge branch 'main' into litellm_oss_staging_02_23_2026 2026-02-24 19:32:48 +05:30
Sameer Kankute
816f9052ff Fix: Transport Type for OpenAPI Spec on UI 2026-02-24 19:27:12 +05:30
Julio Quinteros Pro
61d35cac34 fix: use atomic increment-first pattern for model RPM rate limiting
Replace racy check-then-increment RPM logic with atomic increment-first
pattern to prevent concurrent requests from bypassing the rate limit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 09:55:07 -03:00
Julio Quinteros Pro
d0330aa4e3
Merge pull request #22001 from jquinter/revert/pr-21957
Revert PR #21957: atomic RPM rate limiting
2026-02-24 09:53:25 -03:00
Julio Quinteros Pro
737a04b3ea Revert "Merge pull request #21957 from jquinter/fix/flaky-rpm-limit-test"
This reverts commit 77453ada2a, reversing
changes made to 7622f26918.
2026-02-24 09:52:50 -03:00
Julio Quinteros Pro
77453ada2a
Merge pull request #21957 from jquinter/fix/flaky-rpm-limit-test
fix: atomic RPM rate limiting in model rate limit check
2026-02-24 09:51:26 -03:00
Sameer Kankute
ac720defc3 Add documentation related to phase 2026-02-24 17:50:38 +05:30
Sameer Kankute
ef67b6b533 Add support for phase param 2026-02-24 17:48:55 +05:30
Shivam Rawat
7622f26918
Merge pull request #21997 from BerriAI/doc_fix_remove_harcoded_api_key
[Doc] replaced azure openai key with mock key
2026-02-24 03:32:37 -08:00
shivam
c86b174642 replaced with mock key 2026-02-24 03:28:28 -08:00
Sameer Kankute
12f37cea43 fix: Missing OAuth session state. Please retry 2026-02-24 14:22:38 +05:30
yuneng-jiang
c119adb6dc [Fix] UI - Virtual Keys: restrict Edit Settings button to key owners
Non-owner Internal Users could see and interact with the "Edit Settings"
button in the key Settings tab for keys they don't own. The button was
gated by `rolesWithWriteAccess.includes(userRole)` (role-only check)
instead of `canModifyKey` (ownership-aware), unlike the Regenerate and
Delete buttons which already used the correct check.

Replace the condition with `canModifyKey` so the Edit Settings button
follows the same proxy-admin / team-admin / key-owner logic as the
other action buttons. Add tests covering all permission paths.
2026-02-23 23:06:27 -08:00