litellm/enterprise
mateo-berri 5695370776 fix(files): hand post-call hooks a page object, not a bare dict
The managed hook returned the plain dict build_list_page builds, while
every other GET /v1/files path returns an SDK page object. A post-call
success hook or a logging callback that reads response.data off the
listing raised AttributeError as soon as a request took the managed path

FileListPage is a pydantic model over the same five fields, so hooks read
.data again and the response body does not move: jsonable_encoder gives
the same keys in the same order for the model and for the dict. It sits
in litellm.types.llms.openai because base_llm/files/transformation.py
already imports from there and cannot import proxy modules. It is
deliberately not subscriptable, since the provider-backed path returns a
page object that is not either, and dict access would be a third contract
to keep alive

Also reject a purpose the Files API never accepts. An unknown purpose
matches no row, so the listing answered an empty page for what is really
a bad request, while the upload route in this same file already refuses
those values against get_args(OpenAIFilesPurpose). The check runs before
the first query, and only in the managed hook, so providers that define
their own purposes keep them

Also put back the route's original except tail. Sending every error
through handle_exception_on_proxy changed error.type on a bad
target_model_names from "None" to the exception class name, which a
caller matching on the body would read as a break. create_file in this
file already pairs base's tail with a ProxyException passthrough, so
list_files does the same and the handle_exception_on_proxy import is gone
2026-08-21 20:33:57 -07:00
..
cloudformation_stack (fix) litellm cloud formation stack 2024-03-07 18:06:59 -08:00
dist BUMP Enterprise PIP 2026-02-14 13:40:48 -08:00
enterprise_hooks fix(proxy): scan batch records with the content hooks that are not guardrails (#37786) 2026-08-21 11:20:23 -07:00
enterprise_ui Update README.md 2024-02-21 22:11:39 -08:00
litellm_enterprise fix(files): hand post-call hooks a page object, not a bare dict 2026-08-21 20:33:57 -07:00
__init__.py (fix) error cli users see when importing enterprise folder 2024-03-15 08:10:45 -07:00
LICENSE.md docs: document new github + gitlab ci scripts 2026-03-25 20:17:10 -07:00
pyproject.toml bump: litellm-enterprise 0.1.57 -> 0.1.58, litellm-proxy-extras 0.4.87 -> 0.4.88 (#37717) 2026-08-20 14:45:40 -07:00
README.md Fix enterprise doc link (#31815) 2026-07-09 11:48:11 -07:00

LiteLLM Enterprise

Code in this folder is licensed under a commercial license. Please review the LICENSE file within the /enterprise folder

These features are covered under the LiteLLM Enterprise contract

👉 Using in an Enterprise / Need specific features ? Meet with us here

See all Enterprise Features here 👉 Docs