From 55f77ac709775ca3798cafb4edb61beb72d3ea2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AE=E5=BD=93=E7=8C=AB?= <2756823972@qq.com> Date: Mon, 12 Oct 2026 14:42:22 +0800 Subject: [PATCH] fix(router): silence LIT001 on the two new mutable annotations - async_get_available_deployment: keep the new '-> dict[str, Any]' return annotation on one line with a short '# mutable-ok:' reason so ruff formatting cannot detach the suppression (LIT013 would count it dead). - _track_deployment_metrics: narrow the new 'deployment' parameter to Mapping[str, Any] (read-only view; the method only reads the dict), removing the LIT001 mutable-collection annotation entirely. type_discipline_gate: OK (no LIT rule grew past merge-base); ruff format + check clean; basedpyright counts unchanged by this edit. Signed-off-by: apex-mochen <2756823972@qq.com> --- litellm/router.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/router.py b/litellm/router.py index 0644005423c..36c6c0e525b 100644 --- a/litellm/router.py +++ b/litellm/router.py @@ -13792,7 +13792,7 @@ class Router: messages: list[dict[str, str]] | None = None, input: str | list | None = None, specific_deployment: bool | None = False, - ) -> dict[str, Any]: + ) -> dict[str, Any]: # mutable-ok: returns pass-through deployment map """ Async implementation of 'get_available_deployments'. @@ -15206,7 +15206,7 @@ class Router: return pass_through_deployments def _track_deployment_metrics( - self, deployment: dict[str, Any], parent_otel_span: Span | None, response: object | None = None + self, deployment: Mapping[str, Any], parent_otel_span: Span | None, response: object | None = None ): """ Tracks successful requests rpm usage.