Add auto unload setting to llamacpp-extension
This commit is contained in:
parent
f70bb2705d
commit
0cbf35dc77
@ -9,6 +9,13 @@
|
|||||||
"options": []
|
"options": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"key": "auto_unload_models",
|
||||||
|
"title": "Auto-Unload Old Models",
|
||||||
|
"description": "Automatically unloads models that are not in use to free up memory. Ensure only one model is loaded at a time.",
|
||||||
|
"controllerType": "checkbox",
|
||||||
|
"controllerProps": { "value": true }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"key": "threads",
|
"key": "threads",
|
||||||
"title": "Threads",
|
"title": "Threads",
|
||||||
@ -145,7 +152,7 @@
|
|||||||
"description": "Enable continuous batching (a.k.a dynamic batching) for concurrent requests (default: enabled).",
|
"description": "Enable continuous batching (a.k.a dynamic batching) for concurrent requests (default: enabled).",
|
||||||
"controllerType": "checkbox",
|
"controllerType": "checkbox",
|
||||||
"controllerProps": {
|
"controllerProps": {
|
||||||
"value": true
|
"value": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -30,6 +30,7 @@ import { invoke } from '@tauri-apps/api/core'
|
|||||||
|
|
||||||
type LlamacppConfig = {
|
type LlamacppConfig = {
|
||||||
version_backend: string
|
version_backend: string
|
||||||
|
auto_unload: boolean
|
||||||
n_gpu_layers: number
|
n_gpu_layers: number
|
||||||
ctx_size: number
|
ctx_size: number
|
||||||
threads: number
|
threads: number
|
||||||
@ -106,6 +107,7 @@ interface EmbeddingData {
|
|||||||
|
|
||||||
export default class llamacpp_extension extends AIEngine {
|
export default class llamacpp_extension extends AIEngine {
|
||||||
provider: string = 'llamacpp'
|
provider: string = 'llamacpp'
|
||||||
|
autoUnload: boolean = true
|
||||||
readonly providerId: string = 'llamacpp'
|
readonly providerId: string = 'llamacpp'
|
||||||
|
|
||||||
private config: LlamacppConfig
|
private config: LlamacppConfig
|
||||||
@ -132,7 +134,7 @@ export default class llamacpp_extension extends AIEngine {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.autoUnload = await this.getSetting<boolean>('auto_unload_models', true)
|
||||||
this.registerSettings(settings)
|
this.registerSettings(settings)
|
||||||
|
|
||||||
let config = {}
|
let config = {}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user