From 05abb93c5d4ddfb4b20d6440c2fbacc6d88a06a9 Mon Sep 17 00:00:00 2001 From: songkuan-zheng <252822057+songkuan-zheng@users.noreply.github.com> Date: Fri, 11 Sep 2026 12:19:36 +0000 Subject: [PATCH] fix(router): declare cooldown_time as float on RouterRateLimitError The shared base declares cooldown_time as float | None because the budget limiter and the sync tpm strategy have no window to report. RouterRateLimitError always receives one, so it redeclares the attribute as float and callers that compare it keep a narrowed type Co-authored-by: songkuan-zheng <252822057+songkuan-zheng@users.noreply.github.com> Co-authored-by: songkuan-zheng --- litellm/types/router.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litellm/types/router.py b/litellm/types/router.py index 89c9b075d25..5ebf37d4022 100644 --- a/litellm/types/router.py +++ b/litellm/types/router.py @@ -967,6 +967,8 @@ class RouterErrorTypes(str, enum.Enum): class RouterRateLimitError(RouterNoDeploymentsAvailableError): + cooldown_time: float + def __init__( self, model: str,