{"record":{"id":"860a823a66356fca","repo":"unslothai/unsloth","slug":"requested-backend-request-but-the-installed-back","errorCode":null,"errorMessage":"requested {backend_request} but the installed backend is unknown","messagePattern":"requested (.+?) but the installed backend is unknown","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"studio/backend/utils/llama_cpp_update.py","lineNumber":682,"sourceCode":"        new_marker = read_install_marker(_find_binary())\n        new_tag = (new_marker or {}).get(\"release_tag\") or (new_marker or {}).get(\"tag\")\n        new_backend = marker_backend(new_marker)\n        new_backend_request = marker_backend_request(new_marker)\n\n        new_repo = (new_marker or {}).get(\"published_repo\")\n        if pin_release_tag and backend_request is not None:\n            if new_repo != repo or new_tag != pin_release_tag:\n                raise RuntimeError(\n                    \"backend switch must preserve \"\n                    f\"{repo}@{pin_release_tag}, but installer produced \"\n                    f\"{new_repo or 'an unknown repository'}@{new_tag or 'an unknown release'}\"\n                )\n        elif pin_release_tag and new_tag and new_repo == repo and new_tag != pin_release_tag:\n            raise RuntimeError(f\"pinned release {pin_release_tag} but installer produced {new_tag}\")\n\n        if backend_request is not None:\n            if new_backend is None:\n                raise RuntimeError(\n                    f\"requested {backend_request} but the installed backend is unknown\"\n                )\n            if new_backend_request != backend_request:\n                raise RuntimeError(\n                    f\"requested {backend_request} but the installer recorded \"\n                    f\"{new_backend_request or 'an unknown selection'}\"\n                )\n            if backend_request != \"auto\" and new_backend != backend_request:\n                raise RuntimeError(\n                    f\"requested {backend_request} but the installer produced \"\n                    f\"{new_backend or 'an unknown backend'}\"\n                )\n\n        logger.info(\"llama update: success\", to_tag = new_tag, backend = new_backend)\n        reload_hint = \" Reload your model to use it.\" if model_was_active else \"\"\n        return {\n            \"to_tag\": new_tag,\n            \"backend\": new_backend,","sourceCodeStart":664,"sourceCodeEnd":700,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/utils/llama_cpp_update.py#L664-L700","documentation":"After any install with a backend_request, the code reads marker_backend(new_marker) to learn which backend the installed binary actually serves; if that comes back None (marker missing, unreadable, or lacking backend fields) the request cannot be verified, so the update is treated as failed. This is deliberately strict: an unknown backend would silently serve the wrong GPU path.","triggerScenarios":"Calling the update flow with backend_request set (e.g. 'cuda' or 'vulkan') where read_install_marker(_find_binary()) returns None (binary or marker file deleted between install and read), a marker JSON without backend fields, or a marker from an older format that marker_backend cannot parse.","commonSituations":"Marker file lost during a crashed install or aggressive cleanup/antivirus; _find_binary() picking up a different (unmarked) llama-server via LLAMA_SERVER_PATH or PATH; version skew after upgrading Studio where old markers lack the backend key.","solutions":["Re-run the update so a fresh marker is written","If LLAMA_SERVER_PATH points at an externally managed binary, unset it or point it at the Studio-managed binary so markers apply","Delete the stale/unparseable marker and binary so the next run reinstalls cleanly","Check file permissions on the managed runtime directory so the marker can be read back"],"exampleFix":"# before\nrun_update(backend_request='vulkan')\n# RuntimeError: requested vulkan but the installed backend is unknown\n\n# after: remove foreign override, clean reinstall\nos.environ.pop('LLAMA_SERVER_PATH', None)\nclean_managed_runtime()\nrun_update(backend_request='vulkan')  # marker written, check passes","handlingStrategy":"try-catch","validationCode":"from utils.llama_cpp_update import read_install_marker, _find_binary, marker_backend\n\ndef backend_known() -> bool:\n    return marker_backend(read_install_marker(_find_binary())) is not None","typeGuard":null,"tryCatchPattern":"try:\n    run_update(backend_request=sel)\nexcept RuntimeError as exc:\n    if 'installed backend is unknown' in str(exc):\n        clean_managed_runtime_and_retry(sel)","preventionTips":["Do not delete or hand-edit install marker files","Unset LLAMA_SERVER_PATH when relying on the managed runtime so markers apply"],"tags":["llama-cpp","runtime-installer","install-marker","backend-verification"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}