{"record":{"id":"08622eea25bf4065","repo":"BerriAI/litellm","slug":"llm-classifier-returned-empty-content","errorCode":null,"errorMessage":"LLM classifier returned empty content","messagePattern":"LLM classifier returned empty content","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/router_strategy/complexity_router/complexity_router.py","lineNumber":1077,"sourceCode":"                \"model\": llm_config.model,\n                \"messages\": messages_for_call,\n                \"response_format\": response_format,\n            }\n        }\n\n        response: Final[ModelResponse] = await self.litellm_router_instance.acompletion(\n            model=llm_config.model,\n            messages=messages_for_call,\n            response_format=response_format,\n            timeout=llm_config.timeout_ms / 1000,\n            metadata=metadata,\n            proxy_server_request=proxy_server_request,\n            turn_off_message_logging=turn_off_message_logging,\n            **_parent_session_kwargs(request_kwargs),\n        )\n        content: Final = response.choices[0].message.content\n        if not content:\n            raise ValueError(\"LLM classifier returned empty content\")\n        raw_tier: Final = _LabeledTierClassification.model_validate_json(content).tier\n        tier: Final = self.config.tier_for_label(raw_tier)\n        if tier is None:\n            raise ValueError(f\"LLM classifier returned an unrecognized tier: {raw_tier!r}\")\n        return tier, _response_cost_or_none(response)\n\n    @staticmethod\n    def _build_classifier_user_payload(\n        prompt: str,\n        system_prompt: str | None = None,\n        prior_turns: Sequence[tuple[str, str]] | None = None,\n        messages: Sequence[Mapping[str, object]] | None = None,\n        has_prior_conversation: bool = False,\n        label_roles: bool = False,\n    ) -> str:\n        \"\"\"Build the classifier's user message: caller constraints, prior turns, depth, current ask.\n\n        Everything here is caller-controlled, which is why none of it is interpolated into the system","sourceCodeStart":1059,"sourceCodeEnd":1095,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/router_strategy/complexity_router/complexity_router.py#L1059-L1095","documentation":"Result guard in the complexity router's LLM classifier: the completion succeeded but choices[0].message.content is empty, so there is no tier text to parse; typically a filtered/refused response or a misconfigured model.","triggerScenarios":"Thrown at litellm/router_strategy/complexity_router/complexity_router.py:1077 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry; check the classifier model config and prompt so it returns a tier label."],"exampleFix":null,"handlingStrategy":"try-catch","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"}