{"record":{"id":"8287408978aa810d","repo":"unslothai/unsloth","slug":"load-error-backend-load-progress","errorCode":null,"errorMessage":"load error: {backend.load_progress()}","messagePattern":"load error: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"warning","filePath":"scripts/perf_verify.py","lineNumber":80,"sourceCode":"    out.mkdir(parents = True, exist_ok = True)\n    backend = DiffusionBackend()\n    token = os.environ.get(\"HF_TOKEN\")\n\n    def load(mode_speed = None, mode_mem = None):\n        backend.begin_load(\n            args.model,\n            gguf_filename = args.gguf,\n            hf_token = token,\n            speed_mode = mode_speed,\n            memory_mode = mode_mem,\n        )\n        deadline = time.time() + 2400\n        while time.time() < deadline:\n            ph = backend.load_progress().get(\"phase\")\n            if ph == \"ready\":\n                return backend.status()\n            if ph == \"error\":\n                raise RuntimeError(f\"load error: {backend.load_progress()}\")\n            time.sleep(0.5)\n        raise RuntimeError(\"load timed out\")\n\n    def gen():\n        torch.cuda.synchronize()\n        t0 = time.time()\n        img = backend.generate(\n            prompt = args.prompt,\n            width = args.width,\n            height = args.height,\n            steps = args.steps,\n            guidance = 0.0,\n            seed = args.seed,\n            batch_size = 1,\n        )[\"images\"][0]\n        torch.cuda.synchronize()\n        return img, time.time() - t0\n","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/scripts/perf_verify.py#L62-L98","documentation":"Thrown by parseMaxOutputTokens (chat-providers-dialog.tsx:500-502) when the digit string parses to a number outside Number.isSafeInteger — i.e. beyond 2^53-1 (9007199254740991). The earlier regex already guarantees digits, so this is purely a magnitude guard against absurd token limits that would silently lose precision as floats.","triggerScenarios":"Entering a digit string longer than ~16 characters, e.g. '99999999999999999999' or a pasted model context length like '18446744073709551615'. Number(trimmed) exceeds MAX_SAFE_INTEGER and the guard fires.","commonSituations":"Copy-pasting huge numbers from model spec sheets (e.g. theoretical context windows); holding a digit key; misunderstanding the field as a context-length setting.","solutions":["Enter a realistic output-token cap (typically 1024–32768, any value < 9007199254740991).","Clear the field to use the provider default.","If you meant context length, set that in the model/context settings, not the provider Max Tokens field."],"exampleFix":"// before\n99999999999999999999\n\n// after\n32768","handlingStrategy":"validation","validationCode":"function isSafeIntegerToken(input: string): boolean {\n  const t = input.trim();\n  return t === '' || (/^\\d+$/.test(t) && Number.isSafeInteger(Number(t)));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cap the input's maxLength (e.g. 7-9 digits covers any sane token limit).","Clamp on blur rather than rejecting absurd values outright.","Guide users toward realistic values (1024-32768) with helper text."],"tags":["validation","form","numbers","providers","frontend"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}