BerriAI/litellm · error · ValueError
prompt must not be blank
Error message
prompt must not be blank
What it means
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.
Source
Thrown at litellm/types/management_endpoints/auto_router_endpoints.py:51
)
default_model: str | None = Field(
default=None,
description="Model to route to when no tier resolves, i.e. complexity_router_default_model",
)
router_name: str = Field(
default=DEFAULT_ROUTING_TEST_ROUTER_NAME,
description="Name reported as the router in the routing decision. Display only",
)
team_id: str | None = Field(
default=None,
description="Team the router is being created for. Required for a team admin, who may only test their own team's routers",
)
@field_validator("prompt")
@classmethod
def _require_non_blank_prompt(cls, value: str) -> str:
if not value.strip():
raise ValueError("prompt must not be blank")
return value
class AutoRouterRoutingTestResponse(BaseModel):
"""Where one prompt would have been routed, and why."""
routed_model: str = Field(description="The model group the router picked")
routed_model_configured: bool = Field(
description="Whether routed_model is a model group this proxy actually serves",
)
routing_decision: StandardLoggingRoutingDecision = Field(
description="The decision record this request would have written to its log row",
)
class AutoRouterCacheBucket(BaseModel):
"""One prompt-caching bucket of turns, with how often those turns hit the cache."""
View on GitHub (pinned to 77b7c6c40c)
Solutions
- Provide a non-blank prompt string for the auto-router request.
- Strip whitespace and reject empty prompts client-side.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at litellm/types/management_endpoints/auto_router_endpoints.py:51 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/836687db7059a550.
Report an issue: GitHub.