litellm/enterprise/litellm_enterprise/proxy
mateo-berri 9dabd72f2d refactor(repositories): type prisma table access with one generic protocol
Every repository handed its `.table` back untyped, so a dozen modules had
each grown a private `_PrismaTableActions` Protocol to paper over it. They
had drifted: some declared `update` as returning the row, others the row or
None, and none agreed on whether `find_many` was covariant

Replace all of them with a single `TableActions[RowT_co]` in
`litellm/repositories/prisma_protocols.py`, keyed to the prisma row each
repository is bound to. Query inputs stay `Mapping[str, object]` so callers
keep passing plain dicts, and `find_many` returns `Sequence` so the row type
stays covariant

Typing the nullable returns honestly surfaced paths that were already
crashing. A team admin could never edit or delete a memory entry owned by
their team: the write-auth check fed a raw prisma row to a helper that
expects the domain model, so `members_with_roles` arrived as plain dicts and
the request died as a 500 instead of applying the edit. Non-admin members hit
the same 500 in place of the 403 they were owed, so refusal and breakage were
indistinguishable. `/v2/model/info?user_models_only=true` dereferenced a
missing user row rather than returning the 400 the route already had, three
team routes dereferenced a team deleted between the read and the write, and
the agent registry dereferenced a missing agent instead of naming it

basedpyright drops 2,132 errors, 1,454 of them reportAny and 73
reportExplicitAny. The dashboard's generated types pick up `string[]` where
they had `unknown[]` for a team's members, admins and models
2026-08-25 12:14:17 +00:00
..
auth chore(auth): require trusted proxy for header identity auth 2026-04-29 21:20:21 -07:00
common_utils refactor(repositories): type prisma table access with one generic protocol 2026-08-25 12:14:17 +00:00
hooks fix(files): accept OpenAI's evals purpose on the files routes 2026-08-22 10:16:45 -07:00
management_endpoints chore(typing): drop 1.3k basedpyright errors across 30 Any hotspot files 2026-08-16 03:56:02 +00:00
ui_crud_endpoints [Refactor] Proxy: tighten UI settings extras registry 2026-04-13 21:58:02 -07:00
vector_stores chore(typing): drop 1.3k basedpyright errors across 42 Any hotspot files 2026-08-19 01:12:41 +00:00
__init__.py Normalize OpenAI SDK BaseModel choices/messages to avoid Pydantic serializer warnings (#18972) 2026-01-14 03:40:11 +05:30
audit_logging_endpoints.py fix(audit): AND semantics for combined JSON filters; remove unused allTeams prop 2026-03-03 14:24:55 -08:00
enterprise_routes.py [Refactor] Proxy: move projects management to enterprise package 2026-04-13 21:41:12 -07:00
proxy_server.py build(ui/): UI - Public Model Hub v2 (#12532) 2025-07-11 22:24:31 -07:00
readme.md Expose /list and /info endpoints for Audit Log events (#11102) 2025-05-23 22:54:59 -07:00
utils.py [Refactor] Move enterprise_routes within litellm_enterprise (#10860) 2025-05-15 10:34:26 -07:00

LiteLLM Proxy Enterprise Features - Readme

Overview

This directory contains enterprise features used on the LiteLLM proxy.

Format

Create a file for every group of endpoints (e.g. key_management_endpoints.py, user_management_endpoints.py, etc.)

If there is a broader semantic group of endpoints, create a folder for that group (e.g. management_endpoints, auth_endpoints, etc.)