Commit graph

33248 commits

Author SHA1 Message Date
Julio Quinteros Pro
65388d877e fix(policy_endpoints): explicitly re-export private helper functions from __init__.py
`import *` does not re-export names starting with `_`, so the private
competitor-enrichment helpers added in endpoints.py were invisible when
imported from the package:

  from litellm.proxy.management_endpoints.policy_endpoints import (
      _build_all_names_per_competitor, ...
  )

This caused an ImportError that prevented the entire test module from
collecting. Add explicit imports for each private helper so they are
accessible from the package namespace.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 11:09:57 -03:00
jquinter
8f5561cf48
Merge pull request #21666 from BerriAI/fix/test-max-effort-error-message
fix(tests): update test_max_effort_rejected_for_opus_45 regex to match current error message
2026-02-20 11:09:22 -03:00
Julio Quinteros Pro
963e0eabcb fix(tests): update test_max_effort_rejected_for_opus_45 regex to match new error message
The production error message was expanded when Sonnet 4.6 was also added as
a supported model for effort='max'. The test's match regex still referenced
the old "Claude Opus 4.6"-only message; update it to match the new
"Claude 4.6 models" wording.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 11:07:52 -03:00
Sameer Kankute
b62db9fcc9
Merge pull request #21663 from BerriAI/litellm_add_reasoning_support_config
[Feat] Add reasoning support via config
2026-02-20 18:17:09 +05:30
Sameer Kankute
164734fa45
Merge pull request #21662 from BerriAI/litellm_mcp_openapi_spec
[Fix]Add mcp via openapi spec
2026-02-20 18:16:30 +05:30
Sameer Kankute
9e0bd46c28
Merge pull request #21659 from BerriAI/litellm_fix_converse_disable_tool
Fix mapping of parallel_tool_calls for bedrock converse
2026-02-20 18:16:10 +05:30
Sameer Kankute
784ce97918
Merge pull request #21658 from BerriAI/litellm_fix_vertex_ai_messages
Fix: api_base is required. Unable to determine the correct api_base for the request
2026-02-20 18:15:30 +05:30
Sameer Kankute
bf024c0404
Merge pull request #21654 from BerriAI/litellm_new_gemini_pathc
Fix _map_reasoning_effort_to_thinking_level for all gemini 3 family
2026-02-20 18:14:47 +05:30
Sameer Kankute
5d8f2196d1 Add test case 2026-02-20 16:22:44 +05:30
Sameer Kankute
871c049f49 Add support for reasoning and tools viaconfig 2026-02-20 16:22:19 +05:30
Sameer Kankute
3cd9072539
Update ui/litellm-dashboard/tsconfig.json
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-02-20 14:08:38 +05:30
Sameer Kankute
f99ea619da Add search bar for enabling and calling tool 2026-02-20 13:57:58 +05:30
Sameer Kankute
ba74ee5a31 Add test for base url extraction and migration 2026-02-20 13:47:44 +05:30
Sameer Kankute
19b7b4019c Fix: server url extraction from spec_path 2026-02-20 13:46:59 +05:30
Sameer Kankute
b579f56ca3 Fix mapping of parallel_tool_calls for bedrock converse 2026-02-20 12:27:41 +05:30
Sameer Kankute
cdb4917185 Fix: api_base is required. Unable to determine the correct api_base for the request 2026-02-20 12:09:25 +05:30
yuneng-jiang
527f5c5d14
Merge pull request #21657 from BerriAI/litellm_knip_unused_files_cleanup
[Refactor] UI: Remove 38 unused files detected by knip
2026-02-19 22:22:21 -08:00
yuneng-jiang
eeab8705a1 [Refactor] UI: Remove 38 unused files detected by knip
Dead code cleanup — these files had no imports from any active entry points.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-19 22:07:41 -08:00
Sameer Kankute
5885c4a588 Fix _map_reasoning_effort_to_thinking_level for all gemini 3 family 2026-02-20 11:17:24 +05:30
yuneng-jiang
6bfab8acd4 address greptile review feedback (greploop iteration 2)
Reset logo_path to default_logo when custom UI_LOGO_PATH file doesn't
exist, so the else branch at the bottom of get_image serves the default
logo instead of the non-existent custom path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-19 20:25:00 -08:00
jquinter
37c98f8325
Merge pull request #21602 from BerriAI/fix/policy-endpoints-unused-import
fix(lint): remove redundant router import in policy_endpoints __init__
2026-02-20 01:16:18 -03:00
jquinter
d08c3a1d68
Merge pull request #21638 from BerriAI/fix/ai-policy-suggester-use-litellm-acompletion
fix(policy): use litellm.acompletion directly in AiPolicySuggester
2026-02-20 01:14:59 -03:00
jquinter
898774fecf
Merge pull request #21643 from BerriAI/fix/redis-cache-test-missing-host
fix(tests): pass host to RedisCache in test_team_update_redis
2026-02-20 01:11:04 -03:00
yuneng-jiang
145efe2267 address greptile review feedback (greploop iteration 1)
Add os.path.exists check before serving custom local logo so that a
non-existent UI_LOGO_PATH gracefully falls through to the cache/default
instead of causing a FileResponse error.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-19 20:09:42 -08:00
Sameer Kankute
fb75a7130f
Merge pull request #21630 from Chesars/fix/empty-system-message-anthropic
fix(anthropic): empty system messages in translate_system_message
2026-02-20 09:32:50 +05:30
Julio Quinteros Pro
bd8c1cc673 fix(tests): pass host to RedisCache in test_team_update_redis to avoid ValueError
RedisCache() without arguments fails at construction with
"ValueError: Either 'host' or 'url' must be specified for redis."
The actual Redis connection is irrelevant since async_set_cache is mocked.
Unlike test_get_team_redis which uses client_no_auth (which sets REDIS_HOST
via fake_env_vars), test_team_update_redis has no fixture setting that env var.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 01:00:58 -03:00
jquinter
6b681aafdd
Merge pull request #21641 from BerriAI/fix/jwt-tests-missing-premium-user-flag
fix(tests): set premium_user=True in JWT tests that call user_api_key_auth
2026-02-20 00:45:13 -03:00
Julio Quinteros Pro
cde51a53a7 fix(tests): set premium_user=True in JWT tests that call user_api_key_auth
JWT auth is an enterprise-only feature. Tests that call user_api_key_auth
with enable_jwt_auth=True must set premium_user=True on the proxy server
to bypass the enterprise gate, otherwise they fail with:

  ValueError: JWT Auth is an enterprise only feature.

This follows the same pattern as PR #21285 (fix/jwt-enterprise-license-test).

Fixed tests:
- test_team_token_output
- test_allowed_routes_admin
- test_allow_access_by_email
- test_end_user_jwt_auth

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 00:31:56 -03:00
jquinter
2b09c5d3bc
Merge pull request #21639 from BerriAI/fix/unused-imports-semantic-guard-and-policy-endpoints
fix(lint): remove unused imports in semantic_guard and policy_endpoints
2026-02-20 00:02:21 -03:00
Sameer Kankute
b405f64688
Merge pull request #21598 from jtsaw/fix/anthropic-sonnet-4-6-reasoning-effort
support reasoning and effort parameters on sonnet 4.6
2026-02-20 08:24:29 +05:30
Julio Quinteros Pro
dba60cac22 fix(lint): remove unused imports in semantic_guard and policy_endpoints
- Remove unused RouteChoice import from semantic_guard.py TYPE_CHECKING block
  (only referenced in docstring, never used as a type annotation)
- Remove redundant explicit router import from policy_endpoints/__init__.py
  (already re-exported by the preceding import * on the same line)

Fixes Ruff F401 errors caught in CI linting.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 23:46:02 -03:00
Julio Quinteros Pro
3381d6217f fix(policy): use litellm.acompletion directly in AiPolicySuggester
The suggest() method was calling llm_router.acompletion(), which requires
the proxy router to be initialised. This caused:
  ValueError: LLM router not initialized
in every test (and in any deployment without a configured router).

AiPolicySuggester is a self-contained feature that calls an LLM directly;
it has no need for proxy routing. Switch to litellm.acompletion, which is
always available and is what the tests already mock.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 23:35:35 -03:00
yuneng-jiang
a8026154ab [Fix] /get_image returns stale cached logo instead of custom UI_LOGO_PATH
The /get_image endpoint checked for cached_logo.jpg before reading the
UI_LOGO_PATH env var, so a pre-existing cache (e.g. baked into the base
Docker image) would always be served, ignoring the user's custom logo.

Move the UI_LOGO_PATH read before the cache check and serve local file
paths directly, bypassing the cache. The cache optimization is preserved
for HTTP URLs and the default logo where it is actually needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-19 18:32:48 -08:00
Ryan Crabbe
dc13378505 feat: add AI-powered duplicate PR detection via opencode
Same approach as the duplicate issue detector — uses opencode run
with gh pr commands to find potentially duplicate open PRs when
external contributors open new PRs. Skips core team and bots.
2026-02-19 17:51:44 -08:00
Darien Kindlund
0f2516e9cd
fix: handle explicit None model_info in LowestLatencyLoggingHandler (#21633)
When model_info is explicitly set to None in litellm_params (via
get_litellm_params.py), the pattern .get("model_info", {}) returns
None instead of {}, causing AttributeError on the chained .get("id").

This commonly occurs when Anthropic API returns usage limit errors,
the router falls back to Vertex AI, and the fallback succeeds — the
log_success_event callback fires with model_info=None.

Uses the (x or {}) pattern already established in router.py.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-02-19 17:30:58 -08:00
Ishaan Jaffer
d2bdf7d618 fix form 2026-02-19 17:17:20 -08:00
Ishaan Jaffer
be16f320ac fix filter 2026-02-19 17:17:11 -08:00
Ishaan Jaffer
2199b0783d ui refactor 2026-02-19 17:13:51 -08:00
Ishaan Jaffer
35120515cb QA: UI fix test page 2026-02-19 17:13:51 -08:00
yuneng-jiang
aa9f85545c
Merge pull request #21627 from BerriAI/litellm_service_key_vis
[Fix] Service Account Visibility for Team Members
2026-02-19 17:09:33 -08:00
yuneng-jiang
4475258426 address greptile review feedback (greploop iteration 1)
Refactor to fetch team objects once via _fetch_user_team_objects(),
then derive admin and member team IDs from the shared result. Eliminates
duplicate DB query between get_admin_team_ids and get_member_team_ids.
2026-02-19 16:53:48 -08:00
Chesars
56386969b5 fix(anthropic): remove empty system messages from message list
Empty system messages were skipped for Anthropic's system param but
not removed from the messages list, causing BadRequestError when
anthropic_messages_pt encountered the unsupported "system" role.

Fixes #21622
2026-02-19 21:46:17 -03:00
yuneng-jiang
c7fe400d4d [Fix] Service account visibility for team members
Regular team members could not see service accounts belonging to their
team. Additionally, former team members could still see service accounts
they created via the created_by filter after leaving the team.

- Add get_member_team_ids() to retrieve all teams a user belongs to
- Regular members now see team service accounts (user_id=NULL) but not
  other members' personal keys
- Scope created_by filter to the user's current team memberships
- Add 7 unit tests covering the new visibility rules
2026-02-19 16:29:43 -08:00
github-actions[bot]
2d39825868
chore: regenerate poetry.lock to match pyproject.toml (#21626)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-02-20 00:25:50 +00:00
jquinter
30a6b18c0d
Merge pull request #21625 from BerriAI/fix/regenerate-lock-drop-pat-approval
fix(ci): drop PAT_TOKEN_2 approval, use github.token for auto-merge
2026-02-19 21:20:02 -03:00
Julio Quinteros Pro
11d0fca0de fix(ci): drop PAT_TOKEN_2 approval step, use github.token for auto-merge
PAT_TOKEN_2 does not have the scope for addPullRequestReview.
github.token cannot approve its own PR either, so drop the approval
step entirely. Auto-merge with github.token is enough: the PR will
merge automatically once required CI checks pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 21:17:40 -03:00
jquinter
3a51d8bcb5
Merge pull request #21619 from BerriAI/fix/regenerate-lock-auto-approve
feat(ci): auto-approve and auto-merge the regenerated poetry.lock PR
2026-02-19 21:03:16 -03:00
Ishaan Jaffer
d4ae3c8370 ui new build 2026-02-19 15:57:19 -08:00
Ishaan Jaff
655973e8c8
feat(ui): show latency overhead for AI-suggested policy templates (#21620)
* feat(policy): add estimated_latency_ms to all policy templates

* feat(policy): add estimated_latency_ms to backup templates

* feat(ui): show latency overhead badge in AI policy suggestions
2026-02-19 15:45:07 -08:00
Julio Quinteros Pro
41776b0382 feat(ci): auto-approve and auto-merge the regenerated poetry.lock PR
Now that "Allow GitHub Actions to create and approve pull requests" is
enabled in repo settings:
- PR creation uses github.token (no secret needed)
- Approval uses PAT_TOKEN_2 (GitHub requires a different identity from
  the PR creator to approve)
- Auto-merge is enabled with --squash so the PR merges as soon as
  required checks pass

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-19 20:23:07 -03:00