refactor(router): drop explanatory docstrings from routing group helpers

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
ryan 2026-09-16 01:59:17 +00:00
parent 9afac68995
commit 4bca66f303
3 changed files with 0 additions and 27 deletions

View file

@ -6902,12 +6902,6 @@ class ProxyConfig:
@staticmethod
def _apply_router_settings(llm_router: Router, router_settings: Mapping[str, object]) -> None:
"""
`routing_groups` is applied on its own so a value persisted before
save-time validation existed cannot abort the reconcile that also loads
SSO, guardrails and the other DB-backed settings. The router keeps the
groups it already holds when the new value is rejected.
"""
llm_router.update_settings(**{k: v for k, v in router_settings.items() if k != "routing_groups"})
if "routing_groups" not in router_settings:
return

View file

@ -1392,10 +1392,6 @@ class Router:
at most one explicit group. Constructs per-group strategy selectors so
groups with different `routing_strategy_args` track independent state.
Validation and selector construction run to completion before any
router state changes, so a rejected input raises with the previously
loaded groups still routing.
Models not claimed by any explicit group are served by the implicit
`"default"` group, whose selectors are the `self.<strategy>_logger`
attributes set up in `routing_strategy_init`.

View file

@ -1,9 +1,3 @@
"""
Validation for `router_settings.routing_groups`, shared by the Router and the
proxy's config-update endpoint so a config the UI saves cannot be one the
runtime refuses to load.
"""
from collections.abc import Sequence
from typing import Final
@ -12,11 +6,6 @@ from litellm.types.router import RoutingGroup, RoutingStrategy
def validate_routing_strategy(routing_strategy: RoutingStrategy | str | None) -> None:
"""
Raises `ValueError` unless `routing_strategy` is a known strategy or None.
See: https://github.com/BerriAI/litellm/issues/11330
"""
if routing_strategy is None:
return
@ -36,12 +25,6 @@ def parse_routing_groups(
groups_input: Sequence[RoutingGroup | dict] | None,
known_model_names: frozenset[str] = frozenset(),
) -> tuple[RoutingGroup, ...]:
"""
Parses and validates `routing_groups`, raising `ValueError` on the first
problem found. Every check runs before the caller mutates any state, so an
invalid update can never leave a router holding a half-applied set of
groups.
"""
if not groups_input:
return ()