janhq/jan · error

llamacpp extension not found

Error message

llamacpp extension not found

What it means

getLlamacppDevices looks up the '@janhq/llamacpp-extension' via the extension manager and throws if it is not registered, because GPU device queries require that extension. It guards against calling getDevices() on undefined.

Solutions

  1. Ensure the @janhq/llamacpp-extension is installed and enabled
  2. Wait for extension manager initialization before querying devices
  3. Reinstall the llamacpp extension if it failed to load
  4. Guard callers with extensionManager.getByName check first

Example fix

// before
const devices = await getLlamacppDevices()
// after
const ext = window.core.extensionManager?.getByName('@janhq/llamacpp-extension')
const devices = ext ? await getLlamacppDevices() : []
Defensive patterns

Strategy: type-guard

Validate before calling

const ext = window.core.extensionManager?.getByName('@janhq/llamacpp-extension')
const canQueryDevices = !!ext

Type guard

function hasLlamacpp(m: typeof window.core.extensionManager): boolean { return !!m?.getByName('@janhq/llamacpp-extension') }

Try / catch

try { const devices = await getLlamacppDevices() } catch { const devices = []; showExtensionWarning() }

Prevention

When it happens

Trigger: getLlamacppDevices called when the llamacpp extension is not installed, not yet loaded, or was disabled/removed.

Common situations: Hardware settings page opened before extensions finish loading, extension failed to install, or llamacpp extension uninstalled while hardware service still references it.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of janhq/jan@7205d770c1 (2026-09-17). Data as JSON: /api/errors/78d8cb0d32b7695e. Report an issue: GitHub.

Appendix: source

Thrown at web-app/src/services/hardware/tauri.ts:23

import { invoke } from '@tauri-apps/api/core'
import type { HardwareData, SystemUsage, DeviceList } from './types'
import { DefaultHardwareService } from './default'

export class TauriHardwareService extends DefaultHardwareService {
  async getHardwareInfo(): Promise<HardwareData | null> {
    return invoke('plugin:hardware|get_system_info') as Promise<HardwareData>
  }

  async getSystemUsage(): Promise<SystemUsage | null> {
    return invoke('plugin:hardware|get_system_usage') as Promise<SystemUsage>
  }

  async getLlamacppDevices(): Promise<DeviceList[]> {
    const extensionManager = window.core.extensionManager
    const llamacppExtension = extensionManager.getByName('@janhq/llamacpp-extension')

    if (!llamacppExtension) {
      throw new Error('llamacpp extension not found')
    }

    return llamacppExtension.getDevices()
  }

  async setActiveGpus(data: { gpus: number[] }): Promise<void> {
    // TODO: llama.cpp extension should handle this
    console.log(data)
  }

  async refreshHardwareInfo(): Promise<void> {
    await invoke('plugin:hardware|refresh_system_info')
  }
}

View on GitHub (pinned to 7205d770c1)