diff --git a/.github/workflows/test-unit-proxy-legacy.yml b/.github/workflows/test-unit-proxy-legacy.yml index d4f5c38a61..1263bcea6a 100644 --- a/.github/workflows/test-unit-proxy-legacy.yml +++ b/.github/workflows/test-unit-proxy-legacy.yml @@ -24,7 +24,7 @@ jobs: - name: "key-generation" path: "tests/proxy_unit_tests/test_[k-o]*.py" - name: "proxy-config" - path: "tests/proxy_unit_tests/test_prisma*.py tests/proxy_unit_tests/test_project*.py tests/proxy_unit_tests/test_prompt*.py tests/proxy_unit_tests/test_proxy_[c-r]*.py" + path: "tests/proxy_unit_tests/test_prisma*.py tests/proxy_unit_tests/test_prompt*.py tests/proxy_unit_tests/test_proxy_[c-r]*.py" - name: "proxy-server" path: "tests/proxy_unit_tests/test_proxy_server.py" - name: "proxy-server-extras" diff --git a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py index 5cf7c215cf..355161964d 100644 --- a/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py +++ b/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py @@ -180,8 +180,13 @@ _EXTRA_UI_SETTINGS_FIELDS: Dict[str, tuple] = {} _ENTERPRISE_ONLY_UI_SETTINGS: set[str] = {"enable_projects_ui"} -def register_extra_ui_setting(name: str, type_: Any, field: FieldInfo) -> None: - """Register an additional UI settings field contributed by an extension package.""" +def register_extra_ui_setting(name: str, type_: Any, field: Any) -> None: + """Register an additional UI settings field contributed by an extension package. + + ``field`` should be a pydantic ``Field(...)`` result (``FieldInfo`` at + runtime); typed as ``Any`` because pydantic's ``Field`` stub reports the + default value's type instead of ``FieldInfo``. + """ _EXTRA_UI_SETTINGS_FIELDS[name] = (type_, field) ALLOWED_UI_SETTINGS_FIELDS.add(name) @@ -190,7 +195,7 @@ def _get_effective_ui_settings_class() -> type: """Return UISettings with any extension-registered fields merged in.""" if not _EXTRA_UI_SETTINGS_FIELDS: return UISettings - return create_model( + return create_model( # type: ignore[call-overload] "EffectiveUISettings", __base__=UISettings, **_EXTRA_UI_SETTINGS_FIELDS, diff --git a/tests/enterprise/litellm_enterprise/proxy/management_endpoints/test_project_endpoints_prisma.py b/tests/enterprise/litellm_enterprise/proxy/management_endpoints/test_project_endpoints_prisma.py index 8d72885e76..6678acca87 100644 --- a/tests/enterprise/litellm_enterprise/proxy/management_endpoints/test_project_endpoints_prisma.py +++ b/tests/enterprise/litellm_enterprise/proxy/management_endpoints/test_project_endpoints_prisma.py @@ -432,7 +432,7 @@ def test_check_team_project_limits_models_not_in_team(): """ Test that creating a project with models not in the team raises an error. """ - from litellm.proxy.management_endpoints.project_endpoints import ( + from litellm_enterprise.proxy.management_endpoints.project_endpoints import ( _check_team_project_limits, ) from litellm.proxy._types import LiteLLM_TeamTable @@ -458,7 +458,7 @@ def test_check_team_project_limits_budget_exceeds_team(): """ Test that creating a project with budget > team budget raises an error. """ - from litellm.proxy.management_endpoints.project_endpoints import ( + from litellm_enterprise.proxy.management_endpoints.project_endpoints import ( _check_team_project_limits, ) from litellm.proxy._types import LiteLLM_TeamTable @@ -485,7 +485,7 @@ def test_check_team_project_limits_valid_subset(): """ Test that a valid project (models subset, budget within limit) passes. """ - from litellm.proxy.management_endpoints.project_endpoints import ( + from litellm_enterprise.proxy.management_endpoints.project_endpoints import ( _check_team_project_limits, ) from litellm.proxy._types import LiteLLM_TeamTable @@ -510,7 +510,7 @@ def test_check_team_project_limits_all_proxy_models(): """ Test that team with 'all-proxy-models' allows any project models. """ - from litellm.proxy.management_endpoints.project_endpoints import ( + from litellm_enterprise.proxy.management_endpoints.project_endpoints import ( _check_team_project_limits, ) from litellm.proxy._types import LiteLLM_TeamTable @@ -533,7 +533,7 @@ def test_check_team_project_limits_tpm_exceeds_team(): """ Test that project tpm_limit exceeding team tpm_limit raises an error. """ - from litellm.proxy.management_endpoints.project_endpoints import ( + from litellm_enterprise.proxy.management_endpoints.project_endpoints import ( _check_team_project_limits, ) from litellm.proxy._types import LiteLLM_TeamTable @@ -560,7 +560,7 @@ def test_check_team_project_limits_negative_budget(): """ Test that negative budget values raise an error. """ - from litellm.proxy.management_endpoints.project_endpoints import ( + from litellm_enterprise.proxy.management_endpoints.project_endpoints import ( _check_team_project_limits, ) from litellm.proxy._types import LiteLLM_TeamTable @@ -586,7 +586,7 @@ def test_check_team_project_limits_soft_budget_gte_max(): """ Test that soft_budget >= max_budget raises an error. """ - from litellm.proxy.management_endpoints.project_endpoints import ( + from litellm_enterprise.proxy.management_endpoints.project_endpoints import ( _check_team_project_limits, ) from litellm.proxy._types import LiteLLM_TeamTable @@ -801,7 +801,7 @@ async def test_list_projects_returns_timestamps(): from datetime import datetime, timezone from unittest.mock import AsyncMock, MagicMock, patch - from litellm.proxy.management_endpoints.project_endpoints import list_projects + from litellm_enterprise.proxy.management_endpoints.project_endpoints import list_projects from litellm.proxy._types import LiteLLM_ProjectTable now = datetime(2024, 1, 15, 12, 0, 0, tzinfo=timezone.utc) diff --git a/uv.lock b/uv.lock index 04224dc537..ca4f0f766d 100644 --- a/uv.lock +++ b/uv.lock @@ -11,7 +11,7 @@ resolution-markers = [ ] [options] -exclude-newer = "2026-04-08T16:01:27.663665Z" +exclude-newer = "2026-04-11T04:48:04.282864Z" exclude-newer-span = "P3D" [manifest] @@ -3602,7 +3602,7 @@ wheels = [ [[package]] name = "litellm" -version = "1.83.6" +version = "1.83.7" source = { editable = "." } dependencies = [ { name = "aiohttp" },