{"record":{"id":"2eaf2bd5f65252e9","repo":"BerriAI/litellm","slug":"classifier-fallback-default-model-requires-a-def","errorCode":null,"errorMessage":"classifier_fallback='default_model' requires a default model: set complexity_router_default_model on the deployment or default_model in complexity_router_config","messagePattern":"classifier_fallback='default_model' requires a default model: set complexity_router_default_model on the deployment or default_model in complexity_router_config","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/router_strategy/complexity_router/complexity_router.py","lineNumber":560,"sourceCode":"        self.litellm_router_instance = litellm_router_instance\n        self._derive_savings_baseline = derive_savings_baseline\n\n        # Parse config - always create a new instance to avoid singleton mutation\n        if complexity_router_config:\n            self.config = ComplexityRouterConfig.model_validate(complexity_router_config)\n        else:\n            self.config = ComplexityRouterConfig()\n\n        # Override default_model if provided\n        if default_model:\n            self.config.default_model = default_model\n\n        # Checked here rather than on the config model because the deployment's\n        # complexity_router_default_model arrives outside complexity_router_config and is\n        # applied just above, so a validator on the model would reject a deployment that\n        # does have a default model, just not in that dict.\n        if self.config.classifier_fallback == \"default_model\" and not self.config.default_model:\n            raise ValueError(\n                \"classifier_fallback='default_model' requires a default model: set \"\n                \"complexity_router_default_model on the deployment or default_model in \"\n                \"complexity_router_config\"\n            )\n\n        # Build effective keyword lists (use config overrides or defaults)\n        self.code_keywords = self.config.code_keywords or DEFAULT_CODE_KEYWORDS\n        self.reasoning_keywords = self.config.reasoning_keywords or DEFAULT_REASONING_KEYWORDS\n        self.technical_keywords = _append_custom_keywords(\n            self.config.technical_keywords or DEFAULT_TECHNICAL_KEYWORDS,\n            self.config.custom_technical_keywords,\n        )\n        self.simple_keywords = self.config.simple_keywords or DEFAULT_SIMPLE_KEYWORDS\n        self.escalation_keywords = (\n            self.config.escalation_keywords\n            if self.config.escalation_keywords is not None\n            else DEFAULT_ESCALATION_KEYWORDS\n        )","sourceCodeStart":542,"sourceCodeEnd":578,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/router_strategy/complexity_router/complexity_router.py#L542-L578","documentation":"Raised by the complexity router when the classifier fallback mode is 'default_model' but no default model could be derived from the deployment (complexity_router_default_model) or the router config, leaving the fallback unusable.","triggerScenarios":"Thrown at litellm/router_strategy/complexity_router/complexity_router.py:560 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set complexity_router_default_model on the deployment or default_model in complexity_router_config, or change classifier_fallback."],"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"}