litellm/tests/unit/test_router
ellisc42 6f46f8bd42
fix(managed files): keep one downstream copy per litellm_proxy deployment that covers every target it serves (#54181)
* fix(managed files): keep one downstream copy per litellm_proxy deployment that covers every target it serves

* fix(managed files): skip targets an earlier litellm_proxy upload already covers

* fix(managed_files): keep the downstream copy that serves the most targets and send batch uploads one target

A litellm_proxy upload whose target lookup failed left that target out, and
the hook then deleted the later copy that served it. Each deployment now keeps
the copy that serves the most targets, and the copy the managed id carries is
removed with the file. A purpose=batch upload sends each downstream upload only
its own target again, since the downstream refuses a multi-target batch file for
a model it runs itself.

* fix(router): judge other upload targets by their own routing after an order fallback

* fix(router): name every target a fallback upload serves downstream and keep the latest tied proxy copy

* fix(managed files): count a target covered only when its copy lists it, and drop repeat proxy copies at once

A target now counts as covered only when every litellm_proxy copy on its chat route names it, so a routing lookup that fails at the reached order no longer skips that target's upload

A later litellm_proxy copy that lists no target an earlier copy on the same deployment misses is a repeat, so the hook deletes it right away instead of keeping both until the file is deleted. After an order fallback this leaves one copy per provider downstream

---------

Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
2026-11-25 06:07:13 +00:00
..
core fix(managed files): keep one downstream copy per litellm_proxy deployment that covers every target it serves (#54181) 2026-11-25 06:07:13 +00:00
__init__.py
test_enforce_model_rate_limits.py fix(router): count streamed responses against deployment TPM (#54283) 2026-11-24 18:06:07 -08:00
test_io_token_rate_limits.py fix(router): count a Responses WebSocket turn's input against deployment ITPM (#53594) 2026-11-24 04:26:36 -08:00
test_router.py fix(router): count pre-call context-window tokens with each deployment's tokenizer (#49764) 2026-11-25 03:04:19 +00:00
test_router_callback_hook_sequence.py test: replace 61 live logging and otel tests with offline unit and integration coverage (#45362) 2026-10-08 15:55:57 -07:00
test_router_endpoints.py fix(proxy): resolve admin oidc api_key references on batch cancel, fine-tuning listing, OCR, /v1/messages and cache prediction (#53678) 2026-11-23 10:11:10 -08:00
test_router_entry_points.py feat(proxy): mixed Codex model picker and LiteLLM routing on native codex routes (#49408) 2026-11-06 11:14:47 -08:00
test_router_facade.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_router_fallbacks.py fix(router): preserve destination bearer credentials on Anthropic fallbacks (#54271) 2026-11-24 17:12:02 -08:00
test_router_fuzz_regressions_rust_only.py ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00
test_router_get_deployments.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_router_helper_utils.py fix(router): count a Responses WebSocket turn's input against deployment ITPM (#53594) 2026-11-24 04:26:36 -08:00
test_router_host.py ci(unit): cut unit check time with cheaper per-test resets and fewer non-unit tests (#51864) 2026-11-14 15:41:30 -08:00
test_router_max_parallel_requests.py feat(tts)!: stream audio from the provider as it arrives on /v1/audio/speech (#46222) 2026-11-17 15:03:12 +00:00
test_router_provider_endpoints.py feat(redis): serve the proxy's common Redis call with Rust stores (#50170) 2026-11-06 06:01:11 +00:00
test_router_retries.py refactor(router): delete the python router core, the rust core is the only core (#50178) 2026-11-05 10:40:46 -08:00
test_router_surface_check.py chore: move workspace packages under litellm (#51000) 2026-11-12 04:19:57 +00:00
test_router_timeout.py feat(messages): serve bedrock invoke messages on rust only (#51330) 2026-11-15 16:58:31 -08:00
test_router_vector_store_endpoints.py test: migrate SDK and proxy-booting legacy CircleCI tests to their tiers (#45758) 2026-10-11 00:17:21 -07:00