litellm/tests/unit/router_rust
kenneth-berri 13101c8ae7
feat(router)!: let a deployment choose which cache controls a request may override (#54219)
* feat(router): let a deployment choose which cache controls a request may override

A deployment's litellm_params.cache and the request's cache are now merged one control at a time, and
allowed_cache_controls on the deployment names the controls a request may set. A request control outside
that list is ignored and named in the x-litellm-ignored-cache-controls response header.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(router): lock the s-max-age spelling and keep router default cache controls under a lock

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(router): lock use-cache, merge the s-max-age spelling as s-maxage, and apply the lock to sync text_completion

* fix(router): apply a deployment's cache controls on prompt-managed completions and report ignored ones on sync text_completion

* fix(router): report a prompt deployment's ignored cache controls when the rendered model is a group

* feat(router): a model's cache lock carries over to its fallbacks

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(router): a fallback keeps its own cache restrictions under the requested model's lock

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(router): combine a model's cache locks to the strictest, and match either s-maxage spelling in lists

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(router): keep a virtual key's cache controls and a locked fallback's stricter rule

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(router): read a virtual key's cache controls only from the request before fallback params

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(router): a key's cache control is exempt only at the key's exact value and type

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* refactor(router): rename the model's allowed_cache_controls to allowed_response_cache_overrides

* fix(router): a key's cache control passes a locked model only where it is at least as strict

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-24 14:33:59 -08:00
..
invoke feat(router)!: let a deployment choose which cache controls a request may override (#54219) 2026-11-24 14:33:59 -08:00
__init__.py
test_atomic_upsert.py
test_invoke_streaming.py fix(responses): bill the provider-reported input on a cut bridged stream (#53394) 2026-11-23 06:20:25 +00:00
test_routing_stores.py
test_surface_fallbacks.py feat(caching): configure semantic cache params per key, user and team (#53905) 2026-11-23 13:55:45 -08:00
test_walk.py