Commit graph

39980 commits

Author SHA1 Message Date
michelligabriele
8d945c86b7
fix(proxy): set key_alias=user_id in JWT auth for Prometheus metrics (#25340) 2026-04-08 21:22:03 -07:00
Sameer Kankute
6e6f5be3e4
feat(triton): add embedding usage estimation for self-hosted responses (#25345)
* feat(triton): add embedding usage estimation for self-hosted responses

Populate Triton embedding usage from request input using token counting with a safe fallback so cost/observability flows work even when provider usage is missing.

Made-with: Cursor

* fix(triton): sum per-input embedding token counts for batches

Joining batch strings with newlines before token_counter added spurious
tokens. Count each input separately and sum, matching OpenAI-style usage.

Made-with: Cursor
2026-04-08 21:14:27 -07:00
Sameer Kankute
3a4ed48f54
fix(router): don't create litellm_metadata for non-Responses API calls in encrypted_content_affinity_check (#25347)
Using setdefault('litellm_metadata', {}) unconditionally created an empty
litellm_metadata key for chat completions and embeddings. This caused
_get_metadata_variable_name_from_kwargs to return 'litellm_metadata' instead
of 'metadata', so tag-based routing looked for tags in the wrong dict and
ignored all tag filters.

Fix: only set the encrypted_content_affinity_enabled flag when litellm_metadata
already exists (Responses API path). Chat completions and embeddings never have
this key, so nothing is created and tag routing works correctly.
2026-04-08 21:11:19 -07:00
Kedar Thakkar
233870d7b2
Add Ramp as a built-in generic API callback with docs (#23769) 2026-04-08 20:06:48 -07:00
yuneng-jiang
ac29118942
Update docker/Dockerfile.custom_ui
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-04-08 17:59:09 -07:00
Yuneng Jiang
70a5c27cbd
[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-08 17:51:34 -07:00
Chesars
3905dfa281 fix(readme): update Greptile logo to higher quality image 2026-04-08 21:43:58 -03:00
Yuneng Jiang
36bf337396
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-08 17:21:33 -07:00
Yuneng Jiang
a881ac5133
[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-08 17:21:25 -07:00
yuneng-jiang
072d4108c3
Merge pull request #25365 from BerriAI/litellm_e2e_ui_tests
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
[Feature] UI E2E Tests: Proxy Admin Team and Key Management
2026-04-08 15:29:10 -07:00
shin-berri
d871bce86e
Merge pull request #25354 from BerriAI/litellm_migrate_redis_tests_to_circleci
[Infra] Migrate Redis caching tests from GHA to CircleCI
2026-04-08 15:14:55 -07:00
Yuneng Jiang
467dbc4a3c
[Fix] Remove old broken key tests superseded by proxy-admin/keys.spec.ts 2026-04-08 13:32:37 -07:00
Yuneng Jiang
4ee7d42981
[Fix] Restructure HTML files after UI build so extensionless routes work in CI 2026-04-08 13:24:52 -07:00
Yuneng Jiang
ac9ebdf4d8
[Fix] Rename CI job to e2e_ui_testing and remove duplicate old job definition 2026-04-08 13:17:45 -07:00
Yuneng Jiang
a8f4f464ce
[Fix] Add missing test fixtures and address review feedback
- Add constants.ts with all required exports (key aliases, team IDs)
- Add fixtures/users.ts with all role definitions and storage paths
- Add fixtures/seed.sql for deterministic test database seeding
- Remove Firefox project from playwright config (only Chromium installed)
- Remove unused variable in teams.spec.ts
- Rename CircleCI job to e2e_ui_testing
2026-04-08 12:40:41 -07:00
Yuneng Jiang
d09d98a70a
[Feature] E2E UI tests: proxy-admin team and key management with CI integration
Add Playwright E2E tests covering proxy admin team and key management
workflows, with a self-contained test runner and CircleCI integration.

Tests cover: create team, invite user, edit/delete team members, create
key in team, regenerate key, update TPM/RPM limits, delete key, and
verify internal user keys are visible.

Infrastructure: run_e2e.sh builds the UI from source before starting
the proxy, ensuring tests always run against the latest UI changes.
Added data-testid attributes to key UI components for reliable selectors.
2026-04-08 11:51:15 -07:00
Yuneng Jiang
7ba0c69a07
[Fix] Install pytest-rerunfailures in redis caching CircleCI job 2026-04-08 11:50:00 -07:00
yuneng-jiang
2dac54b732
Merge pull request #25343 from BerriAI/litellm_fix-mcp-stdio-rce3
fix(mcp): block arbitrary command execution via stdio transport
2026-04-08 11:12:39 -07:00
Yuneng Jiang
0104b60d8e
[Infra] Add redis_caching_coverage to coverage combine command 2026-04-08 10:48:41 -07:00
Sameer Kankute
c0baf0f6a6
fix tests 2026-04-08 22:33:42 +05:30
Sameer Kankute
2834659f19
fix tests and mypy 2026-04-08 22:30:39 +05:30
Sameer Kankute
7f3cbd41e3
Fix greptile review 2026-04-08 22:22:30 +05:30
Sameer Kankute
97091172a3
docs(openai): move chat-to-responses flag docs to openai.md completions section
- Add route_all_chat_openai_to_responses global flag docs under
  'Getting Reasoning Content in /chat/completions' in openai.md
  with SDK and proxy examples using gpt-5.4
- Remove the section from responses_api.md (wrong location)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 22:13:42 +05:30
Sameer Kankute
6072d1b66e
fix(openai): fix env var bool parsing and add responses API docs
- Use .lower() == "true" for LITELLM_ROUTE_ALL_CHAT_OPENAI_TO_RESPONSES to avoid bool("False") == True bug
- Add clarifying comment on early return in responses_api_bridge_check
- Document route_all_chat_openai_to_responses flag in openai/responses_api.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 22:13:37 +05:30
Sameer Kankute
50861b4524
feat(openai): add route_all_chat_openai_to_responses global flag
Adds `litellm.route_all_chat_openai_to_responses` (env: `LITELLM_ROUTE_ALL_CHAT_OPENAI_TO_RESPONSES`) to route all OpenAI /chat/completions requests through the Responses API bridge. Also fixes reasoning param dict passthrough in completion transformation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 22:13:30 +05:30
Sameer Kankute
64cbadb216
Fix greptile review 2026-04-08 22:08:52 +05:30
Sameer Kankute
6b7629ec04
Fix greptile review 2026-04-08 22:00:30 +05:30
Yuneng Jiang
3a02c0ac6b
[Infra] Migrate Redis caching tests from GHA to CircleCI
Redis caching unit tests (test_dual_cache, test_redis_batch_optimizations,
test_router_utils) required Redis secrets that should live in CircleCI.

- Add redis_caching_unit_tests job to CircleCI config
- Delete test-unit-caching-redis.yml GHA workflow
- Remove all Redis plumbing (inputs, secrets, env vars) from
  _test-unit-services-base.yml and its callers
2026-04-08 09:07:12 -07:00
Sameer Kankute
b08e058451
Fix greptile reviews 2026-04-08 21:35:41 +05:30
Sameer Kankute
d8598abf15
Fix code qa 2026-04-08 21:33:27 +05:30
Sameer Kankute
65829f79d7
docs: document LITELLM_MCP_STDIO_EXTRA_COMMANDS in env reference
Required by tests/documentation_tests/test_env_keys.py for os.getenv usage in constants.

Made-with: Cursor
2026-04-08 21:31:51 +05:30
Sameer Kankute
69be5be88b
fix(mcp): move inline imports to module level and enforce stdio allowlist
- Move os and MCP_STDIO_ALLOWED_COMMANDS imports to module level in mcp_server_manager.py
- Move MCP_STDIO_ALLOWED_COMMANDS import to module level in _types.py
- Change defense-in-depth warning to HTTPException 403 for legacy non-allowlisted commands
- Ensures arbitrary command execution is blocked for both new and legacy MCP servers

Addresses Greptile review comments:
- P2: Inline imports violate CLAUDE.md style guide
- P1 security: Defense-in-depth should block, not warn, for legacy commands

Made-with: Cursor
2026-04-08 21:28:43 +05:30
Sameer Kankute
e748aa8e16
Add docs 2026-04-08 19:50:55 +05:30
Sameer Kankute
c68a19b883
feat(gemini): Veo Lite pricing, size→resolution, usage video_resolution for cost tiers
Made-with: Cursor
2026-04-08 19:50:50 +05:30
Sameer Kankute
de6fb5895f
docs(responses): add use_responses_api_bridge opt-in bridge docs 2026-04-08 19:47:08 +05:30
Sameer Kankute
f6b03a469e
feat(responses): add use_responses_api_bridge flag for openai/ models with custom api_base
Allows openai/-prefixed models with a custom api_base pointing to a
third-party OpenAI-compatible provider to opt-in to the
/responses → /chat/completions bridge, rather than forwarding requests
natively to /v1/responses (which may not be supported by the provider).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-08 19:47:03 +05:30
Sameer Kankute
6621c40622
feat(health-check): add BACKGROUND_HEALTH_CHECK_MAX_TOKENS env var 2026-04-08 19:43:56 +05:30
Sameer Kankute
ad31e79b97
fix(mcp): address Greptile review feedback
- Defense-in-depth: warn instead of hard-fail for legacy servers
- Move os import to module level in _types.py
- Document args residual risk in allowlist comment
- Add UpdateMCPServerRequest allowlist test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 19:42:41 +05:30
Sameer Kankute
7b7f304675
fix(mcp): block arbitrary command execution via stdio transport
Add command allowlist for MCP stdio transport to prevent RCE via
/mcp-rest/test/* endpoints. Restrict test endpoints to PROXY_ADMIN
role. Fix docker/README.md MASTER_KEY -> LITELLM_MASTER_KEY.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 19:42:37 +05:30
Lucas Song
727a6f21b8
Update ui/litellm-dashboard/src/components/policies/index.tsx
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-04-08 01:03:19 -07:00
Lucas Song
a02ec3bfa0 fix(ui): delete policy attachments via controlled modal
Replace static Modal.confirm with DeleteResourceModal so attachment delete reliably triggers the API call. Add a regression test covering the confirm->delete flow.

Made-with: Cursor
2026-04-07 23:06:13 -07:00
shin-berri
62757ff48f
Merge pull request #25316 from BerriAI/litellm_yj_apr7
[Infra] Bump version 1.83.4 → 1.83.5
2026-04-07 18:53:11 -07:00
Yuneng Jiang
bd327dbe54
bump: version 1.83.4 → 1.83.5 2026-04-07 18:37:29 -07:00
yuneng-jiang
5f49f29f4e
Merge pull request #25048 from joereyna/fix/dockerfile-node-gyp-path
Fix node-gyp symlink path after npm upgrade in Dockerfile
2026-04-07 17:14:04 -07:00
joereyna
41407d0287
Fix node-gyp symlink path after npm upgrade in Dockerfile 2026-04-07 17:01:55 -07:00
yuneng-jiang
08f34aa3cc
Merge pull request #25313 from BerriAI/litellm_align_v2_key_info_with_v1
Some checks failed
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
Unit Tests: Caching (Redis) / caching-redis (push) Has been cancelled
[Refactor] Align /v2/key/info response handling with v1
2026-04-07 15:54:12 -07:00
yuneng-jiang
096893ea97
Merge pull request #25273 from BerriAI/litellm_pin_cosign_pub_to_commit
[Infra] Pin cosign.pub verification to initial commit hash
2026-04-07 15:40:46 -07:00
Yuneng Jiang
021429b797
[Refactor] Align /v2/key/info response handling with v1
The /v2/key/info endpoint was missing response filtering that
the v1 /key/info endpoint already had. This aligns the two
endpoints so v2 applies the same per-key permission checks and
strips internal fields from the response. Also fixes the
key_aliases query path to resolve aliases before querying.
2026-04-07 15:21:42 -07:00
milan-berri
bf8b615b64
fix(auth): support selective jwt override oauth2 routing (#25252)
Allow JWT tokens matching routing_overrides to use OAuth2 introspection without enabling global OAuth2 while keeping OAuth2 routing limited to LLM/info routes. Add regression coverage for management-route boundary and tighten opaque-token assertions; update docs to reflect selective-mode route scope.

Made-with: Cursor
2026-04-07 13:52:47 -07:00
kothamah
168b0a05c4 added changes based on the feedback 2026-04-07 16:32:25 -04:00