{"record":{"id":"2e5bfe55dcceb6e9","repo":"janhq/jan","slug":"no-installed-backendtype-backend-found-insta","errorCode":null,"errorMessage":"No installed \"${backendType}\" backend found. Install that backend first, then add the CUDA runtime.","messagePattern":"No installed \"(.+?)\" backend found\\. Install that backend first, then add the CUDA runtime\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/llamacpp-extension/src/index.ts","lineNumber":2976,"sourceCode":"      (!path.endsWith('tar.gz') && !path.endsWith('zip'))\n    ) {\n      throw new Error(`Invalid path or file ${path}`)\n    }\n\n    const archiveName = await basename(path)\n    const match = /^cudart-llama-bin-(.+?)\\.(?:tar\\.gz|zip)$/.exec(archiveName)\n    if (!match || !match[1]) {\n      throw new Error(\n        `Not a CUDA runtime archive: ${archiveName}. Expected cudart-llama-bin-<backend>.(zip|tar.gz)`\n      )\n    }\n    const backendType = match[1]\n\n    const targets = (await getLocalInstalledBackends()).filter(\n      (b) => b.backend === backendType\n    )\n    if (targets.length === 0) {\n      throw new Error(\n        `No installed \"${backendType}\" backend found. Install that backend first, then add the CUDA runtime.`\n      )\n    }\n\n    let installed = 0\n    for (const t of targets) {\n      const binDir = await joinPath([\n        await getBackendDir(t.backend, t.version),\n        'build',\n        'bin',\n      ])\n      if (!(await fs.existsSync(binDir))) continue\n      await invoke('decompress', { path, outputDir: binDir })\n      installed++\n    }\n    if (installed === 0) {\n      throw new Error(\n        `Found ${backendType} backend(s) but none had a build/bin directory to install into.`","sourceCodeStart":2958,"sourceCodeEnd":2994,"githubUrl":"https://github.com/janhq/jan/blob/fad3f12a147d138388a66f0d92a02b2675f65294/extensions/llamacpp-extension/src/index.ts#L2958-L2994","documentation":"Thrown by installCudaRuntime after the archive name parsed successfully (backendType extracted from the filename) but getLocalInstalledBackends() filtered to that backendType returns zero entries. The CUDA runtime is supplementary - it only makes sense to install it on top of an already-installed backend of the same type, because it is decompressed directly into that backend's build/bin directory.","triggerScenarios":"Calling installCudaRuntime('cudart-llama-bin-vulkan.zip') when no vulkan backend is recorded as installed; backendType string from the filename has different casing/spelling than what getLocalInstalledBackends records (e.g. cuda-12 vs cuda12); user installed the CPU backend but is trying to apply a cuda runtime archive; backend was uninstalled between the download and this call.","commonSituations":"User follows the CUDA runtime step without first completing the backend install step in the setup wizard. Backend registry (getLocalInstalledBackends) is stale or the backend install failed silently. Version mismatch: the installed backend is recorded under a different identifier than the one encoded in the cudart archive name.","solutions":["Install the matching backend first (e.g. install the vulkan or cuda backend), then call installCudaRuntime again.","Verify the <backend> segment of the archive name matches an entry returned by getLocalInstalledBackends() exactly (case, spelling, hyphenation).","If the backend is installed but not detected, re-run backend provisioning / refresh the installed-backends list before retrying.","Double-check the archive corresponds to the backend variant you actually intend to accelerate (cuda vs vulkan vs cpu)."],"exampleFix":"// before\nawait ext.installCudaRuntime('/d/cudart-llama-bin-vulkan.zip') // throws: no vulkan backend\n// after\nawait ext.installBackend('vulkan', version) // ensure backend present first\nconst installed = await getLocalInstalledBackends()\nif (!installed.some(b => b.backend === 'vulkan')) throw new Error('vulkan still missing')\nawait ext.installCudaRuntime('/d/cudart-llama-bin-vulkan.zip')","handlingStrategy":"validation","validationCode":"// Verify a backend of the parsed type is installed before installing the runtime\nimport { basename } from 'path'\nconst m = /^cudart-llama-bin-(.+?)\\.(?:tar\\.gz|zip)$/.exec(basename(path))!\nconst installed = await getLocalInstalledBackends()\nif (!installed.some(b => b.backend === m[1])) {\n  throw new Error(`Install backend '${m[1]}' before applying its CUDA runtime`)\n}","typeGuard":"interface InstalledBackend { backend: string; version: string }\nfunction backendTypeOfArchive(name: string): string | null {\n  const m = /^cudart-llama-bin-(.+?)\\.(?:tar\\.gz|zip)$/.exec(name)\n  return m ? m[1] : null\n}","tryCatchPattern":"try { await ext.installCudaRuntime(path) }\ncatch (e) {\n  if (/No installed.+backend found/.test(String(e))) { await ext.installBackend(backendType, ver); await ext.installCudaRuntime(path) }\n  else throw e\n}","preventionTips":["Always install the backend in the same flow that installs its CUDA runtime.","Order setup steps: backend first, runtime second.","Surface the dependency in the UI so the runtime step is disabled until a backend exists."],"tags":["cuda","backend","ordering","dependency","validation"],"backgroundTag":null,"analyzedSha":"fad3f12a147d138388a66f0d92a02b2675f65294","analyzedAt":"2026-08-12T20:33:47.516Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}