{"record":{"id":"2cb9d7c23f87633c","repo":"unslothai/unsloth","slug":"stt-model-model-is-not-a-curated-llama-cpp-dic","errorCode":null,"errorMessage":"STT model '{model}' is not a curated llama.cpp dictation model. Choose one of: {', '.join(MTMD_STT_MODELS)}.","messagePattern":"STT model '(.+?)' is not a curated llama\\.cpp dictation model\\. Choose one of: (.+?)\\.","errorType":"http","errorClass":"SttModelIdError","httpStatus":422,"severity":"error","filePath":"studio/backend/core/inference/stt_mtmd_sidecar.py","lineNumber":125,"sourceCode":"\ndef _transcript_token_budget(audio_seconds: Optional[float]) -> int:\n    \"\"\"Output cap for a clip. A fixed one silently truncated long audio.\"\"\"\n    if not audio_seconds or audio_seconds <= 0:\n        return _MIN_TRANSCRIPT_TOKENS\n    scaled = int(audio_seconds * _TRANSCRIPT_TOKENS_PER_SECOND)\n    return max(_MIN_TRANSCRIPT_TOKENS, min(scaled, _MAX_TRANSCRIPT_TOKENS))\n\n\n_SERVER_START_TIMEOUT_SECONDS = 180.0\n_TRANSCRIBE_TIMEOUT_SECONDS = 600.0\n\n\ndef resolve_mtmd_model_id(model: Optional[str]) -> str:\n    \"\"\"Validate a curated mtmd model id. Custom repos are not supported here.\"\"\"\n    normalized = (model or \"\").strip()\n    if normalized in MTMD_STT_MODELS:\n        return normalized\n    raise SttModelIdError(\n        f\"STT model '{model}' is not a curated llama.cpp dictation model. \"\n        f\"Choose one of: {', '.join(MTMD_STT_MODELS)}.\"\n    )\n\n\ndef is_mtmd_model(model: Optional[str]) -> bool:\n    return (model or \"\").strip() in MTMD_STT_MODELS\n\n\ndef find_llama_server_binary() -> Optional[str]:\n    from core.inference.llama_cpp import LlamaCppBackend\n    return LlamaCppBackend._find_llama_server_binary()\n\n\ndef is_available() -> bool:\n    \"\"\"True when llama-server is installed and audio can be decoded.\"\"\"\n    if find_llama_server_binary() is None:\n        return False","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/stt_mtmd_sidecar.py#L107-L143","documentation":"SttModelIdError raised by resolve_mtmd_model_id: the supplied model string (after strip, with empty falling through to rejection since '' is not in MTMD_STT_MODELS) is not one of the curated llama.cpp multimodal-dictation (MTMD) model ids. The mtmd sidecar deliberately supports only curated models — custom HF repos are rejected here.","triggerScenarios":"Passing any model id not in the MTMD_STT_MODELS set to the mtmd sidecar's API (download start, load, transcribe) — including None/empty, a GGUF whisper model id, or an arbitrary HF repo name.","commonSituations":"Routing logic sends a whisper model id to the mtmd sidecar or vice versa; user pastes a custom repo into the Voice settings; empty string from a UI default leaks through.","solutions":["Use one of the curated ids listed in the error message (', '.join(MTMD_STT_MODELS)).","Gate the UI dropdown to MTMD_STT_MODELS so invalid ids cannot be submitted.","Use is_mtmd_model(model) before dispatch to route to the correct sidecar."],"exampleFix":"// before\nif model.startswith(\"mtmd\"):\n    sidecar.load(model)  # raises for near-miss ids\n\n// after\nfrom core.inference.stt_mtmd_sidecar import is_mtmd_model\nassert is_mtmd_model(model), f\"{model} is not curated\"\nsidecar.load(model)","handlingStrategy":"validation","validationCode":"from core.inference.stt_mtmd_sidecar import is_mtmd_model, resolve_mtmd_model_id\nif not is_mtmd_model(model):\n    reject_or_route_elsewhere(model)  # e.g. to the GGML whisper sidecar\nelse:\n    resolved = resolve_mtmd_model_id(model)","typeGuard":"from core.inference.stt_mtmd_sidecar import is_mtmd_model\n\ndef is_curated_mtmd_model(model: str | None) -> bool:\n    \"\"\"Type guard: True only for curated llama.cpp dictation model ids.\"\"\"\n    return is_mtmd_model(model)","tryCatchPattern":"try:\n    sidecar.load(model)\nexcept SttModelIdError as exc:\n    show_curated_model_list(exc)  # message already enumerates MTMD_STT_MODELS","preventionTips":["Restrict the Voice settings dropdown to MTMD_STT_MODELS entries.","Use is_mtmd_model() in routing to keep whisper ids away from the mtmd sidecar.","Never pass user-freeform repo strings to the mtmd path; custom repos are unsupported."],"tags":["stt","mtmd","llama-cpp","model-id","validation"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}