{"record":{"id":"adc59dd740095e2a","repo":"BerriAI/litellm","slug":"empty-model-pool-for-tier-tier-key","errorCode":null,"errorMessage":"Empty model pool for tier {tier_key}","messagePattern":"Empty model pool for tier (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/router_strategy/complexity_router/complexity_router.py","lineNumber":1175,"sourceCode":"\n        if tier_key in self.config.tiers:\n            return self._pick_from_tier_value(self.config.tiers[tier_key], tier_key)\n\n        if self.config.default_model:\n            return self.config.default_model\n\n        medium_key: Final = ComplexityTier.MEDIUM.value\n        if medium_key in self.config.tiers:\n            return self._pick_from_tier_value(self.config.tiers[medium_key], medium_key)\n\n        raise ValueError(f\"No model configured for tier {tier_key} and no default_model set\")\n\n    @staticmethod\n    def _pick_from_tier_value(model: str | list[str], tier_key: str) -> str:\n        if isinstance(model, str):\n            return model\n        if not model:\n            raise ValueError(f\"Empty model pool for tier {tier_key}\")\n        return random.choice(model)\n\n    def _tier_pools(self) -> dict[str, list[str]]:\n        return {tier: (models if isinstance(models, list) else [models]) for tier, models in self.config.tiers.items()}\n\n    async def _pick_model_for_tier(\n        self,\n        tier: ComplexityTier,\n        raw_messages: list[dict[str, Any]] | None,\n        resolved_messages: list[dict[str, Any]] | None,\n        request_kwargs: dict,\n    ) -> str:\n        if not self.config.plugins:\n            return self.get_model_for_tier(tier)\n\n        from litellm.types.router import RoutingContext\n\n        tier_key: Final = tier.value","sourceCodeStart":1157,"sourceCodeEnd":1193,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/router_strategy/complexity_router/complexity_router.py#L1157-L1193","documentation":"Routing guard in the complexity router's tier picker: a tier's configured value resolved to an empty model pool (empty string/list in config), so there is no model to route to for that tier.","triggerScenarios":"Thrown at litellm/router_strategy/complexity_router/complexity_router.py:1175 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add models to the tier's pool in the complexity router config."],"exampleFix":null,"handlingStrategy":"validation","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-14T05:17:10.506Z"}