{"record":{"id":"ffe80f2e8d94232d","repo":"BerriAI/litellm","slug":"qualityrouter-no-model-available-for-quality-tier","errorCode":null,"errorMessage":"QualityRouter: no model available for quality tier {tier} and no default_model configured","messagePattern":"QualityRouter: no model available for quality tier (.+?) and no default_model configured","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/router_strategy/quality_router/quality_router.py","lineNumber":303,"sourceCode":"        if tier in tier_index and tier_index[tier]:\n            return tier_index[tier][0]\n\n        # Round up.\n        higher_tiers: Final = sorted(t for t in tier_index if t > tier)\n        for t in higher_tiers:\n            if tier_index[t]:\n                return tier_index[t][0]\n\n        # Round down — closest lower tier first.\n        lower_tiers: Final = sorted((t for t in tier_index if t < tier), reverse=True)\n        for t in lower_tiers:\n            if tier_index[t]:\n                return tier_index[t][0]\n\n        if self.config.default_model:\n            return self.config.default_model\n\n        raise ValueError(f\"QualityRouter: no model available for quality tier {tier} and no default_model configured\")\n\n    def _stash_decision(\n        self,\n        request_kwargs: dict[str, Any] | None,\n        decision: dict[str, Any],\n    ) -> None:\n        \"\"\"\n        Stash the routing decision in request_kwargs.metadata so the Router can\n        lift it into response headers (`x-litellm-quality-router-*`). The same\n        dict object flows from here through to `make_call.set_response_headers`.\n        \"\"\"\n        if request_kwargs is None:\n            return\n        metadata: Final = request_kwargs.setdefault(\"metadata\", {})\n        if isinstance(metadata, dict):\n            metadata[\"quality_router_decision\"] = decision\n\n    async def async_pre_routing_hook(","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/router_strategy/quality_router/quality_router.py#L285-L321","documentation":"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.","triggerScenarios":"Thrown at litellm/router_strategy/quality_router/quality_router.py:303 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure a model for the quality tier or set default_model in the QualityRouter config."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}