litellm/litellm/router_utils
Mateo Wang 3ccc619792
fix(router): make the constructor stub work for mypy and guard it in CI (#50354)
* fix(router): make the constructor stub work for mypy and guard it in CI

Use a plain ParamSpec so mypy reads the stub, drop the dead _host parameter
the Rust core already refused, type check a valid and an unknown argument in
tests/e2e_harness, and run that type check when litellm Python files change.

* fix(typing): read type variables as type variables in mypy and guard the Router stub in lint

* fix(typing): count only the probe errors in the Router stub guard and flag Final type variables everywhere

* fix(lint): run the Router stub guard and e2e type check from make check

make check now runs check_router_constructor_stub.py when litellm/router.py
or uv.lock changes, and the e2e basedpyright step on pyproject.toml, uv.lock,
pyrightconfig.json, and litellm-proxy-extras Python, matching CI. CI's e2e
type check also fires on litellm-proxy-extras Python, which tests/e2e/perf
imports. LIT010 treats TypeAliasType like a type variable, since mypy also
rejects a Final type alias.

* fix(lint): guard the Router stub through the litellm export and keep TypeAliasType bare in LIT010 docs

* test: type the new LIT010 type variable tests
2026-11-22 21:25:00 +00:00
..
pre_call_checks fix(router): make the constructor stub work for mypy and guard it in CI (#50354) 2026-11-22 21:25:00 +00:00
router_callbacks refactor(router): move Redis key construction out of router-core into the stores (#50356) 2026-11-13 03:22:27 +00:00
client_initalization_utils.py refactor(router): delete router code nothing calls (#52516) 2026-11-19 06:11:10 +09:00
cooldown_cache.py feat(redis): serve the proxy's common Redis call with Rust stores (#50170) 2026-11-06 06:01:11 +00:00
cooldown_callbacks.py refactor(typing): clear 1141 basedpyright Any errors across 182 files (#50711) 2026-11-11 22:11:47 +00:00
cooldown_handlers.py fix(router): keep one caller's own bad credential from cooling down a shared deployment (#53431) 2026-11-21 17:09:29 -08:00
deployment_numbers.py refactor: clean up fresh tech debt in routing, riva, least-busy, proxy cache and prompt template helpers (#50192) 2026-11-19 09:43:47 +00:00
dynamic_queue.py fix(router): make the constructor stub work for mypy and guard it in CI (#50354) 2026-11-22 21:25:00 +00:00
dynamic_queue_redis.py feat(router): coordinate congestion queues through Redis (#52367) 2026-11-17 19:29:39 -08:00
dynamic_queue_router.py fix(router): make the constructor stub work for mypy and guard it in CI (#50354) 2026-11-22 21:25:00 +00:00
embedding_batch_size_check.py feat(embeddings): enforce per-request input batch limit (#44574) 2026-10-20 11:35:18 +00:00
endpoint_eligibility.py fix(router): make the constructor stub work for mypy and guard it in CI (#50354) 2026-11-22 21:25:00 +00:00
fallback_event_handlers.py refactor(router): delete router code nothing calls (#52516) 2026-11-19 06:11:10 +09:00
global_callback_holders.py feat(router): add the Rust router core with the host as its only boundary (#49513) 2026-11-04 21:47:58 -08:00
handle_error.py refactor(router): delete router code nothing calls (#52516) 2026-11-19 06:11:10 +09:00
health_state_cache.py feat(redis): serve the health checks' deployment states from a native store (#50357) 2026-11-13 03:22:28 +00:00
kubernetes_pod_discovery.py fix(router): make the constructor stub work for mypy and guard it in CI (#50354) 2026-11-22 21:25:00 +00:00
model_group_pricing.py feat(model-hub): show each deployment's full prices in the model hub (#50145) 2026-11-06 10:45:44 -08:00
prompt_caching_cache.py fix(router): pin /v1/responses requests for prompt caching affinity (#50321) 2026-11-06 12:56:54 -08:00
request_priority.py feat(proxy): accept request priority from the x-litellm-priority header (#47618) 2026-10-28 15:58:52 -07:00
routing_prefetch.py fix(router): scope cooldown reads to request candidates (#52913) 2026-11-19 12:20:15 -08:00
routing_read_batch.py fix(router): scope cooldown reads to request candidates (#52913) 2026-11-19 12:20:15 -08:00
stream_usage_injection.py fix(streaming)!: send the include_usage chunk with an empty choices array (#47109) 2026-10-21 02:26:05 +00:00