{"record":{"id":"3725d1637d13a7c6","repo":"unslothai/unsloth","slug":"model-load-did-not-reach-ready","errorCode":null,"errorMessage":"model load did not reach ready","messagePattern":"model load did not reach ready","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"warning","filePath":"scripts/diffusion_quality.py","lineNumber":189,"sourceCode":"    try:\n        import torch\n        if torch.cuda.is_available():\n            torch.cuda.reset_peak_memory_stats()\n            torch.cuda.synchronize()\n    except Exception:\n        pass\n\n\ndef _wait_for_load(backend: Any, timeout_s: int = 3600) -> None:\n    deadline = time.time() + timeout_s\n    while time.time() < deadline:\n        p = backend.load_progress()\n        if p.get(\"phase\") == \"ready\":\n            return\n        if p.get(\"phase\") == \"error\":\n            raise RuntimeError(f\"load error: {p.get('error')}\")\n        time.sleep(2)\n    raise TimeoutError(\"model load did not reach ready\")\n\n\ndef _hf_file_size_mib(repo: str, filename: str) -> Optional[int]:\n    # Local paths: stat directly, since the Hub lookup returns None and _recommend would drop them.\n    try:\n        local = Path(repo).expanduser()\n        if local.is_dir():\n            f = local / filename\n            if f.is_file():\n                return int(f.stat().st_size // (1024 * 1024))\n        elif local.is_file():\n            return int(local.stat().st_size // (1024 * 1024))\n    except Exception:\n        pass\n    try:\n        from huggingface_hub import HfApi\n        info = HfApi().model_info(repo, files_metadata = True, token = os.environ.get(\"HF_TOKEN\"))\n        for s in info.siblings:","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/scripts/diffusion_quality.py#L171-L207","documentation":"Thrown by parseOptionalBaseUrl (chat-providers-dialog.tsx:452-474) when the trimmed Base URL string cannot be parsed by the URL constructor — new URL(trimmed) threw. This is the studio's custom-provider dialog validating the endpoint field before saving a provider config; the URL constructor requires an absolute URL with scheme, so bare hostnames and relative paths fail.","triggerScenarios":"Entering a Base URL without a scheme, e.g. 'localhost:8080/v1' (URL parses port but fails without scheme — actually 'localhost:8080/v1' throws because the scheme is missing), 'api.openai.com/v1', or a string with stray characters/spaces. The catch around new URL() is the sole trigger.","commonSituations":"Users pasting endpoints without https://; trailing typos like 'https//api...' (missing colon); copying from docs that strip the scheme; entering 'v1/chat/completions' instead of a base URL.","solutions":["Prefix the URL with http:// or https://, e.g. 'https://api.openai.com/v1'.","Remove any stray leading/trailing spaces or invisible characters pasted from chat/docs.","For local servers use 'http://127.0.0.1:PORT/v1'.","Note the dialog auto-appends /v1 for OpenAI-compatible providers when the path is empty, so a bare origin like 'https://my-gateway' is fine."],"exampleFix":"// before (input value)\napi.mistral.ai/v1\n\n// after\nhttps://api.mistral.ai/v1","handlingStrategy":"validation","validationCode":"function isValidBaseUrl(input: string): boolean {\n  const trimmed = input.trim();\n  if (!trimmed) return true; // empty handled by the required check\n  try { new URL(trimmed); return true; } catch { return false; }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate as the user types (onBlur) and show the scheme hint 'https://…' as placeholder text.","Normalize on paste: if the trimmed value lacks '://', prepend 'https://'.","Remember the dialog appends /v1 for OpenAI-compatible providers when the path is empty — supply just the origin then."],"tags":["validation","url","providers","frontend","form"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}