BerriAI/litellm · error · ValueError
tier_labels values must not reuse another tier's canonical n
Error message
tier_labels values must not reuse another tier's canonical name, which would make logs and the classifier rubric ambiguous: {', '.join(shadowed)} What it means
Config validator on ComplexityRouterConfig: a tier label (case-insensitively) equals another tier's canonical name (e.g. labeling the simple tier 'MEDIUM'), which would make logs and the classifier rubric ambiguous; offending labels are listed.
Source
Thrown at litellm/router_strategy/complexity_router/config.py:674
raise ValueError("keyword_tier_rules must be non-empty when semantic_keyword_matching is enabled")
return self
@model_validator(mode="after")
def _validate_tier_labels(self) -> "ComplexityRouterConfig":
if not self.tier_labels:
return self
blank: Final = tuple(sorted(tier.value for tier, label in self.tier_labels.items() if not label.strip()))
if blank:
raise ValueError(f"tier_labels values must be non-empty; blank labels for tiers: {', '.join(blank)}")
shadowed: Final = tuple(
sorted(
f"{tier.value} -> {label.strip()}"
for tier, label in self.tier_labels.items()
if label.strip().upper() in ComplexityTier.__members__ and label.strip().upper() != tier.value
)
)
if shadowed:
raise ValueError(
"tier_labels values must not reuse another tier's canonical name, which would make logs "
f"and the classifier rubric ambiguous: {', '.join(shadowed)}"
)
labeled: Final = self.labeled_tiers()
folded_labels: Final = tuple(label.casefold() for _, label in labeled)
duplicated: Final = tuple(
" and ".join(tier.value for tier, label in labeled if label.casefold() == folded)
for position, folded in enumerate(folded_labels)
if folded_labels.count(folded) > 1 and folded_labels.index(folded) == position
)
if duplicated:
raise ValueError(
f"tier_labels values must be unique across tiers; shared labels for: {'; '.join(duplicated)}"
)
return self
@model_validator(mode="after")
def _validate_plugins_adaptive_combo(self) -> "ComplexityRouterConfig":View on GitHub (pinned to 77b7c6c40c)
Solutions
- Rename labels that reuse another tier's canonical name so each tier label is distinct.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/router_strategy/complexity_router/config.py:674 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/f35d0a654543eaeb.
Report an issue: GitHub.