Commit graph

30214 commits

Author SHA1 Message Date
yuneng-jiang
bfb38a21eb
Merge pull request #18203 from BerriAI/litellm_ui_usage_permission
[Fix] UI - Usage Page Top Key View Button Visibility
2025-12-18 11:07:16 -08:00
Alexsander Hamir
2e7b554747
3[Fix] CI/CD - logging_testing (#18204)
* fix: enforce team member budget check in common_checks

- Add missing team member budget validation in common_checks() function
  - Checks team membership budget when team key is used
  - Raises BudgetExceededError when team member spend exceeds max_budget_in_team
  - Follows same pattern as other budget checks (team, user, end_user)
  - Uses cached get_team_membership() for performance

- Fix AttributeError in lowest_tpm_rpm.py
  - Add null check for model_info before accessing .get() method
  - Prevents 'NoneType' object has no attribute 'get' error

- Add unit tests for team member budget enforcement
  - Test budget exceeded scenario
  - Test within budget scenario
  - Test edge cases (no budget, no membership, personal keys)
  - Tests run without requiring proxy server

Fixes failing test: test_users_in_team_budget

* fix: mock get_async_httpx_client in test_langsmith_key_based_logging

- Mock get_async_httpx_client to return a mock AsyncHTTPHandler instance
- Fixes test failure where mock_post was never called
- LangsmithLogger creates its own httpx client instance via get_async_httpx_client,
  so we need to mock the factory function rather than the class method
- Use MagicMock for response.raise_for_status (sync method) instead of AsyncMock

* fix: resolve linting errors (PLR0915, F401)

- Remove unused imports (datetime, ServiceLoggerPayload) from arize_phoenix.py
- Extract health ping setup logic from RedisCache.__init__ to reduce statement count
- Extract team member budget check from common_checks to reduce statement count

* fix: resolve type errors in ChatCompletionToolCallChunk construction

- Cast type field to Literal['function'] to satisfy TypedDict requirements
- Ensure arguments field is explicitly str type to match TypedDict signature
- Fixes pyright errors for incompatible types in transformation.py
2025-12-18 10:52:24 -08:00
yuneng-jiang
3bc5de125a Usage top key view conditional rendering 2025-12-18 10:43:40 -08:00
Ishaan Jaff
5ea0854eda
[Feat] Guardrails Load Balancing - Allow Platform admins to load balance between guardrails (#18181)
* add _aguardrail_helper for LB

* add _aguardrail_helper on router.py

* test_proxy_logging_pre_call_hook_load_balancing

* add _execute_guardrail_with_load_balancing

* add LB TEsting

* docs guard lb

* fix linting

* fix lint
2025-12-19 00:08:03 +05:30
mubashir1osmani
fcd524ca0f
Merge pull request #18102 from mubashir1osmani/fix_arize_traces 2025-12-18 11:51:01 -05:00
Alexsander Hamir
f353bb6dba
[Fix] CI/CD - litellm_mapped_tests_llms | litellm_mapped_tests_core | caching_unit_tests (#18197) 2025-12-18 08:49:23 -08:00
Sameer Kankute
8f573518ac Fix mypy error 2025-12-18 20:06:04 +05:30
Sameer Kankute
6571b6e73a Fix mypy error 2025-12-18 20:04:34 +05:30
Alexsander Hamir
28821427ce
[Fix] CI/CD #1 - mypy | check_code_and_doc_quality | guardrails_testing (#18195) 2025-12-18 06:31:01 -08:00
Steve G
c94f61b1da
Feature/lakera monitor mode (#18084)
* Add monitor mode support to Lakera guardrail

- Add on_flagged parameter to LakeraV2GuardrailConfigModel (default: 'block')
- Support 'monitor' mode that logs violations without blocking requests
- Support 'block' mode (default) that raises HTTPException on violations
- Update async_pre_call_hook and async_moderation_hook to check on_flagged
- Update guardrail initializer to pass on_flagged from config
- Add documentation with monitor mode examples

This allows users to tune Lakera security policies by monitoring violations
without blocking legitimate requests, similar to Pillar's on_flagged_action.

* Add tests for Lakera guardrail monitor mode

- Test monitor mode allows flagged content through (pre_call hook)
- Test block mode raises HTTPException for violations (pre_call hook)
- Test monitor mode works with during_call (moderation_hook)

These tests verify the on_flagged parameter functionality for both
monitor and block modes across different guardrail hooks.

---------

Co-authored-by: Steve <steve.giguere@lakera.ai>
2025-12-18 19:57:43 +05:30
Sameer Kankute
dafd123756 Fix : tool calling with response api bridge 2025-12-18 19:54:15 +05:30
Rens
5705aaebbc Fix Gemini 3 imgs in tool response 2025-12-18 15:19:16 +02:00
Krish Dholakia
365762596b
Guardrails - LiteLLM Content Filter - add support for running content filters on images (#18044)
* feat(litellm_content_filter.py): add support for content filtering categories

make it easy for proxy admin to prevent messages about violence, self harm or illegal weapons going through litellm

* feat: initial commit adding bias detection

allows admin to block inappropriate content about sexual orientation, etc.

* refactor: simplify content_filter.py

use a more exhaustive set of keywords, instead of guessing at potential phrases user can use

* feat(content_filter.py): add new denied topics for in-built content filter guardrails

allow user to automatically block content relating to certain categories from being sent to the LLML

* refactor(content-filter): document new params to litellm content filter

* feat(ui/): litellm content filter - select content categories on ui

* docs: update documentation

* docs(litellm_content_filter.md): document new content filters

* feat: initial commit adding support for inappropriate images via litellm content filter

* feat(content_filter.py): support blocking images containing blocked content

prevent images which contain disallowed content from being sent to the llm api

* docs(litellm_content_filter.md): document new image capabilities of litellm_content_filter

* fix: fix expected error code
2025-12-18 16:46:14 +05:30
Krish Dholakia
26cd2c4473
Guardrails - add built in guardrails for harmful content, bias, etc. (#18029)
* feat(litellm_content_filter.py): add support for content filtering categories

make it easy for proxy admin to prevent messages about violence, self harm or illegal weapons going through litellm

* feat: initial commit adding bias detection

allows admin to block inappropriate content about sexual orientation, etc.

* refactor: simplify content_filter.py

use a more exhaustive set of keywords, instead of guessing at potential phrases user can use

* feat(content_filter.py): add new denied topics for in-built content filter guardrails

allow user to automatically block content relating to certain categories from being sent to the LLML

* refactor(content-filter): document new params to litellm content filter

* feat(ui/): litellm content filter - select content categories on ui

* docs: update documentation

* docs(litellm_content_filter.md): document new content filters
2025-12-18 16:28:58 +05:30
Sameer Kankute
d764b7405d Add thinking to reasoning_effort mapping in v1/messages 2025-12-18 15:29:54 +05:30
YutaSaito
630f3d828e
Merge pull request #18161 from BerriAI/litellm_fix_mcp_list_tool_not_working_without_db
Litellm fix mcp list tool not working without db
2025-12-18 18:27:19 +09:00
Leon
1c401ecf71
Add reasoning support for vertex_ai/gemini-3-flash-preview in model prices and context window (#18175) 2025-12-18 14:53:36 +05:30
Sameer Kankute
f4f5ea85df Add redisvl in requirements.txt 2025-12-18 14:42:41 +05:30
Ishaan Jaff
274d996a87
[Feat] New Search API Provider - LinkUp Search (#18174)
* add linkup search provider

* add Linkup Search docs

* add get_provider_search_config

* get_provider_search_config

* add linkup/search provider

* fix mypy linting
2025-12-18 14:27:36 +05:30
Cesar Garcia
d131b7138d
feat(pricing): add output_cost_per_image_token for gemini-2.5-flash-image models (#18156)
Add output_cost_per_image_token ($30/1M = 3e-05) to enable correct
image output cost calculation for gemini-2.5-flash-image models.

Affected models:
- gemini-2.5-flash-image
- gemini-2.5-flash-image-preview
- gemini/gemini-2.5-flash-image
- gemini/gemini-2.5-flash-image-preview
- vertex_ai/gemini-2.5-flash-image
2025-12-18 14:08:45 +05:30
Ishaan Jaff
17403967ab
[Bug fix] Vertex Multimodal embeddings - Support text + base64 image combinations (#18172)
* TestVertexMultimodalEmbedding

* fix _try_merge_text_with_media

* ruff fix
2025-12-18 13:22:43 +05:30
yuneng-jiang
0a4a7408c7 UI Cloudzero delete route 2025-12-17 22:32:39 -08:00
yuneng-jiang
b0d371d864 delete route for cloudzero 2025-12-17 22:12:31 -08:00
yuneng-jiang
c071bfbe58 base commit 2025-12-17 22:05:47 -08:00
yuneng-jiang
8ea7688d35 Adding tests 2025-12-17 21:59:28 -08:00
yuneng-jiang
98c9037ab8 resolve embeddings model config 2025-12-17 21:56:47 -08:00
yuneng-jiang
8ae7d5ce32 base commit 2025-12-17 21:52:51 -08:00
yuneng-jiang
984cbd4529
Merge pull request #18163 from BerriAI/litellm_ui_cloudzero
[Feature] UI - Cloud Zero Cost Tracking
2025-12-17 20:24:53 -08:00
Lucas Sugi
9f88d61d10
fix: Change extra_headers to additional_headers (#17950) 2025-12-18 08:57:20 +05:30
yuneng-jiang
7b2f33b9b4
Merge pull request #17559 from BerriAI/litellm_new_user_collision_handling
[Fix] New user route user_id collision handling
2025-12-17 19:19:41 -08:00
yuneng-jiang
1db7492639
Merge pull request #18159 from BerriAI/litellm_login_500_fix
[Fix] Login Page Failed To Parse JSON Error
2025-12-17 19:19:27 -08:00
Sameer Kankute
002532a34f
Merge pull request #18164 from BerriAI/litellm_vertex_gemini_3_model_map
Add vertex ai gemini 3 flash in model map
2025-12-18 08:48:55 +05:30
Sameer Kankute
39e16b38c8 Add vertex ai gemini 3 flash in model map 2025-12-18 08:47:02 +05:30
yuneng-jiang
866d1eded5
Merge pull request #17995 from BerriAI/litellm_email_budget_alerts_2
[Feature] Email Budget Alerts
2025-12-17 19:16:17 -08:00
yuneng-jiang
37a542293c Fixing Build 2025-12-17 19:07:29 -08:00
yuneng-jiang
05fb750d7c UI Cloud Zero Integration 2025-12-17 19:03:39 -08:00
Yuta Saito
80f0a84741 doc: custom_auth object_permission usage for MCP access 2025-12-18 10:25:05 +09:00
Yuta Saito
847bbd4fda fix: prefer _get_key_object_permission for key lookups and remove redundant checks 2025-12-18 09:50:56 +09:00
yuneng-jiang
dd182a2ed0 Adding tests 2025-12-17 16:28:15 -08:00
yuneng-jiang
b03e73e53b Add error handling to /v2/login 2025-12-17 16:28:06 -08:00
yuneng-jiang
dcb3a473e6 base commit 2025-12-17 16:27:46 -08:00
yuneng-jiang
f4017a1986 Tests 2025-12-17 16:07:01 -08:00
yuneng-jiang
d7514c0976 Max budget alerts working 2025-12-17 16:01:59 -08:00
yuneng-jiang
19da000bea revert proxy_config 2025-12-17 15:09:19 -08:00
yuneng-jiang
d6f8e79f0d bump: version 0.1.26 → 0.1.27 2025-12-17 15:07:16 -08:00
yuneng-jiang
c1e3364c4f Adding files 2025-12-17 15:05:01 -08:00
yuneng-jiang
dad2a29b2b Max budget alerts 2025-12-17 15:04:20 -08:00
YutaSaito
6595619906
Merge pull request #18150 from BerriAI/litellm_feat_vault-per-team-config
Litellm feat vault per team config
2025-12-18 06:57:24 +09:00
YutaSaito
c694d96da0
Merge pull request #18149 from BerriAI/litellm_feat_add_secret_manager_settings
feat: add secret manager settings controls to team management UI
2025-12-18 06:57:12 +09:00
Yuta Saito
1a21965998 fix: ui test 2025-12-18 06:32:50 +09:00