refactor(proxy): drop docstrings from key model limit helpers

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
yassin 2026-09-15 22:08:39 +00:00
parent 51a4cb9fdd
commit 460a0128c9
2 changed files with 0 additions and 8 deletions

View file

@ -980,12 +980,6 @@ def get_key_own_model_rate_limit(
user_api_key_dict: UserAPIKeyAuth,
rate_limit_key: Literal["model_rpm_limit", "model_tpm_limit"],
) -> dict[str, int] | None:
"""
Per-model limit the key sets on itself: key metadata first, then model_max_budget.
Unlike get_key_model_rpm_limit / get_key_model_tpm_limit this never falls back to the
team, so callers can tell a key override apart from an inherited team limit.
"""
if user_api_key_dict.metadata:
result: Final = user_api_key_dict.metadata.get(rate_limit_key)
if result:

View file

@ -2899,7 +2899,6 @@ class _PROXY_MaxParallelRequestsHandler_v3(CustomLogger):
requested_model: str,
rate_limit_key: Literal["model_rpm_limit", "model_tpm_limit"],
) -> int | None:
"""Team per-model limit this key inherits: None when the key sets its own limit for the model."""
team_limits: Final = get_model_rate_limit_from_metadata(user_api_key_dict, "team_metadata", rate_limit_key)
team_limit: Final = team_limits.get(requested_model) if team_limits else None
if team_limit is None:
@ -2915,7 +2914,6 @@ class _PROXY_MaxParallelRequestsHandler_v3(CustomLogger):
requested_model: str | None,
descriptors: list[RateLimitDescriptor],
) -> None:
"""Add the team's per-model descriptor for the metrics the key does not override itself."""
if requested_model is None:
return
team_rpm_limit: Final = self._inherited_team_model_limit(user_api_key_dict, requested_model, "model_rpm_limit")