{"record":{"id":"5b17075cedae197f","repo":"unslothai/unsloth","slug":"unknown-model-kind-model-kind-expected-one-of-5b1707","errorCode":null,"errorMessage":"Unknown model_kind '{model_kind}'. Expected one of {sorted(_MODEL_KINDS)}.","messagePattern":"Unknown model_kind '(.+?)'\\. Expected one of (.+?)\\.","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"studio/backend/core/inference/video.py","lineNumber":189,"sourceCode":"        \"lightricks/ltx-2.3\",\n        \"lightricks/ltx-2.3-fp8\",\n        # Wan2.2 official diffusers base repos: safetensors-only, no remote code.\n        \"wan-ai/wan2.2-ti2v-5b-diffusers\",\n        \"wan-ai/wan2.2-t2v-a14b-diffusers\",\n        # HunyuanVideo-1.5 community Diffusers repacks (tencent's own repo has no model_index.json).\n        \"hunyuanvideo-community/hunyuanvideo-1.5-diffusers-480p_t2v\",\n        \"hunyuanvideo-community/hunyuanvideo-1.5-diffusers-720p_t2v\",\n        \"minimaxai/minimax-h3\",\n    }\n)\n\n\ndef resolve_video_model_kind(gguf_filename: Optional[str], model_kind: Optional[str]) -> str:\n    \"\"\"Classify a load request; explicit model_kind wins, else the filename decides.\"\"\"\n    if model_kind:\n        kind = model_kind.strip().lower()\n        if kind not in _MODEL_KINDS:\n            raise ValueError(\n                f\"Unknown model_kind '{model_kind}'. Expected one of {sorted(_MODEL_KINDS)}.\"\n            )\n        return kind\n    if not gguf_filename:\n        return \"pipeline\"\n    return \"gguf\" if gguf_filename.strip().lower().endswith(\".gguf\") else \"single_file\"\n\n\ndef assert_video_precision_available(\n    fam: Any,\n    *,\n    model_kind: str,\n    transformer_quant: Optional[str] = None,\n    text_encoder_quant: Optional[str] = None,\n    memory_mode: Optional[str] = None,\n    gpu_ordinal: Optional[int] = None,\n) -> None:\n    \"\"\"Raise ``RuntimeError`` (the route's 409) when an EXPLICIT precision cannot run here.","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/video.py#L171-L207","documentation":"resolve_video_model_kind validates the explicit model_kind argument against _MODEL_KINDS = {'gguf', 'single_file', 'pipeline'} (case-insensitive after strip). Anything else raises ValueError before any family detection or download starts. It is the cheap gate that classifies how a video model should be loaded: diffusers pipeline repo, single .safetensors checkpoint, or GGUF quant.","triggerScenarios":"Calling a video load/route with model_kind set to a string not in {'gguf','single_file','pipeline'} — including typos, wrong casing is fine ('GGUF' works due to .lower()) but 'quantized', 'gguff', or 'pipeline ' with inner spaces fail.","commonSituations":"Hand-written API payloads with a guessed enum value; a frontend sending its internal model-type label instead of the backend enum; stale clients from before the model_kind parameter existed.","solutions":["Send one of the exact values: 'pipeline', 'gguf', or 'single_file'.","Omit model_kind entirely and let the filename decide (.gguf -> 'gguf', other filename -> 'single_file', no filename -> 'pipeline').","Validate against the sorted list echoed in the error message before submitting."],"exampleFix":"# before\nload_video_model(repo_id='...', gguf_filename='q4.gguf', model_kind='quantized')\n\n# after\nload_video_model(repo_id='...', gguf_filename='q4.gguf', model_kind='gguf')\n# or let it infer from the filename:\nload_video_model(repo_id='...', gguf_filename='q4.gguf')","handlingStrategy":"validation","validationCode":"_MODEL_KINDS = {'gguf', 'single_file', 'pipeline'}\ndef valid_model_kind(model_kind: str | None) -> bool:\n    return model_kind is None or model_kind.strip().lower() in _MODEL_KINDS","typeGuard":"from typing import Literal, Optional\nModelKind = Literal['gguf', 'single_file', 'pipeline']\ndef as_model_kind(value: str) -> Optional[ModelKind]:\n    v = value.strip().lower() if value else None\n    return v if v in ('gguf', 'single_file', 'pipeline') else None","tryCatchPattern":"try:\n    load_video_model(repo_id=r, model_kind=kind)\nexcept ValueError as e:\n    if 'Unknown model_kind' in str(e):\n        load_video_model(repo_id=r)  # let the filename infer the kind\n    else:\n        raise","preventionTips":["Type the field as a closed enum in the client; reject free text.","Prefer omitting model_kind and letting gguf_filename decide.","Echo the sorted allowed list in client validation messages to match the server."],"tags":["video","validation","enum","model-config"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}