{"record":{"id":"f1dae23aa8e52aab","repo":"unslothai/unsloth","slug":"export-is-not-supported-on-this-platform","errorCode":null,"errorMessage":"Export is not supported on this platform.","messagePattern":"Export is not supported on this platform\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"studio/backend/routes/export.py","lineNumber":70,"sourceCode":"    Keeps the backend authoritative even if a client bypasses the UI gate. Read-only endpoints\n    (scan/status/logs) are intentionally NOT gated so the Export page can still render the reason.\n    Also refuses (409) while a latest-transformers install is swapping .venv_t5_latest: an\n    export worker spawned mid-swap could activate a half-replaced sidecar.\n    \"\"\"\n    from utils.transformers_latest import is_install_in_progress\n\n    if is_install_in_progress():\n        raise HTTPException(\n            status_code = 409,\n            detail = \"A transformers installation is in progress. Retry when it completes.\",\n        )\n\n    from utils.hardware import export_capability\n\n    # Off-loop: detection is deferred past bind, so the first call can wait on a cold import.\n    cap = await asyncio.to_thread(export_capability)\n    if not cap.get(\"export_supported\", True):\n        raise HTTPException(\n            status_code = 400,\n            detail = cap.get(\"export_unsupported_message\")\n            or \"Export is not supported on this platform.\",\n        )\n\n\n@router.post(\"/load-checkpoint\", response_model = ExportOperationResponse)\nasync def load_checkpoint(\n    request: LoadCheckpointRequest, current_subject: str = Depends(get_current_subject)\n):\n    \"\"\"Load a checkpoint into the export backend (ExportBackend.load_checkpoint).\n\n    Export runs in its own subprocess and is allowed to run in parallel with\n    training and inference. We deliberately do NOT stop training or unload the\n    chat model here -- if the GPU runs out of memory the load/export fails with\n    a clear error instead of tearing down the user's other running workloads.\n    \"\"\"\n    try:","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/routes/export.py#L52-L88","documentation":"HTTP 400 raised when utils.hardware.export_capability reports export_supported=False for this host. The capability probe (run off the event loop because a cold import can be slow) decides whether the platform/GPU/driver stack can run export at all; the message comes from export_unsupported_message or falls back to this generic string. Read-only endpoints are not gated so the UI can still show the reason.","triggerScenarios":"POST to any mutating export endpoint on a machine whose hardware probe fails — e.g. no CUDA device, an unsupported GPU/driver combo, or a missing export-only dependency detected by export_capability().","commonSituations":"Running the studio backend on a CPU-only box or in a container without GPU passthrough; driver/toolkit versions that the capability check rejects; a fresh environment where the export stack was never installed.","solutions":["Call GET /export/status or the capability probe first and read export_unsupported_message for the precise reason.","Fix the underlying hardware/software gap (install CUDA-capable drivers, enable GPU passthrough, or install the missing export toolchain).","If export is not needed on this host, disable the Export page / hide mutating controls based on the read-only status response."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const cap = await api.get('/export/capability'); // or read from /export/status\nif (!cap.export_supported) {\n  renderUnsupported(cap.export_unsupported_message);\n  return;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Query the read-only status/capability endpoint once on page load and gate the Export UI.","Do not assume export works on every host — probe hardware before scheduling exports."],"tags":["hardware","platform-support","export","http-400"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}