BerriAI/litellm · error · ValueError

tier_labels values must be unique across tiers; shared label

Error message

tier_labels values must be unique across tiers; shared labels for: {'; '.join(duplicated)}

What it means

Config validator on ComplexityRouterConfig: two or more tiers share the same human-readable label (case-folded), so logs and classifier output could not distinguish them; the colliding tiers are listed.

Source

Thrown at litellm/router_strategy/complexity_router/config.py:686

                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":
        if self.plugins and self.adaptive:
            raise ValueError(
                "plugins and adaptive=True cannot both be set: adaptive's bandit selection doesn't yet "
                "consume plugin-narrowed candidate pools. Disable adaptive or remove plugins."
            )
        return self

    def tier_label(self, tier: ComplexityTier) -> str:
        """Operator-facing display name for a tier, falling back to its canonical name."""
        return self.tier_labels.get(tier, "").strip() or tier.value

    def labeled_tiers(self) -> tuple[tuple[ComplexityTier, str], ...]:

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Make tier_labels values unique across tiers.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/router_strategy/complexity_router/config.py:686 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/60825b2acb52f1e8. Report an issue: GitHub.