BerriAI/litellm · error · ValueError
classifier_llm_config is not set
Error message
classifier_llm_config is not set
What it means
Config guard in the complexity router: routing requests need an LLM classifier (classifier_type 'llm' or code paths calling _classify_with_llM) but no classifier_llm_config was set, so there is no model to classify with.
Source
Thrown at litellm/router_strategy/complexity_router/complexity_router.py:1001
Call the configured classifier model with a system/user role split and prior-turn context.
Builds a structured classification prompt with:
- System message: the stable classifier rubric AND the caller's own system prompt (task
constraints). This is the largest, most repeated part of the call, so keeping it in the
system role lets the provider prompt-cache it across a session's classifier calls.
- User message: the variable payload -- a few prior user turns for context and the current
ask to classify.
Args:
prompt: The current user ask text (already extracted as the real human ask, not tool results)
system_prompt: The caller's system prompt (task constraints), always included so later
turns never lose it
request_kwargs: Request metadata for spend attribution
messages: Full message history for extracting prior turns and the trajectory signal
"""
llm_config: Final = self.config.classifier_llm_config
if llm_config is None:
raise ValueError("classifier_llm_config is not set")
include_assistant: Final = self.config.classifier_context_include_assistant_turns
context_enabled: Final = bool(messages) and self.config.classifier_context_window_size > 0
prior_turns: Final = (
_extract_prior_turns(
messages,
current_ask=prompt,
window_size=self.config.classifier_context_window_size,
per_turn_chars=self.config.classifier_context_per_turn_chars,
include_assistant=include_assistant,
marker_pairs=self._reminder_markers,
)
if context_enabled
else ()
)
has_prior_conversation: Final = (
context_enabled
and len(View on GitHub (pinned to 77b7c6c40c)
Solutions
- Set classifier_llm_config in the complexity router config.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/router_strategy/complexity_router/complexity_router.py:1001 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/fa0ac7b8cc105df7.
Report an issue: GitHub.