mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-25 22:20:43 +00:00
* fix(proxy): retrieve and delete a managed file when the request also names a model
GET and DELETE /v1/files/{id} sent a proxy-managed file id to the provider unchanged whenever the x-litellm-model header or ?model= named a model, so the provider answered 404 and DELETE left the file in place. A managed file id now skips model-based routing and resolves to each deployment's provider file id, as the content route already did.
* fix(proxy): keep forwarding a managed file id by the model hint on a proxy without a database
A proxy with no database loads no managed files hook, so it cannot resolve a
managed file id itself and must keep sending it to the named model, which may be
another LiteLLM proxy that owns the file. Skip model routing for a managed id only
when the managed files hook is loaded.
The tests now run the real managed files hook over a stored row with only the
OpenAI file routes faked, and cover the no-database proxy.
* test(proxy): type the managed file table helper's delete filter
* test(proxy): keep a raw provider file id routed by the model hint when managed files are on
A proxy with a database loads the managed files hook, which now skips model routing for its own file ids. This test makes sure a raw provider file id sent with a model hint on that proxy still goes to the hinted deployment with its credentials, so the skip cannot widen to every id unnoticed
* test(proxy): cover a model hint that names a model the managed file is not on
A hint naming another deployment must still resolve the managed id through the managed files hook, so these cases fail if routing is skipped only when the hint matches the file's own model
---------
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_batch_guardrails.py | ||
| test_file_usage_caps.py | ||
| test_files_batch_file_validation.py | ||
| test_files_common_utils.py | ||
| test_files_endpoint.py | ||
| test_general_upload_validation.py | ||
| test_storage_backend_service.py | ||