unslothai/unsloth · error · RuntimeError

requested {backend_request} but the installed backend is unk

Error message

requested {backend_request} but the installed backend is unknown

What it means

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.

Source

Thrown at studio/backend/utils/llama_cpp_update.py:682

        new_marker = read_install_marker(_find_binary())
        new_tag = (new_marker or {}).get("release_tag") or (new_marker or {}).get("tag")
        new_backend = marker_backend(new_marker)
        new_backend_request = marker_backend_request(new_marker)

        new_repo = (new_marker or {}).get("published_repo")
        if pin_release_tag and backend_request is not None:
            if new_repo != repo or new_tag != pin_release_tag:
                raise RuntimeError(
                    "backend switch must preserve "
                    f"{repo}@{pin_release_tag}, but installer produced "
                    f"{new_repo or 'an unknown repository'}@{new_tag or 'an unknown release'}"
                )
        elif pin_release_tag and new_tag and new_repo == repo and new_tag != pin_release_tag:
            raise RuntimeError(f"pinned release {pin_release_tag} but installer produced {new_tag}")

        if backend_request is not None:
            if new_backend is None:
                raise RuntimeError(
                    f"requested {backend_request} but the installed backend is unknown"
                )
            if new_backend_request != backend_request:
                raise RuntimeError(
                    f"requested {backend_request} but the installer recorded "
                    f"{new_backend_request or 'an unknown selection'}"
                )
            if backend_request != "auto" and new_backend != backend_request:
                raise RuntimeError(
                    f"requested {backend_request} but the installer produced "
                    f"{new_backend or 'an unknown backend'}"
                )

        logger.info("llama update: success", to_tag = new_tag, backend = new_backend)
        reload_hint = " Reload your model to use it." if model_was_active else ""
        return {
            "to_tag": new_tag,
            "backend": new_backend,

View on GitHub (pinned to 203007d190)

Solutions

  1. Re-run the update so a fresh marker is written
  2. If LLAMA_SERVER_PATH points at an externally managed binary, unset it or point it at the Studio-managed binary so markers apply
  3. Delete the stale/unparseable marker and binary so the next run reinstalls cleanly
  4. Check file permissions on the managed runtime directory so the marker can be read back

Example fix

# before
run_update(backend_request='vulkan')
# RuntimeError: requested vulkan but the installed backend is unknown

# after: remove foreign override, clean reinstall
os.environ.pop('LLAMA_SERVER_PATH', None)
clean_managed_runtime()
run_update(backend_request='vulkan')  # marker written, check passes
Defensive patterns

Strategy: try-catch

Validate before calling

from utils.llama_cpp_update import read_install_marker, _find_binary, marker_backend

def backend_known() -> bool:
    return marker_backend(read_install_marker(_find_binary())) is not None

Try / catch

try:
    run_update(backend_request=sel)
except RuntimeError as exc:
    if 'installed backend is unknown' in str(exc):
        clean_managed_runtime_and_retry(sel)

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/860a823a66356fca. Report an issue: GitHub.