Commit graph

2 commits

Author SHA1 Message Date
Yuneng Jiang
937d81331f
[Refactor] Proxy: tighten UI settings extras registry
- drop unused Any annotation on register_extra_ui_setting's field
  param; type it as FieldInfo and have enterprise callers construct
  FieldInfo directly (pydantic.Field's stub reports the default's
  type, which doesn't match FieldInfo)
- cache the effective UISettings class and invalidate it inside
  register_extra_ui_setting so GET /get/ui_settings does not rebuild
  a pydantic model on every request
- annotate _EXTRA_UI_SETTINGS_FIELDS with a concrete
  Dict[str, Tuple[Any, FieldInfo]] instead of bare Dict[str, tuple];
  the annotation remains Any because pydantic field annotations
  include generics (Optional[X], List[X]) that are not instances of
  type
2026-04-13 21:58:02 -07:00
Yuneng Jiang
d3a1f63af2
[Refactor] Proxy: move projects management to enterprise package
Remove the /project/* management endpoints and the enable_projects_ui
admin-settings flag from the OSS litellm package. Project endpoints now
live under litellm_enterprise and are wired through the existing
enterprise router; OSS builds return 404 for every /project/* route.

The enable_projects_ui UI flag is registered back onto UISettings via a
small extension registry when the enterprise package is imported, so the
admin toggle and downstream key/sidebar gating continue to work in
enterprise builds. On OSS, explicit PATCH attempts with the flag return
403 with a clear enterprise-only message instead of being silently
dropped.

Pydantic request/response types (NewProjectRequest, UpdateProjectRequest,
DeleteProjectRequest, NewProjectResponse) stay in litellm/proxy/_types.py
because management_endpoints/common_utils.py and pydantic-shape tests
import them. LiteLLM_ProjectTable and all FK columns in schema.prisma
are unchanged.
2026-04-13 21:41:12 -07:00