Commit graph

31338 commits

Author SHA1 Message Date
yuneng-jiang
e181f2daa4
Merge pull request #19694 from BerriAI/litellm_ci_fix_yj_02
[Infra] CI/CD - Fixing UI Build
2026-01-23 22:12:38 -08:00
yuneng-jiang
1dbb6e0d3f fixing build 2026-01-23 22:11:49 -08:00
Harshit Jain
c9d5185099
fix(docker): use correct schema path for prisma generation (#19631) 2026-01-23 21:22:19 -08:00
Harshit Jain
09b07df587
fix: propagate JWT auth metadata to OTEL spans (#19627) 2026-01-23 21:21:23 -08:00
jquinter
f43757f71b
Feature/guardrail model argument (#19619)
* [Feat] Add model parameter to Generic Guardrail API

Add model information to guardrail requests, allowing guardrails to make
model-specific security decisions.

Changes:
- Add `model` field to GenericGuardrailAPIInputs TypedDict
- Add `model` field to GenericGuardrailAPIRequest Pydantic model
- Update OpenAI and Anthropic handlers to pass model from request/response
- Add unit tests for model parameter handling

* [Feat] Add model parameter to all guardrail_translation handlers

Extend model parameter support to all guardrail handlers for consistent
implementation across all endpoint types:
- OpenAI Responses API (input/output + streaming)
- OpenAI Image Generation (input only)
- OpenAI Text Completion (input/output)
- OpenAI Text-to-Speech (input only)
- OpenAI Audio Transcription (output only)
- Cohere Rerank (input only)
- Pass-through Endpoints (input/output)
- MCP Server (input only)

This addresses the review feedback requesting consistent model parameter
handling across all guardrail_translation/handler.py files.

---------

Co-authored-by: Igal Boxerman <igal@pillar.security>
2026-01-23 20:48:42 -08:00
Cesar Garcia
31a8d76d11
Update Gemini 2.0 Flash deprecation dates to March 31, 2026 (#19592)
Google announced that Gemini 2.0 Flash and Flash Lite models will be discontinued on March 31, 2026. Updated deprecation_date field for all affected model variants across different providers (vertex_ai, gemini, deepinfra, openrouter, vercel_ai_gateway).

Models updated:
- gemini-2.0-flash (added deprecation date)
- gemini-2.0-flash-001 (updated from 2026-02-05)
- gemini-2.0-flash-lite (added deprecation date)
- gemini-2.0-flash-lite-001 (updated from 2026-02-25)

All variants now correctly reflect the March 31, 2026 shutdown date.
2026-01-23 20:36:36 -08:00
John Greek
4c5351f43b
[Fix] Password comparison with non-ASCII characters (#19559) (#19568) 2026-01-23 20:27:42 -08:00
Marcos Griselli
6b1ce4e766
fix(rag): use router for completion in RAG query pipeline (#19550)
The RAG query endpoint was failing with "Object of type Router is not
JSON serializable" when called through the proxy. This was caused by two
issues:

1. The Router object passed via kwargs was leaking into the request
   payload sent to providers like Bedrock, causing JSON serialization
   errors.

2. The RAG query pipeline was calling litellm.acompletion() directly
   instead of using the router, so virtual model names configured in the
   proxy weren't being resolved to actual provider model IDs.

This fix:
- Extracts the router from kwargs and uses router.acompletion() when
  available, falling back to litellm.acompletion() otherwise
- Adds "Router" to the list of non-serializable types in
  filter_exceptions_from_params as a defensive measure

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 20:11:17 -08:00
Priyam Manna
ac0ab214fb
fix(ui): Change default key type from 'Default' to 'LLM API' for improved security (#19516)
- Changed initial keyType state to 'llm_api' instead of 'default'
- Updated reset functions (handleOk, handleCancel) to use 'llm_api'
- Updated form initialValue and Select defaultValue to 'llm_api'

Addresses #19492
2026-01-23 19:58:49 -08:00
houdataali
7ffc1a718a
a2a agent Header-Based Context Propagation (#19504)
* a2a agent Header-Based Context Propagation

* docs: add guide for A2A context header forwarding
2026-01-23 19:56:04 -08:00
Misha
de538456e3
feat: support role_mappings from environment variables (#19498)
* feat: support role_mappings from environment variables

* fix linter
2026-01-23 19:54:23 -08:00
Harshit Jain
f4ba5b9209
docs: add litellm-enterprise requirement for managed files (#19689) 2026-01-23 19:51:39 -08:00
Ishaan Jaff
a870722f65
[Feat] UI + Backend - Allow adding policies on Keys/Teams + Viewing on Info panels (#19688)
* ui for policy mgmt

* test_add_guardrails_from_policy_engine_accepts_dynamic_policies_and_pops_from_data
2026-01-23 19:03:44 -08:00
yuneng-jiang
4ed5aa5de0
Merge pull request #19687 from BerriAI/litellm_ui_refresh_mcp
[Fix] UI - Redirect to ui/login on expired JWT
2026-01-23 18:09:44 -08:00
yuneng-jiang
a34664d8b0 redirect to login on expired jwt 2026-01-23 18:03:10 -08:00
Ishaan Jaffer
46ef001150 UI: new build 2026-01-23 17:40:54 -08:00
yuneng-jiang
26a6b86ea9
Merge pull request #19265 from naaa760/fix/guar-patt-edi
fix: ensure guardrail patterns persist on edit and mode toggle
2026-01-23 17:36:09 -08:00
ryan-crabbe
d67d12fc54
perf: Add LRU caching to get_model_info for faster cost lookups (#19606)
- Add @lru_cache decorator to get_model_info() and _cached_get_model_info_helper()
- Update _invalidate_model_cost_lowercase_map() to clear these caches when model_cost changes
- Update test to call cache invalidation after modifying litellm.model_cost

Reduces get_model_cost_information from 46% to <1% of request handling time.
2026-01-23 17:26:45 -08:00
yuneng-jiang
b5dfb57073
Merge pull request #19686 from BerriAI/litellm_key_team_create_routing_setting_ui
[Feature] UI - Create Team and Key Router Settings
2026-01-23 17:26:13 -08:00
ryan-crabbe
6e930c9724
perf: skip pattern_router.route() for non-wildcard models (#19664)
Check "*" in model before calling pattern_router.route() to avoid
unnecessary pattern matching for non-wildcard model configurations.
2026-01-23 17:21:41 -08:00
ryan-crabbe
54f9ad370f
perf: Optimize use_custom_pricing_for_model with set intersection (#19677)
* perf: Optimize use_custom_pricing_for_model with set intersection

Cache CustomPricingLiteLLMParams.model_fields.keys() as a module-level
frozenset and use set intersection to reduce loop iterations from 882k
to 90k (only iterating over keys that exist in both sets).

Performance improvement: 84% faster (6.3x speedup)
- Before: 1.17s total, 65µs per call
- After: 0.19s total, 10µs per call

* Use .get() for defensive dictionary access
2026-01-23 17:18:16 -08:00
yuneng-jiang
de9802578b Fixing tests 2026-01-23 17:15:50 -08:00
ryan-crabbe
0133d50a45
perf: Optimize strip_trailing_slash with O(1) index check (#19679)
* perf: Optimize strip_trailing_slash with O(1) index check

Replace rstrip("/") with direct index check for O(1) performance
instead of O(n) string scanning.

Results:
- strip_trailing_slash: 311ms → 13ms (96% faster)
- get_standard_logging_object_payload: 6.11s → 5.80s (5% faster)

* Handle multiple trailing slashes in strip_trailing_slash

Use rstrip for correctness when URL ends with "//" or more,
otherwise use O(1) index check for single trailing slash.
2026-01-23 17:12:08 -08:00
yuneng-jiang
f9bdc20be2 fixing tests 2026-01-23 17:07:51 -08:00
yuneng-jiang
ee1fd1c6c2 fixing build 2026-01-23 17:04:52 -08:00
yuneng-jiang
804567d681 Merge remote-tracking branch 'origin' into litellm_key_team_create_routing_setting_ui 2026-01-23 16:56:30 -08:00
yuneng-jiang
9850dbe934 Adding router settings to create team and key 2026-01-23 16:56:19 -08:00
Alexsander Hamir
5c61586e65
Add GCS mock mode for testing without API calls (#19683) 2026-01-23 16:25:32 -08:00
Alexsander Hamir
56883add3c
Add Langfuse mock mode for testing without API calls (#19676) 2026-01-23 15:33:40 -08:00
mubashir1osmani
8e060593bf
feat(vercel_ai_gateway): add embeddings support
feat(vercel_ai_gateway): add embeddings support
2026-01-23 18:28:25 -05:00
yuneng-jiang
22a268c544
Merge pull request #19673 from BerriAI/litellm_ui_router_fallbacks_02
[Feature] UI - Fallbacks: New Add Fallbacks Modal
2026-01-23 14:33:30 -08:00
yuneng-jiang
3ba9b13390 adding tests 2026-01-23 14:28:47 -08:00
yuneng-jiang
7e6fc6af2c New add fallbacks modal 2026-01-23 14:21:32 -08:00
Ishaan Jaffer
5b341ee842 fix linting 2026-01-23 13:46:02 -08:00
milan-berri
37b7dff194
add spend-queue-troubleshooting docs (#19659)
* add spend-queue-troubleshooting docs

* adjust spend-queue-troubleshooting docs
2026-01-23 13:44:41 -08:00
mubashir1osmani
c41963c949
fix: add openinference span kinds to arize phoenix
fix: add openinference span kinds to arize phoenix
2026-01-23 16:32:49 -05:00
Ishaan Jaffer
c945677ea8 BUMP pyproject 2026-01-23 13:28:06 -08:00
mubashir1osmani
0993dca4e2 fix lint 2026-01-23 16:27:32 -05:00
yogeshwaran10
e966240562 fix(ui): prevent clearing content filter patterns when editing guardrail
The generic provider params update logic loop was unintentionaly overwriting `patterns` and `blocked_words` with empty values because these fields are managed by a separate component ContentFilterManager and not available in the main form values.

Changes:
- Excluded `patterns` and `blocked_words` from the generic provider params update loop in guardrail_info.tsx
- Ensured these fields are only added to the update payload when explicitly handled by the ContentFilterManager logic (detecting changes via `useRef`).
- Added a regression test in guardrail_info.test.tsx to verify that patterns are preserved when only the guardrail name is updated.

Fixes #19639
2026-01-24 02:56:22 +05:30
mubashir1osmani
33a216d02a remove imports from functions 2026-01-23 16:18:21 -05:00
Ishaan Jaffer
b4dd0e4d19 fix schema.prisma 2026-01-23 13:17:52 -08:00
Ishaan Jaffer
c3b278e488 add migrtion 2026-01-23 13:17:06 -08:00
Ishaan Jaffer
9e02a38002 add schema.prisma 2026-01-23 13:16:58 -08:00
mubashir1osmani
744d15e068 remove imports from functions 2026-01-23 16:16:33 -05:00
Ishaan Jaffer
6621c7b2ef docs fix 2026-01-23 12:54:30 -08:00
Ishaan Jaff
fc19085230
[Feat] Guardrail Policy Management - Allow using UI to manage guardrail policies (#19668)
* init UI

* init schema.prisma

* fix: policy_crud_router

* UI fixes

* update gitignore

* working v0 for policy mgmt

* fix: endpoints to resolve guardrails

* fix code QA checks

* ui build issues

* schema fixes

* fix checks
2026-01-23 12:44:22 -08:00
yuneng-jiang
28bc83e394
Merge pull request #19662 from BerriAI/litellm_yj_ci_01
[Infra] CI/CD - Linting
2026-01-23 12:27:24 -08:00
yuneng-jiang
fbe5ae9e17 fixing flaky tests 2026-01-23 12:20:27 -08:00
yuneng-jiang
8b5b343841 attempt fix flaky tests 2026-01-23 12:10:08 -08:00
yuneng-jiang
5cacf56507 security scan 2026-01-23 11:55:56 -08:00