feat: Add missing ctx-shift toggle (#5765)

* feat: Add missing ctx_shift

* fix typo

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>

* refine description

---------

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
Akarshan Biswas 2025-07-14 11:51:34 +05:30 committed by GitHub
parent eaf4b1b954
commit 96ba42e411
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -71,6 +71,15 @@
"textAlign": "right"
}
},
{
"key": "context_shift",
"title": "Context Shift",
"description": "Allow model to cut text in the beginning to accommodate new text in its memory",
"controllerType": "checkbox",
"controllerProps":{
"value": false
}
},
{
"key": "n_predict",
"title": "Max Tokens to Predict",

View File

@ -57,6 +57,7 @@ type LlamacppConfig = {
rope_freq_base: number
rope_freq_scale: number
reasoning_budget: number
ctx_shift: boolean
}
interface DownloadItem {
@ -807,6 +808,8 @@ export default class llamacpp_extension extends AIEngine {
args.push('--main-gpu', String(cfg.main_gpu))
// Boolean flags
if (!cfg.ctx_shift)
args.push('--no-context-shift')
if (cfg.flash_attn) args.push('--flash-attn')
if (cfg.cont_batching) args.push('--cont-batching')
args.push('--no-mmap')