BerriAI/litellm · error · ValueError

classifier_fallback='default_model' requires a default model

Error message

classifier_fallback='default_model' requires a default model: set complexity_router_default_model on the deployment or default_model in complexity_router_config

What it means

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.

Source

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

        self.litellm_router_instance = litellm_router_instance
        self._derive_savings_baseline = derive_savings_baseline

        # Parse config - always create a new instance to avoid singleton mutation
        if complexity_router_config:
            self.config = ComplexityRouterConfig.model_validate(complexity_router_config)
        else:
            self.config = ComplexityRouterConfig()

        # Override default_model if provided
        if default_model:
            self.config.default_model = default_model

        # Checked here rather than on the config model because the deployment's
        # complexity_router_default_model arrives outside complexity_router_config and is
        # applied just above, so a validator on the model would reject a deployment that
        # does have a default model, just not in that dict.
        if self.config.classifier_fallback == "default_model" and not self.config.default_model:
            raise ValueError(
                "classifier_fallback='default_model' requires a default model: set "
                "complexity_router_default_model on the deployment or default_model in "
                "complexity_router_config"
            )

        # Build effective keyword lists (use config overrides or defaults)
        self.code_keywords = self.config.code_keywords or DEFAULT_CODE_KEYWORDS
        self.reasoning_keywords = self.config.reasoning_keywords or DEFAULT_REASONING_KEYWORDS
        self.technical_keywords = _append_custom_keywords(
            self.config.technical_keywords or DEFAULT_TECHNICAL_KEYWORDS,
            self.config.custom_technical_keywords,
        )
        self.simple_keywords = self.config.simple_keywords or DEFAULT_SIMPLE_KEYWORDS
        self.escalation_keywords = (
            self.config.escalation_keywords
            if self.config.escalation_keywords is not None
            else DEFAULT_ESCALATION_KEYWORDS
        )

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Set complexity_router_default_model on the deployment or default_model in complexity_router_config, or change classifier_fallback.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/router_strategy/complexity_router/complexity_router.py:560 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/2eaf2bd5f65252e9. Report an issue: GitHub.