Merge branch 'upstream' into concedo_experimental

# Conflicts:
#	common/common.cpp
#	examples/batched-bench/batched-bench.cpp
#	examples/batched/batched.cpp
#	examples/export-lora/export-lora.cpp
#	examples/gritlm/gritlm.cpp
#	examples/parallel/parallel.cpp
#	examples/passkey/passkey.cpp
#	examples/speculative-simple/speculative-simple.cpp
#	examples/speculative/speculative.cpp
#	ggml/src/ggml-cann/CMakeLists.txt
#	ggml/src/ggml-cann/acl_tensor.cpp
#	ggml/src/ggml-cann/acl_tensor.h
#	ggml/src/ggml-cann/aclnn_ops.cpp
#	ggml/src/ggml-cann/aclnn_ops.h
#	ggml/src/ggml-vulkan/CMakeLists.txt
#	tests/test-arg-parser.cpp
#	tests/test-backend-ops.cpp
This commit is contained in:
Concedo
2025-04-03 18:57:49 +08:00
43 changed files with 1509 additions and 1129 deletions
+64 -43
View File
@@ -3815,7 +3815,7 @@ Current version indicated by LITEVER below.
document.getElementById("lastreq1").innerHTML =
document.getElementById("lastreq2").innerHTML =
document.getElementById("lastreq3").innerHTML =
`<a href="#" class="color_grayurl" onclick="msgbox('Source code is available at https://github.com/LostRuins/lite.koboldai.net \\nPlease report any bugs you find there.','Information')">KoboldAI Lite</a> v${LITEVER} Web - Frontend for <a href="#" class="color_grayurl" onclick="msgbox('KoboldAI Lite allows you to connect to various third-party AI services. We do not control or assume responsibility for the models or content generated by these services. The user is responsible for ensuring that their usage of this software is legal in their country, and complies with the terms of service of the service they are connected to. Use at your own discretion.','Disclaimer')">External API Services</a>`;
`<a href="#" class="color_grayurl mainnav" title="KoboldAI Lite Information" onclick="msgbox('Source code is available at https://github.com/LostRuins/lite.koboldai.net \\nPlease report any bugs you find there.','Information')">KoboldAI Lite</a> v${LITEVER} Web - Frontend for <a href="#" class="color_grayurl mainnav" title="KoboldAI Lite Disclaimer" onclick="msgbox('KoboldAI Lite allows you to connect to various third-party AI services. We do not control or assume responsibility for the models or content generated by these services. The user is responsible for ensuring that their usage of this software is legal in their country, and complies with the terms of service of the service they are connected to. Use at your own discretion.','Disclaimer')">External API Services</a>`;
trigger_abort_controller(); //first trigger sets it up
@@ -14987,14 +14987,26 @@ Current version indicated by LITEVER below.
}
urlbase = default_gemini_base + mdlname + default_gemini_suffix;
let geminiparts = [];
if (insertAIVisionImages.length > 0) {
for (let i = 0; i < insertAIVisionImages.length; ++i) {
let oaiimg = {
"inline_data": {
"mime_type": "image/jpeg",
"data": insertAIVisionImages[i]
}
};
geminiparts.push(oaiimg);
}
}
geminiparts.push({"text": submit_payload.prompt});
let payload = {
"contents": [
{
"parts": [
{
"text": submit_payload.prompt
}
]
"parts": geminiparts
}
],
"safetySettings": [
@@ -15028,6 +15040,12 @@ Current version indicated by LITEVER below.
"stopSequences": []
}
};
if(document.getElementById("usegeminiweb").checked)
{
payload["tools"] = [{"google_search": {}}];
}
let sentrole = document.getElementById("geminiroledropdown").value;
if(sentrole!="")
{
@@ -15675,7 +15693,8 @@ Current version indicated by LITEVER below.
if(savedmeta.visionmode==4)
{
let isoai = (custom_oai_key!="" && document.getElementById("useoaichatcompl").checked);
visionstatus = isoai?`<span class="color_green">OpenAI API (Conditional)</span>`:`<span class="color_yellow">Unsupported</span>`;
let isgemini = (custom_gemini_key!="");
visionstatus = (isoai?`<span class="color_green">OpenAI API (Conditional)</span>`:(isgemini?`<span class="color_green">Gemini API (Conditional)</span>`:`<span class="color_yellow">Unsupported</span>`));
}
else if(savedmeta.visionmode==3)
{
@@ -22469,17 +22488,17 @@ Current version indicated by LITEVER below.
<span style="float:right;">
<a href="#" class="color_green" onclick="get_and_show_workers()">[See Current Volunteers] </a>
</span>
<select class="form-control" id="pickedmodel" size="7" multiple></select>
<select title="AI Horde Target Selection" class="form-control" id="pickedmodel" size="7" multiple></select>
</div>
<div class="menutext" style="text-align: left;">
Select By Worker <span class="helpicon">?
<span class="helptext">This option explicitly assigns worker IDs, fixed based on the current workers available at model selection time.</span>
</span>
<input type="checkbox" id="manualworker" onclick="toggle_manual_horde_worker()">
<input title="Select by Worker" type="checkbox" id="manualworker" onclick="toggle_manual_horde_worker()">
<span style="float:right;">
<input class="settinglabel miniinput" style="margin: 3px; width: 90px;" type="text" placeholder="Quick Search" value="" id="modelquicksearch" oninput="model_quick_search()">
<input title="Quick Search" class="settinglabel miniinput" style="margin: 3px; width: 90px;" type="text" placeholder="Quick Search" value="" id="modelquicksearch" oninput="model_quick_search()">
</span>
</div>
@@ -22489,8 +22508,8 @@ Current version indicated by LITEVER below.
You can use this to connect to a KoboldAI instance running via a remote tunnel such as <span class="color_orange" style="font-weight: bold;">trycloudflare, localtunnel, ngrok</span>.<br><br>
Localhost IPs require host mode enabled. You can use the remote address displayed in the <span class="color_orange" style="font-weight: bold;">terminal console</span> or <span class="color_orange" style="font-weight: bold;">colab window</span>, note that the model must be loaded first.<br><br>
<span class="color_green" style="font-weight: bold;">Please input URL of the KoboldAI instance.</span><br><br>
<input class="form-control" id="customkoboldendpoint" placeholder="https://sample-remote-address.trycloudflare.com" value="">
<input class="form-control" type="password" id="customkoboldkey" placeholder="KoboldAI API Key (Optional)" value="" onfocus="focus_api_keys()" onblur="blur_api_keys()"><br>
<input class="form-control" title="Enter KoboldCpp Custom Endpoint" id="customkoboldendpoint" placeholder="https://sample-remote-address.trycloudflare.com" value="">
<input class="form-control" title="Enter KoboldCpp API Key" type="password" id="customkoboldkey" placeholder="KoboldAI API Key (Optional)" value="" onfocus="focus_api_keys()" onblur="blur_api_keys()"><br>
<div class="borderbox flex flex-push-right">
<input type="checkbox" id="remoteconsolelog">
<div class="box-label" title="Will display outputs to the remote endpoint's console logs, useful for debugging.">Show Console Logging</div>
@@ -22526,7 +22545,7 @@ Current version indicated by LITEVER below.
<input class="form-control" type="text" id="custom_oai_endpoint" placeholder="OpenAI API URL" value="" onblur="try_fetch_oai_models_auto()">
<input class="form-control" type="password" id="custom_oai_key" placeholder="API Key (Required)" value="" onfocus="focus_api_keys()" onblur="blur_api_keys()"><br>
Model Choice:<br>
<select style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control" id="custom_oai_model" onchange="oai_model_change(true)">
<select title="OpenAI Model Selection" style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control" id="custom_oai_model" onchange="oai_model_change(true)">
<option value="gpt-3.5-turbo-instruct" selected="selected">gpt-3.5-turbo-instruct</option>
<option value="davinci-002">davinci-002</option>
<option value="gpt-3.5-turbo">gpt-3.5-turbo</option>
@@ -22539,7 +22558,7 @@ Current version indicated by LITEVER below.
<option value="o1-preview">o1-preview</option>
<option style="display:none;" class="custom_model_option" value="custom">[Custom]</option>
</select>
<select style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_openrouter_model" onchange="oai_model_change(true)">
<select title="OpenRouter AI Model Selection" style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_openrouter_model" onchange="oai_model_change(true)">
<option value="openai/gpt-3.5-turbo">openai/gpt-3.5-turbo</option>
<option value="openai/gpt-4">openai/gpt-4</option>
<option value="openai/gpt-3.5-turbo-instruct">openai/gpt-3.5-turbo-instruct</option>
@@ -22549,7 +22568,7 @@ Current version indicated by LITEVER below.
<option value="anthropic/claude-2.0">anthropic/claude-2.0</option>
<option style="display:none;" class="custom_model_option" value="custom">[Custom]</option>
</select>
<select style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_mistralai_model" onchange="oai_model_change(true)">
<select title="Mistral AI Model Selection" style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_mistralai_model" onchange="oai_model_change(true)">
<option value="open-mistral-7b">open-mistral-7b</option>
<option value="open-mistral-nemo">open-mistral-nemo</option>
<option value="open-mixtral-8x22b">open-mixtral-8x22b</option>
@@ -22562,7 +22581,7 @@ Current version indicated by LITEVER below.
<option value="codestral-latest">codestral-latest</option>
<option style="display:none;" class="custom_model_option" value="custom">[Custom]</option>
</select>
<select style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_featherless_model" onchange="oai_model_change(true)">
<select title="Featherless AI Model Selection" style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_featherless_model" onchange="oai_model_change(true)">
<option value="Sao10K/L3-8B-Lunaris-v1">Sao10K/L3-8B-Lunaris-v1</option>
<option value="Sao10K/L3-8B-Stheno-v3.2">Sao10K/L3-8B-Stheno-v3.2</option>
<option value="unsloth/llama-3-8b-Instruct">unsloth/llama-3-8b-Instruct</option>
@@ -22576,7 +22595,7 @@ Current version indicated by LITEVER below.
<option value="meta-llama/Meta-Llama-3.1-405B-Instruct">meta-llama/Meta-Llama-3.1-405B-Instruct</option>
<option style="display:none;" class="custom_model_option" value="custom">[Custom]</option>
</select>
<select style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_grok_model" onchange="oai_model_change(true)">
<select title="Grok AI Model Selection" style="padding:4px;display:inline;width:calc(100% - 220px)" class="form-control hidden" id="custom_grok_model" onchange="oai_model_change(true)">
<option value="grok-beta">grok-beta</option>
<option style="display:none;" class="custom_model_option" value="custom">[Custom]</option>
</select>
@@ -22599,38 +22618,38 @@ Current version indicated by LITEVER below.
<span id="useoaichatcomplbox" class="hidden" onload="toggleoaichatcompl();">
<br>
Main Message Role:
<select class="form-control" style="height: 25px; font-size:12px; padding:4px;display:inline;width:100px" id="oairoledropdown">
<select title="Main Message Role" class="form-control" style="height: 25px; font-size:12px; padding:4px;display:inline;width:100px" id="oairoledropdown">
<option value="0" selected>User</option>
<option value="1">Assistant</option>
<option value="2">System</option>
<option value="3">AutoRole</option>
</select>
<input type="checkbox" id="jailbreakprompt" onchange="togglejailbreak()">
<div class="box-label" title="Adds extra text at the start to improve AI response">Add Prefix</div>
<input type="checkbox" id="jailbreakprompt2" onchange="togglejailbreak2()">
<div class="box-label" title="Adds extra text to the end to improve AI response">Add Postfix</div>
<input type="checkbox" title="Add Prefix Prompt" id="jailbreakprompt" onchange="togglejailbreak()">
<div class="box-label" title="Add Prefix. Forcefully inserts extra text at the start of the prompt to steer the AI.">Add Prefix</div>
<input type="checkbox" title="Add Postfix Prompt" id="jailbreakprompt2" onchange="togglejailbreak2()">
<div class="box-label" title="Add Postfix. Forcefully inserts extra text to before the AI response to steer the AI.">Add Postfix</div>
<div style="display:flex" id="oaijailbreakpromptblock1">
<select class="form-control" style="height: 25px; font-size:12px; padding:4px;display:inline;width:100px" id="jailbreakprompttextrole">
<select title="Injected Prefix Message Role" class="form-control" style="height: 25px; font-size:12px; padding:4px;display:inline;width:100px" id="jailbreakprompttextrole">
<option value="0">User</option>
<option value="1">Assistant</option>
<option value="2" selected>System</option>
</select>
<textarea class="form-control" rows="3" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%" type="text" id="jailbreakprompttext" placeholder="(Enter System Prefix)"
<textarea title="Enter Prefix Prompt String" class="form-control" rows="3" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%" type="text" id="jailbreakprompttext" placeholder="(Enter System Prefix)"
value="" onload="togglejailbreak();"></textarea>
</div>
<div style="display:flex" id="oaijailbreakpromptblock2">
<select class="form-control" style="height: 25px; font-size:12px; padding:4px;display:inline;width:100px" id="jailbreakprompttext2role">
<select title="Injected Postfix Message Role" class="form-control" style="height: 25px; font-size:12px; padding:4px;display:inline;width:100px" id="jailbreakprompttext2role">
<option value="0">User</option>
<option value="1" selected>Assistant</option>
<option value="2">System</option>
</select>
<textarea class="form-control" rows="3" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%;" type="text" id="jailbreakprompttext2" placeholder="(Enter Assistant Postfix)"
<textarea title="Enter Postfix Prompt String" class="form-control" rows="3" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%;" type="text" id="jailbreakprompttext2" placeholder="(Enter Assistant Postfix)"
value="" onload="togglejailbreak2();"></textarea>
</div>
</span>
<span id="openrouterproviderbox" class="hidden"><br>Preferred Provider: <input style="height: 25px; font-size:12px;padding:4px;display:inline;width:calc(100% - 140px)" class="form-control" type="text" id="openrouterproviders" placeholder="(Automatic)" value="">
<span id="openrouterproviderbox" class="hidden"><br>Preferred Provider: <input title="Enter Preferred AI Provider" style="height: 25px; font-size:12px;padding:4px;display:inline;width:calc(100% - 140px)" class="form-control" type="text" id="openrouterproviders" placeholder="(Automatic)" value="">
<div style="display:inline;width:210px;">
</div>
</span>
@@ -22643,7 +22662,7 @@ Current version indicated by LITEVER below.
<input class="form-control" type="text" id="custom_claude_endpoint" placeholder="Claude API URL" value="">
<input class="form-control" type="password" id="custom_claude_key" placeholder="Claude API Key (Required)" value="" onfocus="focus_api_keys()" onblur="blur_api_keys()"><br>
Model Choice:<br>
<select style="padding:4px; width:calc(100% - 110px); display:inline-block" class="form-control" id="custom_claude_model" onload="toggleclaudemodel()" onchange="toggleclaudemodel()">
<select title="Claude AI Model Selection" style="padding:4px; width:calc(100% - 110px); display:inline-block" class="form-control" id="custom_claude_model" onload="toggleclaudemodel()" onchange="toggleclaudemodel()">
<option value="claude-v1">claude-v1</option>
<option value="claude-v1-100k">claude-v1-100k</option>
<option value="claude-instant-v1">claude-instant-v1</option>
@@ -22661,21 +22680,21 @@ Current version indicated by LITEVER below.
<option value="claude-3-7-sonnet-20250219">claude-3-7-sonnet-20250219</option>
</select>
<button type="button" class="btn btn-primary" style="display:inline;width:105px;" id="claudefetchlist" onclick="claude_fetch_models()">Fetch List</button>
<input type="checkbox" id="claudeaddversion" onchange="" checked>
<input type="checkbox" title="Add endpoint version" id="claudeaddversion" onchange="" checked>
<div class="box-label" title="Add endpoint version">Add Endpoint Version</div>
<span id="clauderenamecompatdiv">
<input type="checkbox" id="clauderenamecompat" onchange="" checked>
<input type="checkbox" title="Claude Compatibility Rename Fix" id="clauderenamecompat" onchange="" checked>
<div class="box-label" title="Rename User and Bot tags to work with claude, force inject them otherwise">Claude Compatibility Rename Fix</div>
</span>
<textarea class="form-control hidden" rows="2" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%" type="text" id="claudesystemprompt" placeholder="(Enter System Prompt)"
<textarea class="form-control hidden" title="Claude System Prompt" rows="2" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%" type="text" id="claudesystemprompt" placeholder="(Enter System Prompt, which steers overall AI behavior.)"
value="" onload=""></textarea>
<textarea class="form-control hidden" rows="2" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%" type="text" id="claudejailbreakprompt" placeholder="(Enter Assistant Postfix)"
<textarea class="form-control hidden" title="Claude Assistant Postfix" rows="2" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%" type="text" id="claudejailbreakprompt" placeholder="(Enter Assistant Postfix, which forces the AI to start responses with this text.)"
value="" onload=""></textarea>
<div id="claudethinkingbox" class="hidden">
<div class="box-label" title="Enable Thinking">Enable Thinking </div>
<input type="checkbox" style="display:inline;" id="claudethinking">
<input type="checkbox" title="Enable Thinking" style="display:inline;" id="claudethinking">
</div>
</div>
@@ -22683,7 +22702,7 @@ Current version indicated by LITEVER below.
Uses Gemini by Google.<br><br>
Note that KoboldAI Lite takes no responsibility for your usage or consequences of this feature. Your API key is used directly with the Gemini API and is not transmitted to us.<br><br>
<div>
<select style="padding:4px; width:calc(100% - 110px); display:inline-block" class="form-control" id="custom_gemini_model" onchange="togglegeminimodel()">
<select title="Gemini AI Model Selection" style="padding:4px; width:calc(100% - 110px); display:inline-block" class="form-control" id="custom_gemini_model" onchange="togglegeminimodel()">
<option value="gemini-1.5-flash-latest" selected="selected">gemini-1.5-flash-latest</option>
<option value="gemini-1.5-pro-001">gemini-1.5-pro-001</option>
<option value="gemini-1.5-pro-002">gemini-1.5-pro-002</option>
@@ -22700,28 +22719,30 @@ Current version indicated by LITEVER below.
<div id="gemini_role_options">
<div>
Main Message Role:
<select class="form-control" style="height: 25px; font-size:12px; padding:4px;display:inline;width:100px" onload="togglegeminirole();" onchange="togglegeminirole();" id="geminiroledropdown">
<select title="Main Message Role" class="form-control" style="height: 25px; font-size:12px; padding:4px;display:inline;width:100px" onload="togglegeminirole();" onchange="togglegeminirole();" id="geminiroledropdown">
<option value="" selected>Default</option>
<option value="user">User</option>
<option value="model">Model</option>
</select>
</div>
<div id="gemini_role_options2" style="display:flex">
<select class="form-control" style="height: 25px; font-size:12px; padding:4px;display:inline;width:100px" id="gemini_postfix_role">
<select title="Postfix Message Role" class="form-control" style="height: 25px; font-size:12px; padding:4px;display:inline;width:100px" id="gemini_postfix_role">
<option value="user">User</option>
<option value="model" selected>Model</option>
</select>
<textarea class="form-control" rows="3" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%;" type="text" id="gemini_postfix_text" placeholder="(Enter Gemini Postfix)"
<textarea title="Gemini Postfix Prompt" class="form-control" rows="3" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%;" type="text" id="gemini_postfix_text" placeholder="(Enter Gemini Postfix)"
value=""></textarea>
</div>
</div>
<textarea class="form-control" rows="3" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%" type="text" id="gemini_system_instruction" placeholder="(Enter System Instruction)"
<textarea title="Gemini System Prompt" class="form-control" rows="3" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%" type="text" id="gemini_system_instruction" placeholder="(Enter System Instruction)"
value=""></textarea><br>
<input type="checkbox" title="Use Gemini WebSearch" id="usegeminiweb">
<div class="box-label">Use WebSearch</div><br>
</div>
<div id="coherecustom" class="menutext hidden">
Uses Cohere's models through their own API.<br><br>
Note that KoboldAI Lite takes no responsibility for your usage or consequences of this feature. Your API key is used directly with the Cohere API and is not transmitted to us.<br><br>
<select style="padding:4px;" class="form-control" id="custom_cohere_model">
<select title="Cohere AI Model Selection" style="padding:4px;" class="form-control" id="custom_cohere_model">
<option value="command" selected="selected">command</option>
<option value="command-r">command-r</option>
<option value="command-r-plus">command-r-plus</option>
@@ -22732,10 +22753,10 @@ Current version indicated by LITEVER below.
</select>
<span class="color_green" style="font-weight: bold;">Please input Cohere API Key.</span><br><br>
<input class="form-control" type="password" id="custom_cohere_key" placeholder="Cohere API Key (Required)" value="" onfocus="focus_api_keys()" onblur="blur_api_keys()"><br>
<input type="checkbox" id="usecohereweb">
<div class="box-label" id="usecohereweblabel">Use WebSearch</div>
<input type="checkbox" id="useocoherepreamble" onchange="togglecoherepreamble()">
<div class="box-label" id="useocoherepreamblelabel">Use Preamble</div>
<input type="checkbox" title="Use Cohere WebSearch" id="usecohereweb">
<div class="box-label">Use WebSearch</div>
<input type="checkbox" title="Use Cohere Preamble" id="useocoherepreamble" onchange="togglecoherepreamble()">
<div class="box-label">Use Preamble</div>
<span id="useocoherepreamblebox" class="hidden" onload="togglecoherepreamble();">
<textarea class="form-control" id="cohere_preamble" rows="3" style="resize: vertical; line-height:1.1; padding:4px; display:inline; width: 100%" type="text" placeholder="(Enter Preamble)" value=""></textarea>