Commit graph

33139 commits

Author SHA1 Message Date
Yuneng Jiang
58a0d8ec1a
chore: fixes 2026-04-04 23:48:22 -07:00
Ishaan Jaffer
4282247d57 fix(tests): use CI_CD_DEFAULT_ANTHROPIC_MODEL env var in test_router_timeout 2026-02-21 10:41:45 -08:00
Ishaan Jaffer
68cf8692df fix(tests): use CI_CD_DEFAULT_ANTHROPIC_MODEL env var in test_router_retries 2026-02-21 10:41:42 -08:00
Ishaan Jaffer
c20c42471e fix(tests): use CI_CD_DEFAULT_ANTHROPIC_MODEL env var in test_router 2026-02-21 10:41:39 -08:00
Ishaan Jaffer
3b9af765dd fix(tests): use CI_CD_DEFAULT_ANTHROPIC_MODEL env var in bedrock KB tests 2026-02-21 10:41:35 -08:00
Ishaan Jaffer
8bd6e2c0f6 fix(security): allowlist docs build tool CVEs in trivyignore
ajv and minimatch vulnerabilities in docs/my-website are transitive
deps of @docusaurus/core. minimatch fix requires 3.x to 10.x major
version jump that would break webpack internals; ajv fix requires
cross-major overrides. No production exposure - docs build only.
2026-02-21 10:37:56 -08:00
Ishaan Jaffer
54e9d1f8fe fix(proxy): treat all PrismaError subclasses as db connection errors 2026-02-21 10:17:28 -08:00
Ishaan Jaffer
0bc2a01b73 fix(tests): mock anthropic http calls in bedrock KB tests, update gcs pubsub fixture
Bedrock KB tests were hitting the anthropic API (via berrie proxy) and getting
401s. Fixed by mocking the AsyncHTTPHandler.post call in the 4 failing tests.

GCS pubsub v1 test was failing because SpendLogsMetadata added new fields
(user_api_key, status, error_information, etc.) that weren't in the expected
spend_logs_payload.json fixture.
2026-02-21 10:15:30 -08:00
Henrique Cavarsan
977ad015ca
fix(proxy): recover from prisma-query-engine zombie process (#21707) 2026-02-21 09:31:44 -08:00
yuneng-jiang
1e452338b9
Merge pull request #21765 from BerriAI/yj_build_fix
[Infra] Building UI for Release
2026-02-21 09:15:09 -08:00
yuneng-jiang
b35869a3ba chore: update Next.js build artifacts (2026-02-21 17:14 UTC, node v22.16.0) 2026-02-21 09:14:05 -08:00
yuneng-jiang
8ebaeb7229 fixing build 2026-02-21 09:13:33 -08:00
yuneng-jiang
425f4e53f1
Merge pull request #21502 from milan-berri/fix/ui-model-credentials-batch-files
fix: resolve credentials for UI-created models in batch file uploads
2026-02-21 09:05:00 -08:00
Harshit Jain
e463fc22d9
Merge pull request #21763 from Harshit28j/litellm_feat_sticky_sessions
feat: add session_id to have better routing
2026-02-21 21:21:52 +05:30
Harshit Jain
f3ff9bf54f
Merge pull request #21009 from BerriAI/litellm_docker-count-no-req
add tests for hotpath & docker container
2026-02-21 20:57:28 +05:30
Harshit Jain
456d8f5524 feat: add session_id to have better routing 2026-02-21 18:45:50 +05:30
github-actions[bot]
e487d711d6
chore: regenerate poetry.lock to match pyproject.toml (#21758)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-21 11:26:55 +00:00
Harshit Jain
1df9bd96c7
Merge pull request #21743 from Harshit28j/litellm_rollback_safety_checks
doc: add rollback safety check
2026-02-21 13:13:43 +05:30
kang hee yong
03ecdf9284
feat(openrouter): add openrouter/minimax/minimax-m2.5 pricing (#21664) 2026-02-20 22:24:58 -08:00
yuneng-jiang
1fb7320b6d
Merge pull request #21745 from BerriAI/litellm_org_member_email_ui
[Feature] UI - Organization Info: Show member email, AntD tabs, reusable MemberTable
2026-02-20 21:49:27 -08:00
yuneng-jiang
ffc673da09 fix: use include user:True instead of nested select for Prisma Python compat
Prisma Python client does not support nested select within include.
Use include user:True to fetch the full user object; model_validator
extracts user_email from it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 21:41:53 -08:00
yuneng-jiang
4597d34344 feat: org info page - AntD tabs, MemberTable with user_email
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 21:41:53 -08:00
yuneng-jiang
a5ee421eef refactor: TeamMemberTab uses shared MemberTable component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 21:41:53 -08:00
yuneng-jiang
14e8af94a9 feat: add reusable MemberTable AntD component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 21:41:53 -08:00
yuneng-jiang
b61537cd0f feat: expose user_email in organization members response
Add user_email field to LiteLLM_OrganizationMembershipTable with a model_validator
that populates it from the nested user object, and update the /organization/info
Prisma query to select user_email from the related user record.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 21:41:53 -08:00
Harshit Jain
80c3b236e2
Update docs/my-website/docs/troubleshoot/rollback.md
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-21 10:40:41 +05:30
Harshit Jain
5916cf15ad
Update docs/my-website/docs/troubleshoot/rollback.md
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-21 10:40:31 +05:30
Harshit Jain
ece5b8c565
doc: add rollback safety check 2026-02-21 10:33:17 +05:30
yuneng-jiang
36efd5384e
Merge pull request #21739 from BerriAI/litellm_credential_tag_prefix
[Feature] UI - Usage: Prefix credential tags, update Tag usage banner
2026-02-20 21:00:16 -08:00
yuneng-jiang
9f3e20510d feat(usage): prefix credential tags and update Usage page banners
- Prefix credential name tags with "Credential: " to distinguish them
  from user-defined tags when litellm_credential_name is injected
- Remove stale "new feature" banners from Organization, Customer, and
  A2A usage views
- Add closable info banner to Tag usage view noting that reusable
  credentials are automatically tracked and appear as "Credential: <name>"
2026-02-20 20:55:57 -08:00
yuneng-jiang
b7efca22a2
Merge pull request #21723 from BerriAI/litellm_fix_cost_token_masking
[Fix] Model Info: input_cost_per_token masked in UI
2026-02-20 20:36:22 -08:00
yuneng-jiang
8767b8f886
Merge pull request #21721 from BerriAI/litellm_suppress_dashboard_team_warn
[Fix] Suppress warning for litellm-dashboard team in agent permission handler
2026-02-20 20:36:09 -08:00
Ishaan Jaff
8e2aeeae0b
feat(ui): Guardrail Garden - guardrail marketplace (#21732)
* feat(ui): add Guardrail Garden page with Vertex-style card layout

* feat(ui): add guardrail garden preset configs for form pre-fill

* feat(ui): add Guardrail Garden as first tab on guardrails page

* feat(ui): support preset prop in AddGuardrailForm for garden pre-fill

* fix(ui): fix merge syntax error in ComplianceUI

* refactor(ui): split guardrail_garden.tsx into focused modules
2026-02-20 19:47:04 -08:00
Krish Dholakia
0888e17272
fix: ui fixes (#21731) 2026-02-20 19:29:55 -08:00
Ishaan Jaff
08520a9ed7
feat: add insults content filter + topic blocking compliance UI (#21729)
* add denied_insults.yaml content filter category

* add block_insults.csv eval set (299 cases)

* add block_insults.jsonl eval set (299 cases)

* add insults eval results (100% F1)

* add TestInsultsContentFilter eval class

* add generate_compliance_prompts.py script

* add insultsCompliancePrompts.ts (299 prompts from CSV)

* add financialCompliancePrompts.ts (207 prompts from CSV)

* add Topic Blocking framework to compliance playground UI
2026-02-20 19:10:31 -08:00
Krish Dholakia
e8d0afd7cb
Guardrail - competitor name blocker (#21719)
* feat: add competitor name blocker guardrail

* fix: fix batch test endpoint for compliance playground

* fix(airline.py): add list of all known airlines to airline competitor name detector

prevent competitor discussion on company chatbot

* feat: ui tweaks for prod
2026-02-20 18:52:40 -08:00
Ishaan Jaff
c61dea5af9
UI: Redesign guardrail creation form with vertical stepper (#21727)
* ui: redesign guardrail creation form with inline vertical stepper

Replace horizontal Ant Design Steps with an inline vertical stepper.
Completed steps collapse to a single line, active step expands.
Switch to Tremor buttons, rename steps for clarity.

* ui: rename Content Categories to Blocked topics and fix overflow

Update heading and description text, add flexWrap to prevent
text from going off-screen, fix YAML preview overflow with
pre-wrap and word-break.

* feat: support explicit display_name in content filter category YAML

Check for a display_name field before auto-generating from
category_name. Lets categories have human-friendly names
without changing their API identifier.

* fix: update denied_financial_advice display name

Add display_name field so it shows as
"Denied Financial / Investment Advice" in the UI.
2026-02-20 18:42:11 -08:00
yuneng-jiang
9eb61a9a56 fix: use UI_TEAM_ID constant instead of hardcoded string
Replace hardcoded "litellm-dashboard" string with the existing UI_TEAM_ID
constant from litellm.proxy._types to avoid duplication.
2026-02-20 18:14:57 -08:00
yuneng-jiang
65961988cb
Update litellm/proxy/agent_endpoints/auth/agent_permission_handler.py
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-20 18:13:50 -08:00
yuneng-jiang
ac7446bb76 fix: don't mask cost_per_token fields in SensitiveDataMasker
Fields like input_cost_per_token contain "token" as a key segment,
which incorrectly matched the sensitive patterns list and caused values
like 3.6e-06 to be displayed as "3.60*******e-06" in the model info UI.

Add a non_sensitive_overrides set (defaulting to {"cost"}) so that any
key containing "cost" as a segment is never masked, regardless of other
matching patterns.
2026-02-20 18:13:27 -08:00
Ishaan Jaff
e0129710c8
fix(proxy): self-heal Prisma connection for auth and runtime (#21706)
* fix(proxy): add prisma reconnect primitive and db watchdog

* fix(proxy): start and stop prisma watchdog in lifecycle

* fix(auth): retry key lookup once after prisma reconnect

* test(proxy): add prisma self-heal watchdog coverage

* test(auth): cover reconnect-once behavior for key lookup

* refactor(auth): extract db reconnect helper and remove inline import

* fix(proxy): apply reconnect cooldown after attempt and add auth timeout path

* fix(auth): bound reconnect latency on key lookup path

* test(auth): assert reconnect timeout argument in key lookup

* test(proxy): verify reconnect cooldown timestamp set after attempt

* fix(proxy): harden prisma reconnect cycle semantics

* test(proxy): cover watchdog reconnect + timeout budget

* fix(proxy): bound watchdog probe and reconnect paths

* test(proxy): cover watchdog timeout and probe behavior

* fix(proxy): narrow prisma db connection error classification

* fix(proxy): add auth reconnect lock timeout budget

* fix(auth): pass lock timeout for db reconnect retries

* test(proxy): cover narrow prisma connection error detection

* test(proxy): add reconnect lock-timeout behavior coverage

* test(auth): assert reconnect lock timeout argument

* fix(proxy): avoid lock leak race in reconnect lock timeout path

* test(proxy): cover reconnect lock-timeout race cleanup
2026-02-20 18:11:36 -08:00
Ishaan Jaff
5246e64b98
Add topic blocker guardrail with keyword and embedding implementations (#21713)
* Add keyword-based topic blocker implementation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add embedding-based topic blocker using MiniLM

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add topic blocker package init with exports

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add synthetic engine eval set (34 cases)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add investment questions eval set (207 cases)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add engine eval synthetic policy config

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add engine keyword blocker eval results

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add investment keyword blocker eval results

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add investment embedding blocker eval results

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add investment embedding MiniLM eval results

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add investment embedding MPNet eval results (historical)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add investment TF-IDF eval results (historical)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add unified eval runner with confusion matrix reporting

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add benchmarks comparison table in markdown

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Clean up topic blocker: remove unused blockers, add phrase_patterns to content filter

- Remove embedding_blocker.py, api_embedding_blocker.py, nli_blocker.py,
  tfidf_blocker.py, onnx_blocker.py (heavy deps not in Docker, inferior accuracy)
- Remove airline_off_topic_restriction policy template and its test
- Fix __init__.py to only export DeniedTopic and TopicBlocker (no eager import crash)
- Add phrase_patterns support to ContentFilterGuardrail for regex-based paraphrase detection
- Rewrite denied_financial_advice.yaml with conditional matching (identifier + block word),
  always-block keywords, phrase patterns, and exception phrases
- Clean up test_eval.py: only keyword blocker + content filter tests remain (no network calls)
- All 207 eval cases pass at 100% F1, 0 FP, 0 FN, <0.1ms latency

Addresses all Greptile review comments:
- Eager import crash (embedding deps) → fixed
- Undeclared dependencies → fixed (files deleted)
- lru_cache memory leak → fixed (file deleted)
- Real network calls in tests → fixed (embedding tests removed)
- Unused Dict import → already fixed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add LLM-as-judge eval and update BENCHMARKS.md

- Add TestInvestmentLlmJudgeGpt4oMini and TestInvestmentLlmJudgeClaude
  test classes that use litellm.completion() to classify messages
- System prompt instructs LLM to act as airline chatbot content moderator
- Tests skip gracefully when API keys aren't set
- Update BENCHMARKS.md with production results table, historical comparison,
  and instructions for running LLM judge evals

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Move evals and benchmarks to guardrail_benchmarks folder

Move eval runner, eval data (JSONL), and results from
tests/test_litellm/.../topic_blocker/ into the guardrail implementation
folder at litellm/.../litellm_content_filter/guardrail_benchmarks/.

This keeps benchmarks co-located with the guardrail code they test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Remove standalone topic_blocker package, consolidate into content_filter

The standalone keyword_blocker.py was redundant with content_filter.py +
denied_financial_advice.yaml. Removed the entire topic_blocker/ package,
engine eval files, and old keyword blocker results. Simplified test_eval.py
to only test ContentFilter + LLM judge baselines.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Fix compliance playground batch scoring bug, add display_name support

The compliance playground was sending all texts in a single batch API call,
but the content filter raises HTTPException on the first blocked text. This
caused a single blocked/allowed result to be applied to all rows, producing
incorrect scores (e.g. 41% instead of 100%). Fix by sending each text
individually to get per-text results with progressive UI updates.

Also add display_name field support for category YAML files so
denied_financial_advice shows as "Denied Financial / Investment Advice"
in the UI dropdown.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add block_investment CSV eval set and update benchmark result JSON

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* address greptile review feedback (greploop iteration 1)

Fix stale test path in denied_financial_advice.yaml comment.
Other comments were on files already deleted in prior commits.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 18:02:04 -08:00
yuneng-jiang
883a8e0589 fix: suppress noisy warning for litellm-dashboard team in agent permission handler
litellm-dashboard is the default UI team and will never have agents registered.
Skip the warning log when get_team_object raises a 404 for this team to avoid
log noise.
2026-02-20 17:57:07 -08:00
ryan-crabbe
5fb0521eff
Merge pull request #21720 from BerriAI/litellm_claude-code-duplicate-detection
feat: route gh actions through litellm
2026-02-20 17:55:57 -08:00
yuneng-jiang
5084fe9538
Merge pull request #21715 from BerriAI/litellm_credential_tag_usage
[Feature] Inject Credential Name as Tag for Usage Page Filtering
2026-02-20 17:51:28 -08:00
Ryan Crabbe
1d0f91010b feat: switch duplicate detection workflows from opencode to Claude Code
Route through LiteLLM proxy using LITELLM_VIRTUAL_KEY and LITELLM_BASE_URL
secrets. Also adds --repo flag to all gh commands to fix missing repo context.
2026-02-20 17:51:12 -08:00
ryan-crabbe
dbff558d96
Merge pull request #21717 from BerriAI/litellm_fix_redis_connection_pool_leaks
fix: redis connection pool reliability
2026-02-20 17:42:48 -08:00
Ryan Crabbe
05d18e60b2 fix: add logging to sync client close failure in disconnect() 2026-02-20 17:36:36 -08:00
Ryan Crabbe
bfeed0e590 fix: also close sync clients on eviction from LLMClientCache 2026-02-20 17:36:28 -08:00
yuneng-jiang
8ea28dde88
Merge pull request #21718 from BerriAI/yj_release_feb20
[Infra]  litellm_release_day_02_19_2026 fixes
2026-02-20 17:35:44 -08:00