fix(proxy): satisfy type-discipline gates in guard middleware

LIT001: declare the mutable-ok suppression for the conditionally
assembled config kwargs. LIT003: give the availability-probe noqa a
reason.
This commit is contained in:
Renn F 2026-10-11 02:32:27 +02:00
parent dcb4d9e7ef
commit df88b920c4
No known key found for this signature in database
GPG key ID: B48363D3A3A4CF78
2 changed files with 2 additions and 2 deletions

View file

@ -76,7 +76,7 @@ def _build_guard_config() -> SecurityConfig:
"""Build the SecurityConfig from the LITELLM_GUARD_* environment variables."""
from guard import SecurityConfig
kwargs: dict[str, object] = {
kwargs: dict[str, object] = { # mutable-ok: assembled conditionally, then passed once to SecurityConfig
"enable_rate_limiting": True,
"rate_limit": _env_int("LITELLM_GUARD_RATE_LIMIT", 100),
"rate_limit_window": _env_int("LITELLM_GUARD_RATE_LIMIT_WINDOW", 60),

View file

@ -22,7 +22,7 @@ from litellm.proxy.middleware.guard_middleware import (
_IP = itertools.count(1)
try:
import guard # noqa: F401
import guard # noqa: F401 # availability probe for skip logic
_GUARD_AVAILABLE = True
except ImportError: