mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
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 |
||
|---|---|---|
| .. | ||
| auth | ||
| common_utils | ||
| hooks | ||
| management_endpoints | ||
| ui_crud_endpoints | ||
| vector_stores | ||
| __init__.py | ||
| audit_logging_endpoints.py | ||
| enterprise_routes.py | ||
| proxy_server.py | ||
| readme.md | ||
| utils.py | ||
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.)