BerriAI/litellm · error · ValueError

QualityRouter: no model available for quality tier {tier} an

Error message

QualityRouter: no model available for quality tier {tier} and no default_model configured

What it means

Routing failure in QualityRouter: no indexed model exists for the requested quality tier, and no higher/lower tier could round into it, and no default_model is configured, so there is no model to route to.

Source

Thrown at litellm/router_strategy/quality_router/quality_router.py:303

        if tier in tier_index and tier_index[tier]:
            return tier_index[tier][0]

        # Round up.
        higher_tiers: Final = sorted(t for t in tier_index if t > tier)
        for t in higher_tiers:
            if tier_index[t]:
                return tier_index[t][0]

        # Round down — closest lower tier first.
        lower_tiers: Final = sorted((t for t in tier_index if t < tier), reverse=True)
        for t in lower_tiers:
            if tier_index[t]:
                return tier_index[t][0]

        if self.config.default_model:
            return self.config.default_model

        raise ValueError(f"QualityRouter: no model available for quality tier {tier} and no default_model configured")

    def _stash_decision(
        self,
        request_kwargs: dict[str, Any] | None,
        decision: dict[str, Any],
    ) -> None:
        """
        Stash the routing decision in request_kwargs.metadata so the Router can
        lift it into response headers (`x-litellm-quality-router-*`). The same
        dict object flows from here through to `make_call.set_response_headers`.
        """
        if request_kwargs is None:
            return
        metadata: Final = request_kwargs.setdefault("metadata", {})
        if isinstance(metadata, dict):
            metadata["quality_router_decision"] = decision

    async def async_pre_routing_hook(

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Configure a model for the quality tier or set default_model in the QualityRouter config.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at litellm/router_strategy/quality_router/quality_router.py:303 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/ffe80f2e8d94232d. Report an issue: GitHub.