diff --git a/litellm/litellm_core_utils/litellm_logging.py b/litellm/litellm_core_utils/litellm_logging.py index 03d21452513..140449d2e54 100644 --- a/litellm/litellm_core_utils/litellm_logging.py +++ b/litellm/litellm_core_utils/litellm_logging.py @@ -4477,7 +4477,9 @@ def _init_custom_logger_compatible_class( _in_memory_loggers.append(dynamic_rate_limiter_obj_v3) return dynamic_rate_limiter_obj_v3 elif logging_integration == "tag_rate_limiter": - from litellm.proxy.hooks.tag_rate_limiter import _PROXY_TagRateLimiter + from litellm.proxy.hooks.tag_rate_limiter import ( + _PROXY_TagRateLimiter, # pyright: ignore[reportPrivateUsage] # resolved by name like every other opt-in callback here + ) for callback in _in_memory_loggers: if isinstance(callback, _PROXY_TagRateLimiter): @@ -4933,7 +4935,9 @@ def get_custom_logger_compatible_class( return callback elif logging_integration == "tag_rate_limiter": - from litellm.proxy.hooks.tag_rate_limiter import _PROXY_TagRateLimiter + from litellm.proxy.hooks.tag_rate_limiter import ( + _PROXY_TagRateLimiter, # pyright: ignore[reportPrivateUsage] # resolved by name like every other opt-in callback here + ) for callback in _in_memory_loggers: if isinstance(callback, _PROXY_TagRateLimiter): diff --git a/litellm/proxy/hooks/tag_rate_limiter.py b/litellm/proxy/hooks/tag_rate_limiter.py index 993893d452a..db88d7438fc 100644 --- a/litellm/proxy/hooks/tag_rate_limiter.py +++ b/litellm/proxy/hooks/tag_rate_limiter.py @@ -14,16 +14,18 @@ from litellm.caching.dual_cache import DualCache from litellm.exceptions import RateLimitType from litellm.integrations.custom_logger import CustomLogger from litellm.litellm_core_utils.core_helpers import ( - _get_parent_otel_span_from_kwargs, + _get_parent_otel_span_from_kwargs, # pyright: ignore[reportPrivateUsage] # reused across module boundaries, matching dynamic_rate_limiter_v3's identical import get_metadata_variable_name_from_kwargs, ) from litellm.proxy.common_utils.proxy_rate_limit_error import ProxyRateLimitError from litellm.proxy.hooks.parallel_request_limiter_v3 import ( - _PROXY_MaxParallelRequestsHandler_v3, + _PROXY_MaxParallelRequestsHandler_v3, # pyright: ignore[reportPrivateUsage] # this hook explicitly reuses its Redis/TTL-preserving increment machinery, see module docstring ) from litellm.proxy.utils import InternalUsageCache from litellm.router import Router -from litellm.router_strategy.tag_based_routing import _get_tags_from_request_kwargs +from litellm.router_strategy.tag_based_routing import ( + _get_tags_from_request_kwargs, # pyright: ignore[reportPrivateUsage] # reused across module boundaries, matching dynamic_rate_limiter_v3's identical import +) from litellm.types.caching import RedisPipelineIncrementOperation from litellm.types.llms.openai import AllMessageValues from litellm.types.router import TagRateLimitEntry, TagRateLimits