{"record":{"id":"a75680e1e5e97826","repo":"unslothai/unsloth","slug":"stt-model-model-id-is-not-a-compatible-transfo","errorCode":null,"errorMessage":"STT model '{model_id}' is not a compatible Transformers Whisper model.","messagePattern":"STT model '(.+?)' is not a compatible Transformers Whisper model\\.","errorType":"http","errorClass":"SttModelCompatibilityError","httpStatus":422,"severity":"error","filePath":"studio/backend/core/inference/stt_sidecar.py","lineNumber":584,"sourceCode":"    repo = resolve_model_repo(model_id)\n    if model_id in STT_MODELS:\n        return {\"model\": model_id, \"repo\": repo}\n\n    try:\n        from huggingface_hub import HfApi\n        info = HfApi(token = hf_token or False).model_info(\n            repo,\n            expand = [\"config\", \"sha\"],\n            timeout = 10,\n        )\n    except Exception as exc:\n        raise SttModelCompatibilityError(\n            f\"Could not verify STT model '{model_id}'. \"\n            \"Check that the repository exists and your Hugging Face token can access it.\"\n        ) from exc\n\n    if not _is_whisper_config(getattr(info, \"config\", None)):\n        raise SttModelCompatibilityError(\n            f\"STT model '{model_id}' is not a compatible Transformers Whisper model.\"\n        )\n    revision = getattr(info, \"sha\", None)\n    if not isinstance(revision, str) or not _HF_COMMIT_SHA.fullmatch(revision):\n        raise SttModelCompatibilityError(\n            f\"Could not resolve an immutable revision for STT model '{model_id}'.\"\n        )\n    # The commit that was validated; the download pins to it so the repo cannot\n    # be swapped between validation and snapshot_download (TOCTOU).\n    return {\"model\": model_id, \"repo\": repo, \"revision\": revision}\n\n\ndef _is_missing_local_model_error(exc: BaseException) -> bool:\n    \"\"\"Recognize a local-cache-only miss by name/message, without importing HF\n    internals (tolerates huggingface_hub/Transformers moving the exception).\"\"\"\n    current: Optional[BaseException] = exc\n    seen: set[int] = set()\n    while current is not None and id(current) not in seen:","sourceCodeStart":566,"sourceCodeEnd":602,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/stt_sidecar.py#L566-L602","documentation":"SttModelCompatibilityError raised after a successful model_info() call when the repo's config does not look like a Transformers Whisper model (checked by _is_whisper_config on info.config — e.g. model_type/architectures not matching Whisper). The repo exists and is reachable; it is just the wrong kind of model.","triggerScenarios":"Pointing the STT backend at a non-Whisper Transformers repo (a text LLM, a vision model) or a Whisper variant whose config lacks the expected Whisper markers.","commonSituations":"Users pasting a chat-model repo like 'meta-llama/Llama-3-8B' into the voice settings; GGUF-only Whisper mirrors with no Transformers config; Whisper-derived architectures with renamed model_type.","solutions":["Choose a Transformers Whisper repository (config with Whisper model_type/architectures).","Prefer the curated ids in STT_MODELS, which skip verification entirely.","If you maintain the target repo, ensure its config.json carries standard Whisper fields."],"exampleFix":"```python\n# before\nverify_model(\"meta-llama/Meta-Llama-3-8B\")  # raises: not a Whisper model\n\n# after\nverify_model(\"openai/whisper-large-v3\")      # valid Transformers Whisper repo\n# or use a curated default:\nresolve_model_id(None)  # -> DEFAULT_STT_MODEL\n```","handlingStrategy":"validation","validationCode":"```python\nfrom huggingface_hub import HfApi\ninfo = HfApi(token=hf_token or False).model_info(repo, expand=[\"config\"])\nif not _is_whisper_config(getattr(info, \"config\", None)):\n    reject_model(\"Not a Transformers Whisper repository\")\n```","typeGuard":"```python\ndef is_whisper_repo(config: object) -> TypeGuard[dict]:\n    return _is_whisper_config(config)\n```","tryCatchPattern":"```python\ntry:\n    meta = verify_model(model_id)\nexcept SttModelCompatibilityError as exc:\n    if \"not a compatible Transformers Whisper\" in str(exc):\n        suggest_curated_models()  # user picked the wrong kind of repo\n    raise\n```","preventionTips":["Offer curated Whisper models by default.","Show model type in the picker so users see they selected a non-Whisper repo.","Verify once at configuration time, not at every dictation request."],"tags":["stt","model-compatibility","whisper","huggingface","validation"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}