Commit graph

32269 commits

Author SHA1 Message Date
Yuneng Jiang
716f87bf78
chore: fixes
Some checks failed
Unit Tests: Caching (Redis) / caching-redis (push) Has been cancelled
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-05 00:20:36 -07:00
Krrish Dholakia
23d3d511c2 fix(ui/): add mcp input as an example for custom code guardrails 2026-02-14 09:57:50 -08:00
Krrish Dholakia
11b0958592 feat(a2a/): support streaming guardrails 2026-02-14 09:57:23 -08:00
Krrish Dholakia
f30f883744 feat(a2a/): ensure a2a guardrails works on response output 2026-02-14 09:57:23 -08:00
Krrish Dholakia
b77f2e046b fix(ui/): add mcp input as an example for custom code guardrails 2026-02-14 09:57:23 -08:00
Krish Dholakia
e41ecc7a71
Guardrails - add nsfw policy template, toxic keywords in multiple languages, child safety content filter, json content viewer (#21205)
* fix(content_filter.py): fix filter on toxic keywords

* feat: improve toxic/abusive language detection

* fix: additional improvements to nsfw filters

* feat: more improvements to nsfw filter

* feat(content_filter.json): add new australia specific nsfw content filter

ensure complete coverage for australia nsfw

* fix: cleanup policy templates

* fix(index.tsx): alert notice

* fix(index.tsx): add disclaimer notice

* feat(harmful_child_safety.yaml): new child safety content filter

ensure we catch inappropriate, child-specific content

* feat(policy_templates.json): add child safety and self harm filters

* fix(content_filter.py): improve racial bias filter to use a similar identifier + block word pattern and cover a wider range of ethnicities

* feat(policy_templates.json): add racial bias to nsfw policy template

* feat: add json content viewer
2026-02-14 09:41:55 -08:00
jquinter
2e8056432f
Merge pull request #21202 from jquinter/fix-unused-variable-pipeline-executor
fix: remove unused variable original_guardrails in pipeline_executor
2026-02-14 14:36:01 -03:00
Ishaan Jaffer
1e257db0a5 fix MYPY linting + JSON refs 2026-02-14 09:34:56 -08:00
Julio Quinteros Pro
6caedfd2a5 fix: remove unused variable original_guardrails in pipeline_executor
Remove unused local variable 'original_guardrails' that was assigned
but never used in the _execute_guardrail_step method.

Fixes Ruff F841 linting error.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-14 14:32:32 -03:00
yuneng-jiang
951c230ff0
Merge pull request #21201 from BerriAI/ui_build_feb14
[Infra] UI - Building for Release
2026-02-14 09:30:57 -08:00
yuneng-jiang
0f3494659a chore: update Next.js build artifacts (2026-02-14 17:29 UTC, node v22.16.0) 2026-02-14 09:29:42 -08:00
Ishaan Jaff
f8334dfeda
ci/cd fixes - streaming role & bedrock model cost (#21200)
* fix(model_cost): add missing supports_system_messages and supports_tool_choice to bedrock/moonshotai.kimi-k2.5

* fix(streaming): ensure role=assistant is set on first streaming chunk via strip_role_from_delta

* fix(vertex_ai): ensure role=assistant on first streaming chunk for Llama models

Add VertexAILlama3StreamingHandler that injects role='assistant' into the
first streaming chunk delta when the Vertex AI Llama API omits it.
2026-02-14 09:18:29 -08:00
Ishaan Jaffer
c32544a284 fix MYPY linting 2026-02-14 09:11:09 -08:00
shin-bot-litellm
84934a7258
fix(anthropic): filter unsupported JSON schema constraints for structured outputs (#20813)
* fix(anthropic): filter unsupported JSON schema constraints for structured outputs

Fixes 400 error when using Anthropic models with structured outputs that have
min/max constraints.

The Anthropic API doesn't support these JSON schema constraints:
- minimum/maximum (numeric)
- exclusiveMinimum/exclusiveMaximum (numeric)
- minLength/maxLength (string)
- minItems/maxItems (array)

This mirrors the transformation done by the official Anthropic Python SDK.
See: https://platform.claude.com/docs/en/build-with-claude/structured-outputs#how-sdk-transformation-works

Adds tests for the schema filtering function.

* fix: update descriptions with removed constraint info in filter_anthropic_output_schema

Address review feedback: the function now appends removed constraint
information to the description field (matching Anthropic SDK behavior),
rather than silently dropping constraints.

---------

Co-authored-by: OpenClaw <openclaw@users.noreply.github.com>
2026-02-14 09:07:40 -08:00
Ishaan Jaff
96802e177b
Add pipeline flow builder UI for guardrail policies (#21188)
* Add pipeline type definitions for guardrail pipelines

PipelineStep, GuardrailPipeline, PipelineStepResult, PipelineExecutionResult
with validation for actions (allow/block/next/modify_response) and modes.

* Export pipeline types from policy_engine types package

* Add optional pipeline field to Policy model

* Add pipeline executor for sequential guardrail execution

* Parse pipeline config in policy registry

* Add pipeline validation in policy validator

* Add pipeline resolution and managed guardrail tracking

* Resolve pipelines and exclude managed guardrails in pre-call

* Integrate pipeline execution into proxy pre_call_hook

* Add test guardrails for pipeline E2E testing

* Add example pipeline config YAML

* Add unit tests for pipeline type definitions

* Add unit tests for pipeline executor

* Add pipeline column to LiteLLM_PolicyTable schema

* Add pipeline field to policy CRUD request/response types

* Add pipeline support to policy DB CRUD operations

* Add PipelineStep and GuardrailPipeline TypeScript types

* Add Zapier-style pipeline flow builder UI component

* Integrate pipeline flow builder with mode toggle in policy form

* Add pipeline display section to policy info view

* Add unit tests for pipeline in policy CRUD types

* Refactor policy form to show mode picker first with icon cards

* Add full-screen FlowBuilderPage component for pipeline editing

* Wire up full-screen flow builder in PoliciesPanel with edit routing

* Restyle flow builder to match dev-tool UI aesthetic

* Restyle flow builder cards to match reference design

* Update step card to expanded layout with stacked ON PASS / ON FAIL sections

* Add end card to flow builder showing return to normal control flow

* Add PipelineTestRequest type for test-pipeline endpoint

* Export PipelineTestRequest from policy_engine types

* Add POST /policies/test-pipeline endpoint

* Add testPipelineCall networking function

* Add PipelineStepResult and PipelineTestResult types

* Add test pipeline panel to flow builder with run button and results display

* Fix pipeline executor: inject guardrail name into metadata so should_run_guardrail allows execution

* Update litellm/proxy/policy_engine/pipeline_executor.py

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

* Update litellm/proxy/utils.py

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

* Update litellm/proxy/policy_engine/policy_endpoints.py

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

* Update litellm/proxy/policy_engine/pipeline_executor.py

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

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-13 20:06:03 -08:00
Ishaan Jaff
08b61f49a4
[Guardrails] Add guardrail pipeline support for conditional sequential execution (#21177)
* Add pipeline type definitions for guardrail pipelines

PipelineStep, GuardrailPipeline, PipelineStepResult, PipelineExecutionResult
with validation for actions (allow/block/next/modify_response) and modes.

* Export pipeline types from policy_engine types package

* Add optional pipeline field to Policy model

* Add pipeline executor for sequential guardrail execution

* Parse pipeline config in policy registry

* Add pipeline validation in policy validator

* Add pipeline resolution and managed guardrail tracking

* Resolve pipelines and exclude managed guardrails in pre-call

* Integrate pipeline execution into proxy pre_call_hook

* Add test guardrails for pipeline E2E testing

* Add example pipeline config YAML

* Add unit tests for pipeline type definitions

* Add unit tests for pipeline executor

* Update litellm/proxy/policy_engine/pipeline_executor.py

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

* Update litellm/proxy/utils.py

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

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-13 19:49:12 -08:00
shin-bot-litellm
f915b15e92
fix(mypy): Fix type errors across multiple files (#21180)
- vertex_ai/gemini/transformation.py: Fix TypedDict assignment via dict alias
- mcp_server/server.py: Convert ASGI scope to dict for type compatibility
- pass_through_endpoints.py: Add explicit Optional[dict] type annotation
- vector_store_endpoints/endpoints.py: Add Any type for dynamic proxy hook
- responses transformation.py: Use dict(Reasoning()) and setattr for compatibility
- zscaler_ai_guard.py: Add assert for api_base nullability

Co-authored-by: OpenClaw <openclaw@users.noreply.github.com>
2026-02-13 18:20:31 -08:00
shin-bot-litellm
933955bfa0
fix(ci): Fix E2E login button selector - use exact match (#21176)
* fix(ci): Fix ruff lint error - unused import

Remove unused 'cast' import in vertex_ai_ingestion.py (ruff F401)

* fix(ci): Fix E2E login button selector - use exact match

Login button selector now matches both 'Login' and 'Login with SSO',
causing strict mode violation. Use { exact: true } to match only 'Login'.

---------

Co-authored-by: OpenClaw <openclaw@users.noreply.github.com>
2026-02-13 18:20:10 -08:00
shin-bot-litellm
e957030997
fix(ci): Fix mypy type errors across 6 files (#21179)
- vertex_ai/gemini: fix TypedDict assignment via explicit dict cast
- mcp_server: convert MutableMapping scope to dict for type safety
- pass_through_endpoints: simplify custom_body logic to fix type narrowing
- vector_store_endpoints: add Any annotation for dynamic hook return
- responses transformation: use dict() for Reasoning and setattr for dynamic field
- zscaler_ai_guard: add assert for api_base None check

Co-authored-by: shin-bot-litellm <shin-bot-litellm@users.noreply.github.com>
2026-02-13 18:14:43 -08:00
shin-bot-litellm
3ec91d4333
fix(ci): Fix ruff lint error - unused import in vertex_ai_ingestion (#21178)
Co-authored-by: shin-bot-litellm <shin-bot-litellm@users.noreply.github.com>
2026-02-13 18:14:23 -08:00
shin-bot-litellm
df54e1b452
fix(model_info): Add missing tpm/rpm for Gemini models (#21175)
Several Gemini models (TTS, native-audio, robotics, gemma) were missing
tpm/rpm values, causing test_get_model_info_gemini to fail.

Added conservative default values (tpm=250000, rpm=10) for preview models.
gemini-2.5-flash-preview-tts gets tpm=4000000, rpm=10.

Co-authored-by: OpenClaw <openclaw@users.noreply.github.com>
2026-02-13 18:07:01 -08:00
Alexsander Hamir
30b28da2b7
Add pyroscope for observability (#21167)
* Pyroscope: require PYROSCOPE_APP_NAME and PYROSCOPE_SERVER_ADDRESS, add UTF-8 locale hint

- No defaults for PYROSCOPE_APP_NAME or PYROSCOPE_SERVER_ADDRESS; fail at startup if unset when Pyroscope is enabled
- Set LANG/LC_ALL to C.UTF-8 when unset to reduce malformed_profile (invalid UTF-8) rejections
- Startup message suggests PYTHONUTF8=1 if server rejects profiles
- Simplify LITELLM_ENABLE_PYROSCOPE in config_settings; document Pyroscope env vars as required with no default
- Add pyroscope_profiling to sidebar (Alerting & Monitoring)
- pyproject.toml: pyroscope-io as required dep on non-Windows (marker), in proxy extra

* proxy: add PYROSCOPE_SAMPLE_RATE env, use verbose logging, fix int type

- Add optional PYROSCOPE_SAMPLE_RATE env (integer, no default)
- Pass sample_rate to pyroscope.configure() as int for pyroscope-io
- Replace print with verbose_proxy_logger (info/warning)
- Document PYROSCOPE_SAMPLE_RATE in config_settings.md

* Address Greptile PR feedback: Pyroscope optional, docs, tests, docstring

- pyproject.toml: mark pyroscope-io as optional=true (proxy extra only)
- Add docs/my-website/docs/proxy/pyroscope_profiling.md (fix broken sidebar link)
- Add tests/test_litellm/proxy/test_pyroscope.py for _init_pyroscope()
- proxy_server: fix _init_pyroscope docstring (required server/app name, sample rate as int)

* Update litellm/proxy/proxy_server.py

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

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-13 17:32:29 -08:00
yuneng-jiang
1828e68515
Merge pull request #21166 from BerriAI/litellm_access_group_rename
[Refactor] Access Group model_ids to model_names for backwards Compatability
2026-02-13 17:22:17 -08:00
yuneng-jiang
3ebafc4a10
Merge pull request #21165 from BerriAI/litellm_access_group_ui
[Feature] UI - Access Groups: Table and Details Page
2026-02-13 17:17:18 -08:00
yuneng-jiang
41445ff8ad migration + build files 2026-02-13 17:15:39 -08:00
yuneng-jiang
38e2ecb52c bump: version 0.4.36 → 0.4.37 2026-02-13 17:15:05 -08:00
yuneng-jiang
60954d22e3 Merge remote-tracking branch 'origin' into litellm_access_group_rename 2026-02-13 17:04:59 -08:00
Ishaan Jaff
b48bec0e4b
fix: populate identity fields in proxy admin JWT early-return path (#21169)
* fix: populate identity fields in proxy admin JWT early-return path

When is_proxy_admin is True, the UserAPIKeyAuth early-return now includes
user_id, team_id, team_alias, team_metadata, org_id, and end_user_id
resolved from the JWT. Previously only user_role and parent_otel_span
were set, causing blank Team Name and Internal User in Request Logs UI.

* test: add unit tests for proxy admin JWT identity fields
2026-02-13 17:04:38 -08:00
yuneng-jiang
ea2e5ff0b9 allow editing of access group names 2026-02-13 17:03:41 -08:00
yuneng-jiang
7561c1a3c3 addressing comments 2026-02-13 16:54:34 -08:00
yuneng-jiang
72848f4c08 change to model name for backwards compat 2026-02-13 16:44:49 -08:00
The Mavik
ab4b6197ef
fix: add custom_body parameter to endpoint_func in create_pass_through_route (#20849)
* fix: add custom_body parameter to endpoint_func in create_pass_through_route

The bedrock_proxy_route calls `endpoint_func(custom_body=data)` to
pass a pre-parsed, SigV4-signed request body. However, the
`endpoint_func` closure created by `create_pass_through_route` does
not accept a `custom_body` keyword argument, causing:

    TypeError: endpoint_func() got an unexpected keyword argument 'custom_body'

Add `custom_body: Optional[dict] = None` to both `endpoint_func`
definitions (adapter-based and URL-based). In the URL-based path,
when `custom_body` is provided by the caller, use it instead of
re-parsing the body from the raw request.

Fixes #16999

* Add tests for custom_body handling in create_pass_through_route

Address reviewer feedback on PR #20849:

- Document why the adapter-based endpoint_func accepts custom_body
  for signature compatibility but does not forward it (the underlying
  chat_completion_pass_through_endpoint does not support it).
- Add test_create_pass_through_route_custom_body_url_target: verifies
  that when a caller (e.g. bedrock_proxy_route) supplies custom_body,
  it takes precedence over the body parsed from the raw request.
- Add test_create_pass_through_route_no_custom_body_falls_back:
  verifies that the default path (no custom_body) correctly uses the
  request-parsed body, preserving existing behavior.

Both tests are fully mocked following the project's CONTRIBUTING.md
guidelines and the patterns established in the existing test file.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: themavik <themavik@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-13 16:44:40 -08:00
yuneng-jiang
ca2ce4a946 adding tests 2026-02-13 16:30:24 -08:00
yuneng-jiang
2f3dc4860f new badge changes 2026-02-13 16:22:07 -08:00
yuneng-jiang
5dbcca8d43 Access groups UI 2026-02-13 16:20:31 -08:00
Ishaan Jaff
a06113ec82
feat: MCP OAuth2 client-side debug headers (#21151)
* fix: SCOPES on Atlassian issue

* feat: add MCPDebug class for client-side MCP OAuth2 debugging

* feat: inject MCP debug headers into streamable HTTP response path

* test: add unit tests for MCPDebug class

* fix: refactor MCPDebug - move all logic into class static methods

* fix: collapse server.py debug code to two-liner using MCPDebug methods

* test: add tests for resolve_auth_resolution and wrap_send_with_debug_headers

* docs: add MCP debug headers section to troubleshooting guide

* docs: add Debugging OAuth section to mcp_oauth.md

* docs: replace inline debug section with cross-link to mcp_oauth

* docs: extract UI troubleshooting into its own page

* docs: simplify troubleshoot.md to issue reporting only

* docs: add quick-start debug command to MCP troubleshoot page

* docs: restructure sidebar - UI, MCP, Performance, Issue Reporting
2026-02-13 12:55:47 -08:00
Ishaan Jaffer
817de99177 UI build 2026-02-13 12:51:17 -08:00
Ishaan Jaff
40b290aa84
fix: MCP Gateway SCOPES on Atlassian issue (#21150)
* fix: SCOPES on Atlassian issue

* test: add regression tests for scopes=None in OAuth discovery endpoints
2026-02-13 12:43:56 -08:00
yuneng-jiang
71107b3fd0
Merge pull request #21149 from BerriAI/litellm_spendlogs_reset_custom_time
[Fix] UI - Spend Logs: Reset Filters Resets Custom Date Range
2026-02-13 12:30:45 -08:00
yuneng-jiang
eb144a44d0
Merge pull request #21144 from BerriAI/litellm_ui_fallbacks_10
[Refactor] UI - Fallbacks: Default Configurable to 10 Models
2026-02-13 12:30:35 -08:00
yuneng-jiang
82fcc39e6b reset custom time range when reset filters is clicked 2026-02-13 12:12:50 -08:00
Ishaan Jaff
568edde87a
docs: fix Claude Code MCP tutorial with correct config and URL patterns (#21145)
- Fix Atlassian config: use http transport and correct URL (/v1/mcp not /v1/sse)
- Fix URL pattern: use standard /mcp/<server_name> not legacy /<server_name>/mcp
- Add parameter breakdown table explaining each claude mcp add argument
- Add warning that server name in proxy config must match URL path
- Add ngrok step for OAuth callback accessibility
- Add ~/.claude.json config option alongside claude mcp add
- Fix auth header guidance: use x-litellm-api-key for OAuth servers
2026-02-13 12:12:38 -08:00
yuneng-jiang
6eeb9b109b
Merge pull request #21143 from BerriAI/litellm_model_id_search
[Feature] UI - Spend Logs: Sorting Columns
2026-02-13 11:53:16 -08:00
yuneng-jiang
724ab1c154
Update ui/litellm-dashboard/src/components/networking.tsx
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-13 11:53:04 -08:00
Krish Dholakia
24b56a14eb
Guardrails - new Policy Templates (pre-configured guardrail combinations for specific use-cases) (#21025)
* feat(patterns.json): add australia specific pii patterns - tax file number, abn, medicare number

Improve PII detection for australian contexts

* feat(patterns.json): add iban + street address pattern detection

* feat: support policy templates on ui

allows admin to enable pre-configured guardrails

helps cover specific use-cases well

* feat: create missing guardrails, working policy templates

* feat: policy_templates.json

support hosted policy templates

allows others to contribute to the policy templates

* docs: document new policy templates

* fix: address greptile feedback

* fix: fix linting error
2026-02-13 11:53:02 -08:00
yuneng-jiang
25fccad127 Change default fallbacks to 10 models 2026-02-13 11:50:13 -08:00
yuneng-jiang
adc2859f0a sorting spend logs in ui 2026-02-13 11:33:41 -08:00
datzscaler
aab8edde67
fix(guardrails): Zscaler AI Guard bug fixes and support during post-call (#20801)
* fix(guardrails): fixed post-call issue with Zscaler guardrail and invalid headers. Added unittests

* fix(guardrails): Addressed greptil comments. Make policyid hanlding more clear

* fix(guardrails): Address greptile comment

* Update litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py

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

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-13 11:28:14 -08:00
Sameer Kankute
066e694f5e
Merge pull request #21110 from BerriAI/litellm_litellm_anthropic_remote_url3
Add support for remote URL fetching for anthropic beta header mapping
2026-02-14 00:30:51 +05:30
Ishaan Jaff
a1b7261502
Remove exposed API key from example configuration in mcp_server_manager.py (#21129)
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-02-13 09:52:38 -08:00