increase ctx and gen amt defaults

This commit is contained in:
Concedo
2026-06-10 18:00:26 +08:00
parent afc8de2c6b
commit e8ead6efaa
2 changed files with 20 additions and 20 deletions
+13 -13
View File
@@ -12,7 +12,7 @@ Current version indicated by LITEVER below.
-->
<head>
<script id="init-config">
const LITEVER = 336;
const LITEVER = 337;
const urlParams = new URLSearchParams(window.location.search);
var localflag = urlParams.get('local'); //this will be replaced automatically in embedded kcpp
const STORAGE_PREFIX = (localflag?"e_":"")+"kaihordewebui_";
@@ -4518,8 +4518,8 @@ Current version indicated by LITEVER below.
second_ep_model:"gpt2",
second_ep_url:"",
max_context_length: (localflag?8192:4096),
max_length: (localflag?1024:512),
max_context_length: (localflag?16384:6144),
max_length: (localflag?2048:768),
last_maxctx: 0,
auto_ctxlen: true,
auto_genamt: true,
@@ -14200,17 +14200,17 @@ Current version indicated by LITEVER below.
document.getElementById("max_context_length_slide").max = ep_maxctx;
document.getElementById("max_context_length_slide_label").innerText = ep_maxctx;
}
if(ep_maxctx && ep_maxctx>=8192 && document.getElementById("max_length_slide").max<2048)
{
document.getElementById("max_length_slide").max = 2048;
document.getElementById("max_length_slide_label").innerText = 2048;
}
if(ep_maxctx && ep_maxctx>=16384 && document.getElementById("max_length_slide").max<4096)
{
document.getElementById("max_length_slide").max = 4096;
document.getElementById("max_length_slide_label").innerText = 4096;
}
if(localflag && ep_maxctx>=4096 && localsettings.max_context_length<ep_maxctx && (localsettings.last_maxctx!=ep_maxctx || localsettings.max_context_length==defaultsettings.max_context_length))
if(ep_maxctx && ep_maxctx>=32768 && document.getElementById("max_length_slide").max<8192)
{
document.getElementById("max_length_slide").max = 8192;
document.getElementById("max_length_slide_label").innerText = 8192;
}
if(localflag && ep_maxctx>=16384 && localsettings.max_context_length<ep_maxctx && (localsettings.last_maxctx!=ep_maxctx || localsettings.max_context_length==defaultsettings.max_context_length))
{
localsettings.max_context_length = ep_maxctx;
localsettings.last_maxctx = ep_maxctx;
@@ -30000,11 +30000,11 @@ Current version indicated by LITEVER below.
<input title="Context Size" inputmode="numeric" class="justifyright push-right" id="max_context_length" style="width: 8ch;" oninput="
document.getElementById('max_context_length_slide').value = this.value;">
</div>
<div><input title="Context Size Slider" type="range" min="512" max="8192" step="8" id="max_context_length_slide" oninput="
<div><input title="Context Size Slider" type="range" min="512" max="16384" step="8" id="max_context_length_slide" oninput="
document.getElementById('max_context_length').value = this.value;"></div>
<div class="settingminmax">
<div class="justifyleft">512</div>
<div class="justifyright" id="max_context_length_slide_label">8192</div>
<div class="justifyright" id="max_context_length_slide_label">16384</div>
</div>
<div id="auto_ctxlen_panel" class="settinglabel">
<div class="justifyleft" title="Automatically lowers settings if incompatible with existing workers">Auto-Adjust Limits </div>
@@ -30019,11 +30019,11 @@ Current version indicated by LITEVER below.
<input title="Max Output" inputmode="numeric" class="justifyright push-right" id="max_length" oninput="
document.getElementById('max_length_slide').value = this.value;">
</div>
<div><input title="Max Output Slider" type="range" min="16" max="1024" step="2" id="max_length_slide" oninput="
<div><input title="Max Output Slider" type="range" min="16" max="2048" step="2" id="max_length_slide" oninput="
document.getElementById('max_length').value = this.value;"></div>
<div class="settingminmax">
<div class="justifyleft">16</div>
<div class="justifyright" id="max_length_slide_label">1024</div>
<div class="justifyright" id="max_length_slide_label">2048</div>
</div>
<div id="auto_genamt_panel" class="settinglabel">
<div class="justifyleft" title="Automatically lowers settings if incompatible with existing workers">Auto-Adjust Limits </div>
+7 -7
View File
@@ -61,7 +61,7 @@ default_vae_tile_threshold = 640
default_sdvaedevice = 'main'
default_sdclipdevice = 'CPU'
default_native_ctx = 16384
default_genlen = 1024
default_genlen = 2048
overridekv_max = 16
default_autofit_padding = 1024
lora_filenames_max = 4
@@ -109,7 +109,7 @@ imglora_bypath = {} # len(imglora_bypath) == 0 <==> static loras
imglora_name2path = {}
imglora_cached = True
imglora_initial_fixed = True
maxctx = 8192
maxctx = 16384
maxhordectx = 0 #set to whatever maxctx is if 0
maxhordelen = 1024
modelbusy = threading.Lock()
@@ -8563,7 +8563,7 @@ def show_gui():
makecheckbox(quick_tab, name, properties[0], int(idx/2) + 20, idx % 2, tooltiptxt=properties[1])
# context size
makeslider(quick_tab, "Context Size:", contextsize_text, context_var, 40, width=280, set=9, tooltip="What is the maximum context size to support. Model specific. You cannot exceed it.\nLarger contexts require more memory, and not all models support it.")
makeslider(quick_tab, "Context Size:", contextsize_text, context_var, 40, width=280, set=17, tooltip="What is the maximum context size to support. Model specific. You cannot exceed it.\nLarger contexts require more memory, and not all models support it.")
# load model
makefileentry(quick_tab, "GGUF Text Model:", "Select GGUF or GGML Model File", model_var, 50, 280, onchoosefile=on_picked_model_file,tooltiptxt="Select a GGUF or GGML model file on disk to be loaded.")
@@ -8640,7 +8640,7 @@ def show_gui():
makelabelentry(context_tab, "CacheSlots:", smartcacheslots_var, row=5, padx=(300), singleline=True, tooltip="Number of slots for smartcache",labelpadx=(220))
# context size
makeslider(context_tab, "Context Size:",contextsize_text, context_var, 18, width=280, set=9,tooltip="What is the maximum context size to support. Model specific. You cannot exceed it.\nLarger contexts require more memory, and not all models support it.")
makeslider(context_tab, "Context Size:",contextsize_text, context_var, 18, width=280, set=17,tooltip="What is the maximum context size to support. Model specific. You cannot exceed it.\nLarger contexts require more memory, and not all models support it.")
context_var.trace_add("write", changed_gpulayers_estimate)
makelabelentry(context_tab, "Default Gen Amt:", defaultgenamt_var, row=20, padx=(120), singleline=True, tooltip="How many tokens to generate by default, if not specified. Must be smaller than context size. Usually, your frontend GUI will override this.")
makelabelentry(context_tab, "Prompt Limit:", genlimit_var, row=20, padx=(300), singleline=True, tooltip="If set, restricts max output tokens to this limit regardless of API request. Set to 0 to disable.",labelpadx=(210))
@@ -11306,7 +11306,7 @@ def kcpp_main_process(launch_args, g_memory=None, gui_launcher=False):
global maxctx
maxctx = args.contextsize
args.defaultgenamt = max(64, min(args.defaultgenamt, 8192))
args.defaultgenamt = max(64, min(args.defaultgenamt, 16384))
args.defaultgenamt = min(args.defaultgenamt, maxctx / 2)
#this uses the true port instead of the displayport, because we dont want to shut down a router
@@ -12012,7 +12012,7 @@ if __name__ == '__main__':
modelgroup.add_argument("--model","-m", metavar=('[filenames]'), help="Model file to load. Accepts multiple values if they are URLs.", type=str, nargs='+', default=[])
modelgroup.add_argument("model_param", help="Model file to load (positional)", nargs="?")
parser.add_argument("--config", metavar=('[filename]'), help="Load settings from a .kcpps file. Other arguments will be ignored", type=str, nargs=1)
parser.add_argument("--contextsize","--ctx-size", "-c", help="Controls the memory allocated for maximum context size, only change if you need more RAM for big contexts. (default 8192).",metavar=('[256 to 262144]'), type=check_range(int,256,262144), default=8192)
parser.add_argument("--contextsize","--ctx-size", "-c", help="Controls the memory allocated for maximum context size, only change if you need more RAM for big contexts. (default 16384).",metavar=('[256 to 262144]'), type=check_range(int,256,262144), default=16384)
parser.add_argument("--gpulayers","--gpu-layers","--n-gpu-layers","-ngl", help="Set number of layers to offload to GPU (when using GPU). Set to -1 to enable autofit (default), set to 0 to disable GPU offload.",metavar=('[GPU layers]'), nargs='?', const=1, type=int, default=-1)
parser.add_argument("--host", metavar=('[ipaddr]'), help="Host IP to listen on. If this flag is not set, all routable interfaces are accepted.", default="")
parser.add_argument("--launch", help="Launches a web browser when load is completed.", action='store_true')
@@ -12034,7 +12034,7 @@ if __name__ == '__main__':
advparser.add_argument("--chatcompletionsadapter", metavar=('[filename]'), help="Select an optional ChatCompletions Adapter JSON file to force custom instruct tags.", default="AutoGuess")
advparser.add_argument("--cli", help="Does not launch KoboldCpp HTTP server. Instead, enables KoboldCpp from the command line, accepting interactive console input and displaying responses to the terminal.", action='store_true')
advparser.add_argument("--debugmode", help="Shows additional debug info in the terminal. Levels: -1 (Horde-quiet, suppresses non-essential prints; auto-applied when Horde args are set), 0 (default, normal output), 1 (verbose: extra slot/cache info, larger print buffers, retains horde-debug prefix). Passing the flag without a value implies 1.", nargs='?', const=1, type=int, default=0)
advparser.add_argument("--defaultgenamt", help="How many tokens to generate by default, if not specified. Must be smaller than context size. Usually, your frontend GUI will override this.", type=check_range(int,64,8192), default=default_genlen)
advparser.add_argument("--defaultgenamt", help="How many tokens to generate by default, if not specified. Must be smaller than context size. Usually, your frontend GUI will override this.", type=check_range(int,64,16384), default=default_genlen)
advparser.add_argument("--device", "-dev", metavar=('<dev1,dev2,..>'), help="Set llama.cpp compatible device selection override. Comma separated. Overrides normal device choices.", default="")
advparser.add_argument("--downloaddir", metavar=('[directory]'), help="Specify a directory that models will be downloaded to or searched from, if unset uses the working directory.", default="")
advparser.add_argument("--draftamount","--draft-max","--draft-n", metavar=('[tokens]'), help="How many tokens to draft per chunk before verifying results", type=int, default=default_draft_amount)