{"record":{"id":"71afea70db679032","repo":"unslothai/unsloth","slug":"could-not-verify-stt-model-model-id-check-tha","errorCode":null,"errorMessage":"Could not verify STT model '{model_id}'. Check that the repository exists and your Hugging Face token can access it.","messagePattern":"Could not verify STT model '(.+?)'\\. Check that the repository exists and your Hugging Face token can access it\\.","errorType":"http","errorClass":"SttModelCompatibilityError","httpStatus":422,"severity":"error","filePath":"studio/backend/core/inference/stt_sidecar.py","lineNumber":578,"sourceCode":"    return tuple(_selected_file_from_sibling(siblings[name]) for name in sorted(selected))\n\n\ndef validate_remote_model(model: Optional[str], hf_token: Optional[str] = None) -> dict:\n    \"\"\"Verify a custom Hub repository is Whisper-compatible without downloading weights.\"\"\"\n    model_id = resolve_model_id(model)\n    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","sourceCodeStart":560,"sourceCodeEnd":596,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/stt_sidecar.py#L560-L596","documentation":"SttModelCompatibilityError raised when the HfApi.model_info() call for a custom (non-curated) model id fails for any reason — network error, unknown repository, private repo without/with a bad token, or the 10s timeout elapsing. The original exception is chained via `from exc` for diagnosis.","triggerScenarios":"Verifying a custom 'owner/model' id whose repo does not exist, is private and hf_token is None/invalid, the machine is offline, or huggingface_hub raising any exception during model_info(expand=['config','sha']).","commonSituations":"Typo'd owner or model name; gated/private Whisper repos needing a PAT the user never entered; corporate proxy blocking huggingface.co; flaky network during Settings > Voice model verification.","solutions":["Check the repository exists at huggingface.co/{owner}/{model} and the id is spelled exactly.","For private/gated repos, supply a valid Hugging Face token with read access.","Check connectivity to huggingface.co (proxy/firewall) and retry.","Inspect the chained exception (`raise ... from exc`) to see whether it was auth, DNS, or timeout."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"```python\nimport requests\nrequests.head(f\"https://huggingface.co/{repo}\", timeout=5, allow_redirects=True)  # 200/401/403 => repo exists\n```","typeGuard":null,"tryCatchPattern":"```python\ntry:\n    meta = verify_model(model_id, hf_token=token)\nexcept SttModelCompatibilityError as exc:\n    if \"Could not verify\" in str(exc):\n        check_network_and_token(exc.__cause__); retry_with_backoff()\n    raise\n```","preventionTips":["Prompt for a Hugging Face token before users add private/gated models.","Distinguish auth vs network from the chained exception before retrying.","Cache verification results so flaky networks do not re-hit the Hub per request."],"tags":["stt","huggingface","network","authentication","model-verification"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}