litellm/tests/unit/router_utils
Mateo Wang 18831b818c
fix: keep model capability flags out of provider requests (#46647)
* fix: keep model capability flags out of provider requests

A supports_* flag or another model map field set on a deployment's litellm_params was forwarded
to the provider as a request field, so Bedrock answered 400 Extra inputs are not permitted on
chat traffic and on the background health check alike. The shared owned-kwarg predicate now
treats every ProviderSpecificModelInfo field as litellm-owned.

Builds on the health-check-only approach in #40952 by leilei3167.

* fix: treat every supports_ model map flag as a capability field and warn when one sits in litellm_params

* fix(router): skip declared litellm params in the capability flag warning and warn for runtime-added deployments

* fix(router): strip model capability flags from the router's deployments instead of every request

* fix(router): keep capability flags out of health probes and read them from the loaded catalog

* perf(router): read the catalog's supports_ field set once per cost map load

Cache the loaded catalog's field names when the cost map snapshot is taken so the capability-flag check stops walking every catalog entry per deployment, and add integration cells that drive the flagged and control deployments through chat, streaming, messages, responses, embeddings, health and model management against a vendor that rejects the flags
2026-10-15 14:30:10 +00:00
..
pre_call_checks fix(router): keep the prompt caching affinity pin alive as long as the prefix's cache_control ttl (#46084) 2026-10-14 21:10:09 -07:00
__init__.py test: add __init__.py to intermediate tests/unit packages 2026-09-20 12:55:27 +00:00
test_access_windows.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_add_retry_fallback_headers.py refactor: expose public hidden_params accessors (#44668) 2026-10-07 00:01:33 -07:00
test_auto_router_model_naming.py feat(ui): streamline auto-router setup with deployed decision models (#45913) 2026-10-10 20:49:59 -07:00
test_auto_router_tuning_baseline.py fix(auto-router): separate tuning and select chained heuristic (#44928) 2026-10-06 13:43:53 -07:00
test_baseline_request.py fix(router): preserve native baseline identity and accounting (#44960) 2026-10-07 11:00:31 -07:00
test_batch_utils.py fix(vertex_ai): return 400 with file line number for malformed batch JSONL row (#40097) 2026-10-15 03:21:48 -07:00
test_client_initalization_utils.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_cooldown_cache.py refactor: expose core private helpers under public names (#44871) 2026-10-07 00:05:27 +00:00
test_cooldown_handlers.py test: move routing, caching and callback tests out of local_testing (#45761) 2026-10-10 09:33:09 -07:00
test_fallback_event_handlers.py fix(router): report fallbacks skipped for access or budget instead of calling them failed (#46291) 2026-10-14 15:08:47 -07:00
test_get_retry_from_policy.py fix(exceptions): map upstream 402 to PaymentRequiredError and cool down 402 deployments (#44879) 2026-10-06 20:35:13 -07:00
test_handle_error.py test: move whole-unit legacy test files into tests/unit and delete dead skips (#44807) 2026-10-07 05:02:28 +00:00
test_health_check_allowed_fails_integration.py refactor: expose core private helpers under public names (#44871) 2026-10-07 00:05:27 +00:00
test_health_state_cache.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_pattern_match_deployments.py feat(dashscope): add Wan 3.0, Wan 2.7 and HappyHorse video generation via /v1/videos (#43706) 2026-10-14 10:10:07 -07:00
test_prompt_caching_cache.py fix(router): keep the prompt caching affinity pin alive as long as the prefix's cache_control ttl (#46084) 2026-10-14 21:10:09 -07:00
test_reasoning_effort_capability.py refactor(llms): expose public names for private provider helpers (#45037) 2026-10-07 08:49:25 -07:00
test_router_health_check_routing.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_router_interactions_endpoints.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
test_router_utils_common_utils.py fix: keep model capability flags out of provider requests (#46647) 2026-10-15 14:30:10 +00:00
test_routing_read_batch.py refactor: expose core private helpers under public names (#44871) 2026-10-07 00:05:27 +00:00