BerriAI/litellm · error · ValueError

No candidate models left for tier {tier_key} after routing-p

Error message

No candidate models left for tier {tier_key} after routing-plugin filtering

What it means

Routing guard in the complexity router's plugin flow: the tier's model pool existed, but after all routing plugins ran, the candidate model list was empty — a plugin filtered out every candidate for this request.

Source

Thrown at litellm/router_strategy/complexity_router/complexity_router.py:1216

            # plugin-filtering error below and send the operator hunting for a policy
            # plugin that never ran, so name the real problem: the tier has no models.
            raise ValueError(f"No models configured for tier {tier_key}")
        context = RoutingContext(
            raw_messages=raw_messages or [],
            structured_messages=resolved_messages or [],
            candidate_models=list(pool),
            metadata=request_kwargs.get(metadata_key) or {},
        )
        for plugin in self.config.plugins:
            context = await plugin.run(context)

        if not context.candidate_models:
            # A plugin narrowing a tier to zero candidates is a policy decision (e.g. no
            # model this tenant's budget allows) -- falling back to default_model here
            # (which was never checked against the plugins) would let that policy be
            # silently bypassed. Raise instead, matching the Router-level plugin
            # pipeline's own fail-closed behavior for the same situation.
            raise ValueError(f"No candidate models left for tier {tier_key} after routing-plugin filtering")
        return self._pick_from_tier_value(context.candidate_models, tier_key)

    def _ensure_adaptive_router(self) -> Any | None:
        if not self.config.adaptive:
            return None
        if self.adaptive_router is not None:
            return self.adaptive_router
        if self._adaptive_init_attempted:
            return self.adaptive_router
        self._adaptive_init_attempted = True

        from litellm.router_strategy.adaptive_router.adaptive_router import (
            AdaptiveRouter,
        )
        from litellm.router_strategy.adaptive_router.config import (
            ADAPTIVE_ROUTER_CHOSEN_MODEL_KEY,
        )
        from litellm.types.router import (

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Loosen routing-plugin filters or add models for the tier that pass the filters.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at litellm/router_strategy/complexity_router/complexity_router.py:1216 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/2488737d37433342. Report an issue: GitHub.