{"record":{"id":"d4bce6c4a9a3e17f","repo":"unslothai/unsloth","slug":"download-stalled-for-model-name-even-with-hf-h","errorCode":null,"errorMessage":"Download stalled for '{model_name}' even with HF_HUB_DISABLE_XET=1 -- check your network connection","messagePattern":"Download stalled for '(.+?)' even with HF_HUB_DISABLE_XET=1 -- check your network connection","errorType":"exception","errorClass":"RuntimeError","httpStatus":500,"severity":"error","filePath":"studio/backend/core/inference/orchestrator.py","lineNumber":1417,"sourceCode":"                    self.active_model_name = None\n                    self.models.clear()\n                    return False\n\n                try:\n                    resp = self._wait_response(\"loaded\")\n                except DownloadStallError:\n                    # First stall with Xet on -> retry with Xet disabled\n                    if attempt == 0 and not disable_xet:\n                        logger.warning(\n                            \"Download stalled for '%s' -- retrying with HF_HUB_DISABLE_XET=1\",\n                            model_name,\n                        )\n                        self._shutdown_subprocess(timeout = 5)\n                        disable_xet = True\n                        continue\n                    # Second stall (or xet already off) -> give up\n                    self._shutdown_subprocess(timeout = 5)\n                    raise RuntimeError(\n                        f\"Download stalled for '{model_name}' even with \"\n                        f\"HF_HUB_DISABLE_XET=1 -- check your network connection\"\n                    )\n\n                if resp.get(\"success\"):\n                    # A cancel can land while we were parked in _wait_response above.\n                    # cancel_load (off the lifecycle gate) discards this model's loading\n                    # marker BEFORE its teardown, so a Stop-loading that fired after the\n                    # worker queued \"loaded\" (which we can still consume during cancel_load's\n                    # shutdown window) shows up here only as the marker's removal. Without\n                    # this recheck we would publish active_model_name/models for a model\n                    # /unload reported cancelled, over a subprocess cancel_load just killed;\n                    # its post-teardown re-clear cannot undo a publish that lands after it\n                    # returns. Observe the removal and abort; cancel_load owns teardown.\n                    if model_name not in self.loading_models:\n                        logger.info(\n                            \"Load for '%s' was cancelled while waiting for 'loaded'; \"\n                            \"not publishing the cancelled model\",","sourceCodeStart":1399,"sourceCodeEnd":1435,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/orchestrator.py#L1399-L1435","documentation":"Terminal failure of the model-download retry ladder: the worker reported a 'stall' response, the orchestrator already retried once with HF_HUB_DISABLE_XET=1 (or Xet was already disabled), and the second attempt stalled too. The subprocess is shut down and the load is abandoned; the message points at the network as the differentiator between the two failing transports.","triggerScenarios":"load_model for a model not in cache, where both the Xet-based and classic HTTP download paths stall past the stall-detection window — e.g. a proxy that blackholes large transfers, DNS/connectivity flakiness, or hub rate limiting.","commonSituations":"Corporate proxies or VPNs that time out hf-transfer/Xet chunks, unstable Wi-Fi, hub CDN issues, MTU/blackhole networking in containers, or extremely throttled links triggering the inactivity heuristic.","solutions":["Verify basic connectivity: curl -I https://huggingface.co and try downloading the repo with huggingface-cli.","If behind a proxy, set HTTPS_PROXY correctly and confirm it supports large streaming responses.","Pre-download the model outside the app (huggingface-cli download <model>) so the load hits warm cache.","Try a different network or disable VPN to rule out blackholed Xet/CDN endpoints.","Retry later if huggingface.co status shows CDN incidents."],"exampleFix":"# before\norchestrator.load_model(\"unsloth/llama-3-8b\")\n# after (warm the cache first)\n# huggingface-cli download unsloth/llama-3-8b\norchestrator.load_model(\"unsloth/llama-3-8b\")","handlingStrategy":"fallback","validationCode":"import urllib.request\nurllib.request.urlopen(\"https://huggingface.co\", timeout=5)  # fail fast before load","typeGuard":null,"tryCatchPattern":"try:\n    orchestrator.load_model(name)\nexcept RuntimeError as e:\n    if \"Download stalled\" in str(e):\n        subprocess.run([\"huggingface-cli\", \"download\", name])  # out-of-band fallback\n        orchestrator.load_model(name)","preventionTips":["Pre-download models via huggingface-cli on provisioned hosts.","Verify proxy/VPN handles large streaming transfers.","The orchestrator already retries with Xet disabled once; don't re-implement that, fix the network."],"tags":["network","download","huggingface","xet","inference"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}