{"record":{"id":"09c5efbf042c81e9","repo":"BerriAI/litellm","slug":"model-must-be-a-non-empty-string","errorCode":null,"errorMessage":"model must be a non-empty string","messagePattern":"model must be a non-empty string","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/types/management_endpoints/router_settings_endpoints.py","lineNumber":38,"sourceCode":"    fallback_type: Literal[\"general\", \"context_window\", \"content_policy\"] = Field(\n        default=\"general\",\n        description=\"Type of fallback: 'general' (default), 'context_window', or 'content_policy'\",\n    )\n\n    @field_validator(\"fallback_models\")\n    @classmethod\n    def validate_fallback_models(cls, v: list[str]) -> list[str]:\n        if not v:\n            raise ValueError(\"fallback_models must contain at least one model\")\n        if len(v) != len(set(v)):\n            raise ValueError(\"fallback_models must not contain duplicates\")\n        return v\n\n    @field_validator(\"model\")\n    @classmethod\n    def validate_model(cls, v: str) -> str:\n        if not v or not v.strip():\n            raise ValueError(\"model must be a non-empty string\")\n        return v.strip()\n\n\nclass FallbackResponse(BaseModel):\n    \"\"\"Response model for fallback operations\"\"\"\n\n    model: str = Field(description=\"The model name\")\n    fallback_models: list[str] = Field(description=\"List of fallback model names\")\n    fallback_type: str = Field(description=\"Type of fallback\")\n    message: str = Field(description=\"Success message\")\n\n\nclass FallbackGetResponse(BaseModel):\n    \"\"\"Response model for getting fallbacks\"\"\"\n\n    model: str = Field(description=\"The model name\")\n    fallback_models: list[str] = Field(description=\"List of fallback model names\")\n    fallback_type: str = Field(description=\"Type of fallback\")","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/types/management_endpoints/router_settings_endpoints.py#L20-L56","documentation":"Pydantic field validator on the 'model' field of the fallback request model: it fires when model is empty or blank, i.e. the caller never specified which model the fallbacks attach to. Supply a non-empty model name.","triggerScenarios":"Thrown at litellm/types/management_endpoints/router_settings_endpoints.py:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a non-empty model string, e.g. 'gpt-4o'.","Trim whitespace before validation."],"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-14T00:17:10.932Z"}