Commit graph

4151 commits

Author SHA1 Message Date
hamzaq453
4573ab326b refactor: remove to_safe_identifier mapping from OpenAPI MCP generator 2025-12-30 14:04:15 +05:00
yuneng-jiang
ff4e16b306
Merge pull request #18502 from BerriAI/litellm_key_list_user_object
[Feature] Add Optional Query Param "expand" to /key/list
2025-12-29 15:02:38 -08:00
YutaSaito
b9e8b38cd3
Merge branch 'main' into fix/mcp-rest-auth-ssrf 2025-12-30 07:22:01 +09:00
yuneng-jiang
de551889f3 Add optional field expand to /key/list 2025-12-29 14:20:04 -08:00
hamzaq453
b33f1ec2b2 Fix: Remove exec() usage and handle invalid OpenAPI parameter names
- Add to_safe_identifier() to convert any parameter name to valid Python identifier
- Refactor create_tool_function() to use closure with **kwargs instead of exec()
- Handle edge cases: hyphens, dots, leading digits, Python keywords, special chars
- Add comprehensive test suite covering all edge cases
- Fixes #18471: OpenAPI MCP server crashes on invalid parameter names
- Security: Eliminates arbitrary code execution risk from untrusted OpenAPI specs
2025-12-28 19:28:11 +05:00
Yuta Saito
c25ceb5596 refactor: MCP health check 2025-12-26 16:55:51 +09:00
Andrew Bernat
6daddbcdab
add license endpoint (#18311)
* Add license health endpoint

* Address review feedback for license endpoint

* Refactor license health endpoint helpers

* Remove unused timezone import from health_endpoints.py

---------

Co-authored-by: Plan42.ai <robot@plan42.ai>
2025-12-25 11:11:17 +05:30
Ishaan Jaff
1123cfa928
[Feat] AI Gateway - Add support for Platform Fee / Margins (#18427)
* init cost_margin_config

* feat: add cost margin

* init types

* LITELLM_SETTINGS_SAFE_DB_OVERRIDES

* feat _apply_cost_margin

* ui endpoint

* ui provider margins

* add margin

* refactored ui

* test cost margins

* refactored ui

* provider discounts

* add cost_breakdown to spendLogs

* add CostBreakdownViewer

* fix cost breakdown

* docs fix

* doc margins

* docs margins
2025-12-25 11:07:27 +05:30
yuneng-jiang
5a20edf0fa Allow org admins to view org info 2025-12-24 11:43:36 -08:00
Sameer Kankute
4c4c9cb353 Add generate content in llm route 2025-12-24 12:16:24 +05:30
yuneng-jiang
564b2b51cc Fix for dev env 2025-12-23 16:09:17 -08:00
yuneng-jiang
05dd247ff5 Fix UI disappearing for development instances 2025-12-23 15:24:07 -08:00
yuneng-jiang
b86147c84c
Merge pull request #18397 from BerriAI/litellm_disable_admin_flag
[Fix] Disable Admin UI Flag
2025-12-23 15:20:24 -08:00
yuneng-jiang
6bb5254c9b
Revert "[Fix] UI - Disappears in Development Environments" 2025-12-23 15:08:07 -08:00
yuneng-jiang
d9bcc33ba7 Fixing tests 2025-12-23 14:10:41 -08:00
yuneng-jiang
87337abfea Support Disable Admin UI 2025-12-23 13:52:05 -08:00
YutaSaito
55bfb24ef8
Merge pull request #18324 from BerriAI/litellm_feat_dynamic_env_propagation_for_stdio_MCP_server
feat: support MCP stdio header env overrides
2025-12-24 06:29:53 +09:00
yuneng-jiang
97230e5179
Merge pull request #18393 from BerriAI/litellm_ui_fix_2
[Fix] UI - Disappears in Development Environments
2025-12-23 13:24:59 -08:00
yuneng-jiang
fccd2d1e87 Fix UI disappearing for development instances 2025-12-23 11:46:55 -08:00
yuneng-jiang
ed4a4c13d6 Base commit 2025-12-23 11:46:35 -08:00
yuneng-jiang
fc80a92971 Add Error code filter on UI 2025-12-22 20:15:01 -08:00
yuneng-jiang
9a81be690e
Merge pull request #18359 from BerriAI/litellm_logs_add_filtering
[Feature] Allow Error code filtering on Spend Logs
2025-12-22 18:21:36 -08:00
yuneng-jiang
a510654736 Allow Error code filtering on spend logs endpoint 2025-12-22 17:46:25 -08:00
Alexsander Hamir
5534038e93
Fix CI: Revert security scan changes and add GitGuardian ignore rules (#18358) 2025-12-22 17:03:53 -08:00
yuneng-jiang
81dc70673a Merge remote-tracking branch 'origin' into litellm_ui_unset_values 2025-12-22 11:44:41 -08:00
yuneng-jiang
a27db9f52d
Merge pull request #18090 from BerriAI/litellm_sso_role_mapping
[Feature] SSO Role Mapping
2025-12-22 11:30:49 -08:00
Alexsander Hamir
30fa90f70d
[Feat] Enable async_post_call_failure_hook to transform error responses (#18348) 2025-12-22 11:24:30 -08:00
yuneng-jiang
13adaa4a73 Merge remote-tracking branch 'origin' into litellm_sso_role_mapping 2025-12-22 09:44:04 -08:00
yuneng-jiang
31cc9654ce Merge remote-tracking branch 'origin' into litellm_ui_cloudzero_improvements 2025-12-22 09:43:23 -08:00
Ishaan Jaff
268ed11a01
Litellm content filter logs page (#18335)
* add view for litellm content filter

* add ContentFilterDetails

* test_apply_guardrail_logs_guardrail_information

* backend track litellm content filter

* ui view

* fix code qa check
2025-12-22 18:20:26 +05:30
Yuta Saito
34b500c7f5 feat: support MCP stdio header env overrides 2025-12-22 12:58:31 +09:00
Emerson Gomes
acce6b9c83
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-20 15:56:46 -06:00
Emerson Gomes
9002f75277 Require auth for MCP connection test 2025-12-20 11:01:41 -06:00
Ishaan Jaffer
6112160a16 Revert "[Fix] Security - Remove example API keys with high entropy (#18255)"
This reverts commit 24edbccf5c.
2025-12-20 20:48:11 +05:30
Eric84626
0306f02e74 fix: removed initialize the tool name to MCP server name mapping(oauth2) on startup for avoiding 401 error 2025-12-20 14:13:18 +08:00
Eric84626
684fba42ea fix: added RFC RECOMMENDED property(scopes_supported) to protected resource and authorization server metadata 2025-12-20 13:22:29 +08:00
Eric84626
3a2ab6b0d1 fix: added additional grant type into oauth_authorization_server response for fixing mcp auth register bad request issue 2025-12-20 11:55:12 +08:00
yuneng-jiang
ffcac2eebc Allow deleting key expiry 2025-12-19 18:04:04 -08:00
yuneng-jiang
74842de78e Adding backend 2025-12-19 13:04:59 -08:00
yuneng-jiang
026c2ad693
Merge pull request #18167 from BerriAI/litellm_vector_store_config
[Feature] Auto Resolve Vector Store Embedding Model Config
2025-12-19 11:39:17 -08:00
yuneng-jiang
b1b488982d
Merge pull request #18168 from BerriAI/litellm_cloudzero_delete
[Feature] Delete Cloudzero Settings Route
2025-12-19 11:38:10 -08:00
yuneng-jiang
2a4f883e78 Merge remote-tracking branch 'origin' into litellm_deleted_keys_team 2025-12-19 11:36:27 -08:00
yuneng-jiang
02355f602c Merge remote-tracking branch 'origin' into litellm_sso_role_mapping 2025-12-19 11:03:30 -08:00
yuneng-jiang
313a613a13 Adding tests 2025-12-19 10:56:11 -08:00
Alexsander Hamir
24edbccf5c
[Fix] Security - Remove example API keys with high entropy (#18255) 2025-12-19 10:09:50 -08:00
yuneng-jiang
19140506a9 Adding tests 2025-12-18 20:50:38 -08:00
yuneng-jiang
41732696c6 replicate delete checks for regenerate 2025-12-18 13:25:11 -08:00
yuneng-jiang
0a1fb204cd Tests for /key/delete 2025-12-18 11:40:41 -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
Alexsander Hamir
28821427ce
[Fix] CI/CD #1 - mypy | check_code_and_doc_quality | guardrails_testing (#18195) 2025-12-18 06:31:01 -08:00