From fbc2d42fcd8278e61837f6debc3223cbafa1149c Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 18 Sep 2026 12:40:58 +0000 Subject: [PATCH] refactor(proxy): drop descriptive docstrings from tag rate limit helpers Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- litellm/proxy/hooks/parallel_request_limiter_v3.py | 2 -- .../proxy/hooks/test_parallel_request_limiter_v3.py | 9 --------- 2 files changed, 11 deletions(-) diff --git a/litellm/proxy/hooks/parallel_request_limiter_v3.py b/litellm/proxy/hooks/parallel_request_limiter_v3.py index d3f56233b5f..2d813345e22 100644 --- a/litellm/proxy/hooks/parallel_request_limiter_v3.py +++ b/litellm/proxy/hooks/parallel_request_limiter_v3.py @@ -571,7 +571,6 @@ def _tag_rate_limit_descriptor(tag: str, limit: TagRateLimit, window_size: int) async def resolve_tag_rate_limits_from_db(tag_names: Sequence[str]) -> Mapping[str, TagRateLimit]: - """Read the rpm/tpm limits stored on each tag's budget row, served from the tag object cache.""" from litellm.proxy.auth.auth_checks import get_tag_objects_batch from litellm.proxy.proxy_server import prisma_client, user_api_key_cache @@ -2731,7 +2730,6 @@ class _PROXY_MaxParallelRequestsHandler_v3(CustomLogger): return descriptors async def _create_tag_rate_limit_descriptors(self, data: Mapping[str, object]) -> tuple[RateLimitDescriptor, ...]: - """One ``tag`` descriptor per request tag whose tag object carries an rpm or tpm limit.""" tags: Final = tuple(dict.fromkeys(get_tags_from_request_body(data))) if not tags: return () diff --git a/tests/test_litellm/proxy/hooks/test_parallel_request_limiter_v3.py b/tests/test_litellm/proxy/hooks/test_parallel_request_limiter_v3.py index f3335d4bce5..3a439e630ee 100644 --- a/tests/test_litellm/proxy/hooks/test_parallel_request_limiter_v3.py +++ b/tests/test_litellm/proxy/hooks/test_parallel_request_limiter_v3.py @@ -5014,10 +5014,6 @@ def _static_tag_limits(limits: dict[str, TagRateLimit]): @pytest.mark.asyncio async def test_tag_object_rpm_limit_enforced_v3(monkeypatch): - """ - rpm_limit stored on the tag object (via /tag/new) is enforced for every key - sending that tag, independently of any key-level tag_rpm_limit metadata. - """ monkeypatch.setenv("LITELLM_RATE_LIMIT_WINDOW_SIZE", "60") _request_stash.set(None) resolver, calls = _static_tag_limits({"cell-1": TagRateLimit(rpm_limit=2, tpm_limit=None)}) @@ -5050,10 +5046,6 @@ async def test_tag_object_rpm_limit_enforced_v3(monkeypatch): @pytest.mark.asyncio async def test_tag_object_tpm_limit_enforced_v3(monkeypatch): - """ - tpm_limit stored on the tag object is charged from actual usage on success - and blocks the tag once exhausted, while untagged traffic keeps flowing. - """ monkeypatch.setenv("LITELLM_RATE_LIMIT_WINDOW_SIZE", "60") monkeypatch.setenv("LITELLM_TPM_TOKEN_RESERVATION_ENABLED", "false") _request_stash.set(None) @@ -5095,7 +5087,6 @@ async def test_tag_object_tpm_limit_enforced_v3(monkeypatch): @pytest.mark.asyncio async def test_resolve_tag_rate_limits_from_db_reads_budget_row(monkeypatch): - """Only tags whose budget row carries an rpm or tpm limit are returned.""" from litellm.models.budget import LiteLLM_BudgetTable from litellm.models.tag import LiteLLM_TagTable from litellm.proxy import proxy_server