{"record":{"id":"836687db7059a550","repo":"BerriAI/litellm","slug":"prompt-must-not-be-blank","errorCode":null,"errorMessage":"prompt must not be blank","messagePattern":"prompt must not be blank","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/types/management_endpoints/auto_router_endpoints.py","lineNumber":51,"sourceCode":"    )\n    default_model: str | None = Field(\n        default=None,\n        description=\"Model to route to when no tier resolves, i.e. complexity_router_default_model\",\n    )\n    router_name: str = Field(\n        default=DEFAULT_ROUTING_TEST_ROUTER_NAME,\n        description=\"Name reported as the router in the routing decision. Display only\",\n    )\n    team_id: str | None = Field(\n        default=None,\n        description=\"Team the router is being created for. Required for a team admin, who may only test their own team's routers\",\n    )\n\n    @field_validator(\"prompt\")\n    @classmethod\n    def _require_non_blank_prompt(cls, value: str) -> str:\n        if not value.strip():\n            raise ValueError(\"prompt must not be blank\")\n        return value\n\n\nclass AutoRouterRoutingTestResponse(BaseModel):\n    \"\"\"Where one prompt would have been routed, and why.\"\"\"\n\n    routed_model: str = Field(description=\"The model group the router picked\")\n    routed_model_configured: bool = Field(\n        description=\"Whether routed_model is a model group this proxy actually serves\",\n    )\n    routing_decision: StandardLoggingRoutingDecision = Field(\n        description=\"The decision record this request would have written to its log row\",\n    )\n\n\nclass AutoRouterCacheBucket(BaseModel):\n    \"\"\"One prompt-caching bucket of turns, with how often those turns hit the cache.\"\"\"\n","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/types/management_endpoints/auto_router_endpoints.py#L33-L69","documentation":"Pydantic field validator on the 'prompt' field of the routing-test request model: it fires when prompt is empty/whitespace-only after parsing. The request is rejected before any router logic runs because a routing test needs a non-blank prompt to classify.","triggerScenarios":"Thrown at litellm/types/management_endpoints/auto_router_endpoints.py:51 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a non-blank prompt string for the auto-router request.","Strip whitespace and reject empty prompts client-side."],"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"}