Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

feat(llamacpp): add toggle for backend dependency verification

Akarshan6ea3798dde84
diff --git a/extensions/llamacpp-extension/settings.json b/extensions/llamacpp-extension/settings.json
index ad2c57cf3..eb5aa7349 100644
--- a/extensions/llamacpp-extension/settings.json
+++ b/extensions/llamacpp-extension/settings.json
@@ -29,6 +29,13 @@
"controllerType": "checkbox",
"controllerProps": { "value": true }
},
+ {
+ "key": "verify_backend_deps",
+ "title": "Verify backend dependencies",
+ "description": "Check that GPU backend shared libraries (CUDA, Vulkan, etc.) resolve on startup and warn if any are missing.",
+ "controllerType": "checkbox",
+ "controllerProps": { "value": true }
+ },
{
"key": "models_max",
"title": "Max Concurrently Loaded Models",
diff --git a/extensions/llamacpp-extension/src/index.ts b/extensions/llamacpp-extension/src/index.ts
index ebdaf4900..17c9fd8ef 100644
--- a/extensions/llamacpp-extension/src/index.ts
+++ b/extensions/llamacpp-extension/src/index.ts
@@ -981,7 +981,7 @@ export default class llamacpp_extension extends AIEngine {
// Run dependency verification once after the backend is confirmed
// installed. This covers both fresh downloads and pre-existing installs,
// and runs only once per app startup via the isConfiguringBackends guard.
- if (effectiveBackendString) {
+ if (effectiveBackendString && this.config.verify_backend_deps !== false) {
// effectiveBackendString is expected to be "<version>/<backend>" (e.g.
// "b4589/linux-cuda-12"). Any other shape silently skips verification.
const [version, backend] = effectiveBackendString.split('/')
diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/index.ts b/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/index.ts
index 610648c7a..83b62b872 100644
--- a/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/index.ts
+++ b/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/index.ts
@@ -45,6 +45,10 @@ export function normalizeLlamacppConfig(config: any): LlamacppConfig {
return {
version_backend: asString(config.version_backend),
auto_update_engine: asBool(config.auto_update_engine),
+ verify_backend_deps:
+ config.verify_backend_deps === undefined || config.verify_backend_deps === null
+ ? true
+ : asBool(config.verify_backend_deps),
auto_unload: asBool(config.auto_unload),
models_max:
typeof config.models_max === 'number'
diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/types.ts b/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/types.ts
index a23a33307..9fd0778cb 100644
--- a/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/types.ts
+++ b/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/types.ts
@@ -35,6 +35,7 @@ export interface GgufMetadata {
export type LlamacppConfig = {
version_backend: string
auto_update_engine: boolean
+ verify_backend_deps: boolean
auto_unload: boolean
models_max: string | number
timeout: number