{"record":{"id":"d31eaa0241884592","repo":"unslothai/unsloth","slug":"ai-assist-failed-scrubbed","errorCode":null,"errorMessage":"AI assist failed: {scrubbed}","messagePattern":"AI assist failed: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"studio/backend/hub/services/datasets/formatting.py","lineNumber":592,"sourceCode":"                warning = result.get(\"warning\"),\n            )\n\n        return AiAssistMappingResponse(\n            success = False,\n            warning = \"AI could not determine column roles. Please assign them manually.\",\n        )\n\n    except Exception as e:\n        scrubbed = download_registry.scrub_secrets(str(e), hf_token = hf_token)\n        status = hf_error_status(e)\n        if status is None and isinstance(e, FileNotFoundError):\n            status = 404\n        elif status is None and isinstance(e, ValueError):\n            status = 400\n        if status is not None:\n            raise HTTPException(status_code = status, detail = scrubbed)\n        logger.error(\"AI assist mapping failed: %s\", scrubbed)\n        raise HTTPException(\n            status_code = 500,\n            detail = \"AI assist failed: \" + scrubbed,\n        )\n","sourceCodeStart":574,"sourceCodeEnd":596,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/hub/services/datasets/formatting.py#L574-L596","documentation":"HTTP 500 from the AI-assist mapping advisor when its multi-pass LLM analysis raised an exception that fell through the mapped branches (hf_error_status, FileNotFoundError→404, ValueError→400). Like 807, the message is secret-scrubbed and both returned to the client and logged. The AI assist loads a 7B helper model, so failures are often model/runtime/resource related rather than dataset related.","triggerScenarios":"The helper model fails to download or load (network, disk), inference OOMs on a GPU-poor machine, the datasets-derived prompt triggers an unexpected library error, or the hub raises an unmapped error while fetching the dataset.","commonSituations":"First run of AI assist with no cached model and a slow/blocked model host; small VRAM boxes; proxies blocking the model download; concurrent assist runs exhausting memory.","solutions":["Check the logged `AI assist mapping failed: ...` line — it carries the scrubbed root cause.","Ensure the helper model is already cached locally (pre-download it) or that the model host is reachable from the backend.","Free GPU/CPU memory: close other training jobs before running AI assist.","If the underlying error is ValueError/FileNotFound from the dataset itself, fix the dataset reference first — those surface as 4xx and are actionable."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# Pre-flight: the same dataset ref must pass a cheap format check before the expensive AI pass\nfmt = check_dataset_format(client, req)  # if this 4xx/5xx, AI assist will fail too","typeGuard":null,"tryCatchPattern":"try:\n    resp = run_ai_assist(client, req)\nexcept HTTPStatusError as e:\n    if e.response.status_code >= 500:\n        disable_ai_assist_with_reason(e.response.json()[\"detail\"])  # model/env issue, not dataset\n    else:\n        fix_dataset_ref_and_retry(e)","preventionTips":["Pre-download the 7B helper model on first provisioning so AI assist never needs the network at run time.","Run AI assist without concurrent training jobs to avoid VRAM contention.","Validate the dataset loads (format check) before invoking the advisor."],"tags":["ai-assist","http-500","llm","model-loading","oom"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}