From bf66a3957907e50064e7ab23988ba8000b50fdb8 Mon Sep 17 00:00:00 2001
From: DocShotgun <126566557+DocShotgun@users.noreply.github.com>
Date: Tue, 6 May 2025 00:32:29 -0700
Subject: [PATCH 001/162] Update llama.cpp textgen settings * Add min_keep, a
llama.cpp-exclusive setting for constraining the effect of truncation
samplers * Enable nsigma for llama.cpp, and add llama.cpp alias top_n_sigma,
add nsigma to the llama.cpp sampler order block * Allow a negative value of
nsigma as this represents 'disabled' in llama.cpp (while 0 is deterministic)
* Remove tfs and top_a as these are not supported by llama.cpp (tfs was
removed, and top_a was never supported) * Correct the identification string
for typical_p in the llama.cpp sampler order block * Add penalties to the
llama.cpp sampler order block
---
public/index.html | 23 ++++++++++++++++-------
public/scripts/textgen-settings.js | 12 +++++++++---
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/public/index.html b/public/index.html
index 954a0a57d..5fae60354 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1284,7 +1284,7 @@
-
+
-
+
-
+
+
@@ -1769,11 +1777,12 @@
Temperature
Top K
Top P
- Typical P
- Tail Free Sampling
+ Typical P
Min P
Exclude Top Choices
DRY
+ Rep/Freq/Pres Penalties
+ Top N-Sigma
diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js
index cbdfc0a5a..c1813f2e7 100644
--- a/public/scripts/textgen-settings.js
+++ b/public/scripts/textgen-settings.js
@@ -806,7 +806,7 @@ jQuery(function () {
'dry_penalty_last_n_textgenerationwebui': 0,
'xtc_threshold_textgenerationwebui': 0.1,
'xtc_probability_textgenerationwebui': 0,
- 'nsigma_textgenerationwebui': [LLAMACPP].includes(settings.type) ? -0.01 : 0,
+ 'nsigma_textgenerationwebui': 0,
'min_keep_textgenerationwebui': 0,
};
@@ -1335,8 +1335,8 @@ export async function getTextGenGenerationData(finalPrompt, maxTokens, isImperso
'sampler_order': settings.type === textgen_types.KOBOLDCPP ? settings.sampler_order : undefined,
'xtc_threshold': settings.xtc_threshold,
'xtc_probability': settings.xtc_probability,
- 'nsigma': settings.nsigma,
- 'top_n_sigma': settings.nsigma,
+ 'nsigma': [LLAMACPP].includes(settings.type) && settings.nsigma === 0 ? -1 : settings.nsigma,
+ 'top_n_sigma': [LLAMACPP].includes(settings.type) && settings.nsigma === 0 ? -1 : settings.nsigma,
'min_keep': settings.min_keep,
};
const nonAphroditeParams = {
From 5e31a21d8d8ff964370272b0896ee569f9a1a93e Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Tue, 6 May 2025 22:02:20 +0300
Subject: [PATCH 005/162] Decouple "click to edit" from document mode
---
public/index.html | 7 ++++---
public/scripts/chats.js | 3 ++-
public/scripts/power-user.js | 14 ++++++++++++++
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/public/index.html b/public/index.html
index c7b0e1ad5..3c658125c 100644
--- a/public/index.html
+++ b/public/index.html
@@ -4498,10 +4498,11 @@
Tags as Folders
-
+
+
+ Click to Edit
+
-
-
diff --git a/public/scripts/chats.js b/public/scripts/chats.js
index 3c5795709..51b272b50 100644
--- a/public/scripts/chats.js
+++ b/public/scripts/chats.js
@@ -1576,7 +1576,8 @@ jQuery(function () {
await callGenericPopup(wrapper, POPUP_TYPE.TEXT, '', { wide: true, large: true });
});
- $(document).on('click', 'body.documentstyle .mes .mes_text', function () {
+ $(document).on('click', 'body .mes .mes_text', function () {
+ if (!power_user.click_to_edit) return;
if (window.getSelection().toString()) return;
if ($('.edit_textarea').length) return;
$(this).closest('.mes').find('.mes_edit').trigger('click');
diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js
index a4baaa901..00a3f1d4b 100644
--- a/public/scripts/power-user.js
+++ b/public/scripts/power-user.js
@@ -320,6 +320,7 @@ let power_user = {
external_media_allowed_overrides: [],
external_media_forbidden_overrides: [],
pin_styles: true,
+ click_to_edit: false,
};
let themes = [];
@@ -1322,6 +1323,12 @@ function applyTheme(name) {
switchSwipeNumAllMessages();
},
},
+ {
+ key: 'click_to_edit',
+ action: () => {
+ $('#click_to_edit').prop('checked', power_user.click_to_edit);
+ },
+ },
];
for (const { key, selector, type, action } of themeProperties) {
@@ -1647,6 +1654,7 @@ async function loadPowerUserSettings(settings, data) {
$('#auto-load-chat-checkbox').prop('checked', power_user.auto_load_chat);
$('#forbid_external_media').prop('checked', power_user.forbid_external_media);
$('#pin_styles').prop('checked', power_user.pin_styles);
+ $('#click_to_edit').prop('checked', power_user.click_to_edit);
for (const theme of themes) {
const option = document.createElement('option');
@@ -2379,6 +2387,7 @@ function getThemeObject(name) {
reduced_motion: power_user.reduced_motion,
compact_input_area: power_user.compact_input_area,
show_swipe_num_all_messages: power_user.show_swipe_num_all_messages,
+ click_to_edit: power_user.click_to_edit,
};
}
@@ -3929,6 +3938,11 @@ $(document).ready(() => {
applyStylePins();
});
+ $('#click_to_edit').on('input', function () {
+ power_user.click_to_edit = !!$(this).prop('checked');
+ saveSettingsDebounced();
+ });
+
$('#ui_preset_import_button').on('click', function () {
$('#ui_preset_import_file').trigger('click');
});
From 3be991591fa4d07e1546b9bbc34c00753aa0a40a Mon Sep 17 00:00:00 2001
From: DocShotgun <126566557+DocShotgun@users.noreply.github.com>
Date: Tue, 6 May 2025 14:11:00 -0700
Subject: [PATCH 006/162] Remove special handling of nsigma for llama.cpp * 0
now changed to disable/no-op upstream
---
public/scripts/textgen-settings.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/public/scripts/textgen-settings.js b/public/scripts/textgen-settings.js
index c1813f2e7..69f6372fb 100644
--- a/public/scripts/textgen-settings.js
+++ b/public/scripts/textgen-settings.js
@@ -1335,8 +1335,8 @@ export async function getTextGenGenerationData(finalPrompt, maxTokens, isImperso
'sampler_order': settings.type === textgen_types.KOBOLDCPP ? settings.sampler_order : undefined,
'xtc_threshold': settings.xtc_threshold,
'xtc_probability': settings.xtc_probability,
- 'nsigma': [LLAMACPP].includes(settings.type) && settings.nsigma === 0 ? -1 : settings.nsigma,
- 'top_n_sigma': [LLAMACPP].includes(settings.type) && settings.nsigma === 0 ? -1 : settings.nsigma,
+ 'nsigma': settings.nsigma,
+ 'top_n_sigma': settings.nsigma,
'min_keep': settings.min_keep,
};
const nonAphroditeParams = {
From 7a4d6ecfde0d500aaa301190e0dabf2ac87919f0 Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Wed, 7 May 2025 11:12:41 +0000
Subject: [PATCH 007/162] Migrate old preference for "click to edit" setting
based on chat display style
---
public/scripts/power-user.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js
index 00a3f1d4b..98e811363 100644
--- a/public/scripts/power-user.js
+++ b/public/scripts/power-user.js
@@ -1459,6 +1459,10 @@ async function loadPowerUserSettings(settings, data) {
const defaultStscript = JSON.parse(JSON.stringify(power_user.stscript));
// Load from settings.json
if (settings.power_user !== undefined) {
+ // Migrate old preference to a new setting
+ if (settings.power_user.click_to_edit === undefined && settings.power_user.chat_display === chat_styles.DOCUMENT) {
+ settings.power_user.click_to_edit = true;
+ }
Object.assign(power_user, settings.power_user);
}
From fa8ea7c60d893c660f2b2f1b341ccad2d346f5b8 Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Wed, 7 May 2025 20:09:56 +0300
Subject: [PATCH 008/162] mistral-medium-2505
---
public/index.html | 1 +
public/scripts/extensions/caption/settings.html | 2 ++
public/scripts/openai.js | 7 +++++--
3 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/public/index.html b/public/index.html
index 13567e2aa..962c6f121 100644
--- a/public/index.html
+++ b/public/index.html
@@ -3246,6 +3246,7 @@
mistral-small-2501
mistral-small-2503
mistral-medium-2312
+ mistral-medium-2505
mistral-large-2402
mistral-large-2407
mistral-large-2411
diff --git a/public/scripts/extensions/caption/settings.html b/public/scripts/extensions/caption/settings.html
index 67e179b43..d345096e7 100644
--- a/public/scripts/extensions/caption/settings.html
+++ b/public/scripts/extensions/caption/settings.html
@@ -46,6 +46,8 @@
mistral-large-pixtral-2411
mistral-small-2503
mistral-small-latest
+ mistral-medium-latest
+ mistral-medium-2505
yi-vision
gpt-4.1
gpt-4.1-2025-04-14
diff --git a/public/scripts/openai.js b/public/scripts/openai.js
index b37560fbb..b00f4de8b 100644
--- a/public/scripts/openai.js
+++ b/public/scripts/openai.js
@@ -4289,9 +4289,10 @@ function getMistralMaxContext(model, isUnlocked) {
'codestral-2405': 32768,
'mistral-embed': 32768,
'mistral-large-2402': 32768,
- 'mistral-medium': 32768,
+ 'mistral-medium': 131072,
'mistral-medium-2312': 32768,
- 'mistral-medium-latest': 32768,
+ 'mistral-medium-2505': 131072,
+ 'mistral-medium-latest': 131072,
'mistral-moderation-2411': 32768,
'mistral-moderation-latest': 32768,
'mistral-ocr-2503': 32768,
@@ -5153,6 +5154,8 @@ export function isImageInliningSupported() {
// MistralAI
'mistral-small-2503',
'mistral-small-latest',
+ 'mistral-medium-latest',
+ 'mistral-medium-2505',
'pixtral',
// xAI (Grok)
'grok-2-vision',
From da7f97b66377a970f1accb890ffd865aeb269ffb Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Thu, 8 May 2025 20:28:35 +0300
Subject: [PATCH 009/162] Claude: "Auto" effort = no thinking
---
src/endpoints/backends/chat-completions.js | 7 ++++---
src/prompt-converters.js | 5 +++--
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js
index e440d6c01..b6cce98a0 100644
--- a/src/endpoints/backends/chat-completions.js
+++ b/src/endpoints/backends/chat-completions.js
@@ -200,11 +200,12 @@ async function sendClaudeRequest(request, response) {
betaHeaders.push('prompt-caching-2024-07-31');
}
- if (useThinking) {
+ const reasoningEffort = request.body.reasoning_effort;
+ const budgetTokens = calculateClaudeBudgetTokens(requestBody.max_tokens, reasoningEffort, requestBody.stream);
+
+ if (useThinking && Number.isInteger(budgetTokens)) {
// No prefill when thinking
voidPrefill = true;
- const reasoningEffort = request.body.reasoning_effort;
- const budgetTokens = calculateClaudeBudgetTokens(requestBody.max_tokens, reasoningEffort, requestBody.stream);
const minThinkTokens = 1024;
if (requestBody.max_tokens <= minThinkTokens) {
const newValue = requestBody.max_tokens + minThinkTokens;
diff --git a/src/prompt-converters.js b/src/prompt-converters.js
index c894a4736..ae4c0c0fb 100644
--- a/src/prompt-converters.js
+++ b/src/prompt-converters.js
@@ -917,19 +917,20 @@ export function cachingAtDepthForOpenRouterClaude(messages, cachingAtDepth) {
* @param {number} maxTokens Maximum tokens
* @param {string} reasoningEffort Reasoning effort
* @param {boolean} stream If streaming is enabled
- * @returns {number} Budget tokens
+ * @returns {number?} Budget tokens
*/
export function calculateClaudeBudgetTokens(maxTokens, reasoningEffort, stream) {
let budgetTokens = 0;
switch (reasoningEffort) {
+ case REASONING_EFFORT.auto:
+ return null;
case REASONING_EFFORT.min:
budgetTokens = 1024;
break;
case REASONING_EFFORT.low:
budgetTokens = Math.floor(maxTokens * 0.1);
break;
- case REASONING_EFFORT.auto:
case REASONING_EFFORT.medium:
budgetTokens = Math.floor(maxTokens * 0.25);
break;
From c1c77a6a60b30cbe85bed3b4d8a3e8c67c2fa4ac Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Thu, 8 May 2025 20:51:38 +0300
Subject: [PATCH 010/162] Claude: add web search tool, adjust prefill voiding
Closes #3968
---
public/index.html | 2 +-
src/endpoints/backends/chat-completions.js | 21 +++++++++++++--------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/public/index.html b/public/index.html
index ae9631e55..942764ef7 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1963,7 +1963,7 @@
-
+
Enable web search
diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js
index b6cce98a0..438362f56 100644
--- a/src/endpoints/backends/chat-completions.js
+++ b/src/endpoints/backends/chat-completions.js
@@ -148,7 +148,8 @@ async function sendClaudeRequest(request, response) {
const useSystemPrompt = (request.body.model.startsWith('claude-2') || request.body.model.startsWith('claude-3')) && request.body.claude_use_sysprompt;
const convertedPrompt = convertClaudeMessages(request.body.messages, request.body.assistant_prefill, useSystemPrompt, useTools, getPromptNames(request));
const useThinking = request.body.model.startsWith('claude-3-7') && Boolean(request.body.include_reasoning);
- let voidPrefill = false;
+ const useWebSearch = /^claude-3-(5|7)/.test(request.body.model) && Boolean(request.body.enable_web_search);
+ let fixThinkingPrefill = false;
// Add custom stop sequences
const stopSequences = [];
if (Array.isArray(request.body.stop)) {
@@ -183,15 +184,19 @@ async function sendClaudeRequest(request, response) {
.map(tool => tool.function)
.map(fn => ({ name: fn.name, description: fn.description, input_schema: fn.parameters }));
- if (requestBody.tools.length) {
- // No prefill when using tools
- voidPrefill = true;
- }
if (enableSystemPromptCache && requestBody.tools.length) {
requestBody.tools[requestBody.tools.length - 1]['cache_control'] = { type: 'ephemeral' };
}
}
+ if (useWebSearch) {
+ const webSearchTool = [{
+ 'type': 'web_search_20250305',
+ 'name': 'web_search',
+ }];
+ requestBody.tools = [...(requestBody.tools || []), ...webSearchTool];
+ }
+
if (cachingAtDepth !== -1) {
cachingAtDepthForClaude(convertedPrompt.messages, cachingAtDepth);
}
@@ -205,7 +210,7 @@ async function sendClaudeRequest(request, response) {
if (useThinking && Number.isInteger(budgetTokens)) {
// No prefill when thinking
- voidPrefill = true;
+ fixThinkingPrefill = true;
const minThinkTokens = 1024;
if (requestBody.max_tokens <= minThinkTokens) {
const newValue = requestBody.max_tokens + minThinkTokens;
@@ -224,8 +229,8 @@ async function sendClaudeRequest(request, response) {
delete requestBody.top_k;
}
- if (voidPrefill && convertedPrompt.messages.length && convertedPrompt.messages[convertedPrompt.messages.length - 1].role === 'assistant') {
- convertedPrompt.messages.push({ role: 'user', content: [{ type: 'text', text: '\u200b' }] });
+ if (fixThinkingPrefill && convertedPrompt.messages.length && convertedPrompt.messages[convertedPrompt.messages.length - 1].role === 'assistant') {
+ convertedPrompt.messages[convertedPrompt.messages.length - 1].role = 'user';
}
if (betaHeaders.length) {
From 596353389b2c090559eef340d8f33a120344f6ec Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Thu, 8 May 2025 21:22:58 +0300
Subject: [PATCH 011/162] DeepSeek: don't send empty required arrays in tool
definitions
---
src/endpoints/backends/chat-completions.js | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/endpoints/backends/chat-completions.js b/src/endpoints/backends/chat-completions.js
index e440d6c01..d163e3f03 100644
--- a/src/endpoints/backends/chat-completions.js
+++ b/src/endpoints/backends/chat-completions.js
@@ -798,6 +798,14 @@ async function sendDeepSeekRequest(request, response) {
if (Array.isArray(request.body.tools) && request.body.tools.length > 0) {
bodyParams['tools'] = request.body.tools;
bodyParams['tool_choice'] = request.body.tool_choice;
+
+ // DeepSeek doesn't permit empty required arrays
+ bodyParams.tools.forEach(tool => {
+ const required = tool?.function?.parameters?.required;
+ if (Array.isArray(required) && required.length === 0) {
+ delete tool.function.parameters.required;
+ }
+ });
}
const postProcessType = String(request.body.model).endsWith('-reasoner') ? 'deepseek-reasoner' : 'deepseek';
From c6a64d85265b417683a8449766635222c6980524 Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Fri, 9 May 2025 00:24:36 +0300
Subject: [PATCH 012/162] xAI: fix model not saving to presets
---
public/scripts/openai.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/public/scripts/openai.js b/public/scripts/openai.js
index b00f4de8b..c7ad1a639 100644
--- a/public/scripts/openai.js
+++ b/public/scripts/openai.js
@@ -3665,6 +3665,7 @@ async function saveOpenAIPreset(name, settings, triggerUi = true) {
perplexity_model: settings.perplexity_model,
groq_model: settings.groq_model,
zerooneai_model: settings.zerooneai_model,
+ xai_model: settings.xai_model,
custom_model: settings.custom_model,
custom_url: settings.custom_url,
custom_include_body: settings.custom_include_body,
From 8a4da487dd0d74316ae18b4fae63c4013c3426cb Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Fri, 9 May 2025 22:33:25 +0300
Subject: [PATCH 013/162] llamacpp: use generic CC endpoint for captioning
---
public/scripts/extensions/shared.js | 2 -
src/endpoints/backends/text-completions.js | 45 ----------------------
src/endpoints/openai.js | 9 ++++-
3 files changed, 7 insertions(+), 49 deletions(-)
diff --git a/public/scripts/extensions/shared.js b/public/scripts/extensions/shared.js
index 2f5d703f4..d95966fd7 100644
--- a/public/scripts/extensions/shared.js
+++ b/public/scripts/extensions/shared.js
@@ -97,8 +97,6 @@ export async function getMultimodalCaption(base64Img, prompt) {
return '/api/google/caption-image';
case 'anthropic':
return '/api/anthropic/caption-image';
- case 'llamacpp':
- return '/api/backends/text-completions/llamacpp/caption-image';
case 'ollama':
return '/api/backends/text-completions/ollama/caption-image';
default:
diff --git a/src/endpoints/backends/text-completions.js b/src/endpoints/backends/text-completions.js
index 1110e64e8..ab5319a50 100644
--- a/src/endpoints/backends/text-completions.js
+++ b/src/endpoints/backends/text-completions.js
@@ -502,51 +502,6 @@ ollama.post('/caption-image', async function (request, response) {
const llamacpp = express.Router();
-llamacpp.post('/caption-image', async function (request, response) {
- try {
- if (!request.body.server_url) {
- return response.sendStatus(400);
- }
-
- console.debug('LlamaCpp caption request:', request.body);
- const baseUrl = trimV1(request.body.server_url);
-
- const fetchResponse = await fetch(`${baseUrl}/completion`, {
- method: 'POST',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({
- prompt: `USER:[img-1]${String(request.body.prompt).trim()}\nASSISTANT:`,
- image_data: [{ data: request.body.image, id: 1 }],
- temperature: 0.1,
- stream: false,
- stop: ['USER:', ''],
- }),
- });
-
- if (!fetchResponse.ok) {
- console.error('LlamaCpp caption error:', fetchResponse.status, fetchResponse.statusText);
- return response.status(500).send({ error: true });
- }
-
- /** @type {any} */
- const data = await fetchResponse.json();
- console.debug('LlamaCpp caption response:', data);
-
- const caption = data?.content || '';
-
- if (!caption) {
- console.error('LlamaCpp caption is empty.');
- return response.status(500).send({ error: true });
- }
-
- return response.send({ caption });
-
- } catch (error) {
- console.error(error);
- return response.sendStatus(500);
- }
-});
-
llamacpp.post('/props', async function (request, response) {
try {
if (!request.body.server_url) {
diff --git a/src/endpoints/openai.js b/src/endpoints/openai.js
index bb8c1a9d2..0083e9a05 100644
--- a/src/endpoints/openai.js
+++ b/src/endpoints/openai.js
@@ -45,6 +45,10 @@ router.post('/caption-image', async (request, response) => {
key = readSecret(request.user.directories, SECRET_KEYS.KOBOLDCPP);
}
+ if (request.body.api === 'llamacpp') {
+ key = readSecret(request.user.directories, SECRET_KEYS.LLAMACPP);
+ }
+
if (request.body.api === 'vllm') {
key = readSecret(request.user.directories, SECRET_KEYS.VLLM);
}
@@ -69,7 +73,8 @@ router.post('/caption-image', async (request, response) => {
key = readSecret(request.user.directories, SECRET_KEYS.XAI);
}
- if (!key && !request.body.reverse_proxy && ['custom', 'ooba', 'koboldcpp', 'vllm'].includes(request.body.api) === false) {
+ const noKeyTypes = ['custom', 'ooba', 'koboldcpp', 'vllm', 'llamacpp'];
+ if (!key && !request.body.reverse_proxy && !noKeyTypes.includes(request.body.api)) {
console.warn('No key found for API', request.body.api);
return response.sendStatus(400);
}
@@ -156,7 +161,7 @@ router.post('/caption-image', async (request, response) => {
});
}
- if (request.body.api === 'koboldcpp' || request.body.api === 'vllm') {
+ if (['koboldcpp', 'vllm', 'llamacpp'].includes(request.body.api)) {
apiUrl = `${trimV1(request.body.server_url)}/v1/chat/completions`;
}
From aef005007f3b7810a90abb7d47106bb349344bfb Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Fri, 9 May 2025 23:23:34 +0300
Subject: [PATCH 014/162] Do not remove data URI prefix from llamacpp caption
requests
---
public/scripts/extensions/shared.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/scripts/extensions/shared.js b/public/scripts/extensions/shared.js
index d95966fd7..f1ea88085 100644
--- a/public/scripts/extensions/shared.js
+++ b/public/scripts/extensions/shared.js
@@ -22,7 +22,7 @@ export async function getMultimodalCaption(base64Img, prompt) {
throwIfInvalidModel(useReverseProxy);
- const noPrefix = ['ollama', 'llamacpp'].includes(extension_settings.caption.multimodal_api);
+ const noPrefix = ['ollama'].includes(extension_settings.caption.multimodal_api);
if (noPrefix && base64Img.startsWith('data:image/')) {
base64Img = base64Img.split(',')[1];
From c7963d683f769046288f19d8ca67dd1fcbb6f848 Mon Sep 17 00:00:00 2001
From: cloak1505 <170299980+cloak1505@users.noreply.github.com>
Date: Fri, 9 May 2025 23:23:36 -0500
Subject: [PATCH 015/162] Update and alphabetize OpenRouter providers list
---
public/scripts/textgen-models.js | 99 ++++++++++++++++----------------
1 file changed, 51 insertions(+), 48 deletions(-)
diff --git a/public/scripts/textgen-models.js b/public/scripts/textgen-models.js
index a607d87b9..1e01a001a 100644
--- a/public/scripts/textgen-models.js
+++ b/public/scripts/textgen-models.js
@@ -24,60 +24,63 @@ export let openRouterModels = [];
* @type {string[]}
*/
const OPENROUTER_PROVIDERS = [
- 'OpenAI',
- 'Anthropic',
- 'Google',
- 'Google AI Studio',
- 'Amazon Bedrock',
- 'Groq',
- 'SambaNova',
- 'Cohere',
- 'Mistral',
- 'Together',
- 'Together 2',
- 'Fireworks',
- 'DeepInfra',
- 'Lepton',
- 'Novita',
- 'Avian',
- 'Lambda',
- 'Azure',
- 'Perplexity',
- 'DeepSeek',
- 'Infermatic',
'AI21',
- 'Featherless',
- 'Inflection',
- 'xAI',
- 'Cloudflare',
- 'Minimax',
- 'Nineteen',
- 'Liquid',
- 'GMICloud',
- 'Stealth',
- 'NCompass',
- 'InferenceNet',
- 'Friendli',
'AionLabs',
'Alibaba',
- 'Nebius',
- 'Chutes',
- 'Kluster',
- 'Crusoe',
- 'Targon',
- 'Ubicloud',
- 'Parasail',
- 'Phala',
- 'Cent-ML',
- 'Venice',
- 'OpenInference',
+ 'Amazon Bedrock',
+ 'Anthropic',
'Atoma',
+ 'Avian',
+ 'Azure',
+ 'Cent-ML',
+ 'Cerebras',
+ 'Chutes',
+ 'Cloudflare',
+ 'Cohere',
+ 'Crusoe',
+ 'DeepInfra',
+ 'DeepSeek',
'Enfer',
- 'Mancer',
- 'Mancer 2',
- 'Hyperbolic',
+ 'Featherless',
+ 'Fireworks',
+ 'Friendli',
+ 'GMICloud',
+ 'Google AI Studio',
+ 'Google',
+ 'Groq',
'Hyperbolic 2',
- 'Reflection',
+ 'Hyperbolic',
+ 'Inception',
+ 'InferenceNet',
+ 'Infermatic',
+ 'Inflection',
+ 'InoCloud',
+ 'Kluster',
+ 'Lambda',
+ 'Liquid',
+ 'Mancer 2',
+ 'Mancer',
+ 'Minimax',
+ 'Mistral',
+ 'NCompass',
+ 'Nebius',
+ 'NextBit',
+ 'Nineteen',
+ 'Novita',
+ 'OpenAI',
+ 'OpenInference',
+ 'Parasail',
+ 'Perplexity',
+ 'Phala',
+ 'SambaNova 2',
+ 'SambaNova',
+ 'Stealth',
+ 'Targon',
+ 'Together 2',
+ 'Together',
+ 'Ubicloud',
+ 'Venice',
+ 'xAI',
];
export async function loadOllamaModels(data) {
From cc75768668c514b5811ad72cc55336f39b7f95cc Mon Sep 17 00:00:00 2001
From: cloak1505 <170299980+cloak1505@users.noreply.github.com>
Date: Sat, 10 May 2025 05:42:15 -0500
Subject: [PATCH 016/162] Actual copy and paste
Turns out the doc is already alphabetized but with dead providers moved to the top, so I didn't have to alphabetize the whole list and manually remove the dead ones.
---
public/scripts/textgen-models.js | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/public/scripts/textgen-models.js b/public/scripts/textgen-models.js
index 1e01a001a..c1226f493 100644
--- a/public/scripts/textgen-models.js
+++ b/public/scripts/textgen-models.js
@@ -45,10 +45,9 @@ const OPENROUTER_PROVIDERS = [
'Fireworks',
'Friendli',
'GMICloud',
- 'Google AI Studio',
'Google',
+ 'Google AI Studio',
'Groq',
- 'Hyperbolic 2',
'Hyperbolic',
'Inception',
'InferenceNet',
@@ -58,8 +57,8 @@ const OPENROUTER_PROVIDERS = [
'Kluster',
'Lambda',
'Liquid',
- 'Mancer 2',
'Mancer',
+ 'Mancer 2',
'Minimax',
'Mistral',
'NCompass',
@@ -72,11 +71,9 @@ const OPENROUTER_PROVIDERS = [
'Parasail',
'Perplexity',
'Phala',
- 'SambaNova 2',
'SambaNova',
'Stealth',
'Targon',
- 'Together 2',
'Together',
'Ubicloud',
'Venice',
From 44b7a09cb6873a7845eaf71503f083db4679f959 Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Sat, 10 May 2025 16:28:18 +0300
Subject: [PATCH 017/162] Prompt Manager: add source display of pulled prompts
(#3981)
* Prompt Manager: add source display of pulled prompts
* Fix copilot comments
---
public/css/promptmanager.css | 7 ++++++-
public/index.html | 5 +++++
public/scripts/PromptManager.js | 31 +++++++++++++++++++++++++++++++
3 files changed, 42 insertions(+), 1 deletion(-)
diff --git a/public/css/promptmanager.css b/public/css/promptmanager.css
index f02b172b1..3c7f94b35 100644
--- a/public/css/promptmanager.css
+++ b/public/css/promptmanager.css
@@ -359,10 +359,15 @@
content: attr(external_piece_text);
display: block;
width: 100%;
- font-weight: 600;
+ font-weight: 500;
text-align: center;
}
.completion_prompt_manager_popup_entry_form_control #completion_prompt_manager_popup_entry_form_prompt:disabled {
visibility: hidden;
}
+
+#completion_prompt_manager_popup_entry_source_block {
+ display: flex;
+ justify-content: center;
+}
diff --git a/public/index.html b/public/index.html
index 942764ef7..08b1bdb09 100644
--- a/public/index.html
+++ b/public/index.html
@@ -6477,6 +6477,11 @@
+
diff --git a/public/scripts/PromptManager.js b/public/scripts/PromptManager.js
index 94d642afa..2a705e8b2 100644
--- a/public/scripts/PromptManager.js
+++ b/public/scripts/PromptManager.js
@@ -196,6 +196,17 @@ export class PromptCollection {
}
class PromptManager {
+ get promptSources() {
+ return {
+ charDescription: t`Character Description`,
+ charPersonality: t`Character Personality`,
+ scenario: t`Character Scenario`,
+ personaDescription: t`Persona Description`,
+ worldInfoBefore: t`World Info (↑Char)`,
+ worldInfoAfter: t`World Info (↓Char)`,
+ };
+ }
+
constructor() {
this.systemPrompts = [
'main',
@@ -408,6 +419,7 @@ class PromptManager {
this.handleResetPrompt = (event) => {
const promptId = event.target.dataset.pmPrompt;
const prompt = this.getPromptById(promptId);
+ const isPulledPrompt = Object.keys(this.promptSources).includes(promptId);
switch (promptId) {
case 'main':
@@ -439,6 +451,12 @@ class PromptManager {
document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_forbid_overrides').checked = prompt.forbid_overrides ?? false;
document.getElementById(this.configuration.prefix + 'prompt_manager_forbid_overrides_block').style.visibility = this.overridablePrompts.includes(prompt.identifier) ? 'visible' : 'hidden';
document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_prompt').disabled = prompt.marker ?? false;
+ document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_source_block').style.display = isPulledPrompt ? '' : 'none';
+
+ if (isPulledPrompt) {
+ const sourceName = this.promptSources[promptId];
+ document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_source').textContent = sourceName;
+ }
if (!this.systemPrompts.includes(promptId)) {
document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_injection_position').removeAttribute('disabled');
@@ -1207,6 +1225,9 @@ class PromptManager {
const injectionDepthBlock = document.getElementById(this.configuration.prefix + 'prompt_manager_depth_block');
const forbidOverridesField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_forbid_overrides');
const forbidOverridesBlock = document.getElementById(this.configuration.prefix + 'prompt_manager_forbid_overrides_block');
+ const entrySourceBlock = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_source_block');
+ const entrySource = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_source');
+ const isPulledPrompt = Object.keys(this.promptSources).includes(prompt.identifier);
nameField.value = prompt.name ?? '';
roleField.value = prompt.role || 'system';
@@ -1218,6 +1239,12 @@ class PromptManager {
injectionPositionField.removeAttribute('disabled');
forbidOverridesField.checked = prompt.forbid_overrides ?? false;
forbidOverridesBlock.style.visibility = this.overridablePrompts.includes(prompt.identifier) ? 'visible' : 'hidden';
+ entrySourceBlock.style.display = isPulledPrompt ? '' : 'none';
+
+ if (isPulledPrompt) {
+ const sourceName = this.promptSources[prompt.identifier];
+ entrySource.textContent = sourceName;
+ }
if (this.systemPrompts.includes(prompt.identifier)) {
injectionPositionField.setAttribute('disabled', 'disabled');
@@ -1303,6 +1330,8 @@ class PromptManager {
const injectionDepthBlock = document.getElementById(this.configuration.prefix + 'prompt_manager_depth_block');
const forbidOverridesField = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_form_forbid_overrides');
const forbidOverridesBlock = document.getElementById(this.configuration.prefix + 'prompt_manager_forbid_overrides_block');
+ const entrySourceBlock = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_source_block');
+ const entrySource = document.getElementById(this.configuration.prefix + 'prompt_manager_popup_entry_source');
nameField.value = '';
roleField.selectedIndex = 0;
@@ -1314,6 +1343,8 @@ class PromptManager {
injectionDepthBlock.style.visibility = 'unset';
forbidOverridesBlock.style.visibility = 'unset';
forbidOverridesField.checked = false;
+ entrySourceBlock.style.display = 'none';
+ entrySource.textContent = '';
roleField.disabled = false;
}
From e6530cb22dc360b38d0b67c3250bad1758cb8fd6 Mon Sep 17 00:00:00 2001
From: Cohee <18619528+Cohee1207@users.noreply.github.com>
Date: Sat, 10 May 2025 18:19:22 +0300
Subject: [PATCH 018/162] Install jimp plugins explicitly
---
package-lock.json | 2 ++
package.json | 2 ++
2 files changed, 4 insertions(+)
diff --git a/package-lock.json b/package-lock.json
index 159558e74..f02e73a89 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18,6 +18,7 @@
"@jimp/js-bmp": "^1.6.0",
"@jimp/js-gif": "^1.6.0",
"@jimp/js-tiff": "^1.6.0",
+ "@jimp/plugin-blit": "^1.6.0",
"@jimp/plugin-circle": "^1.6.0",
"@jimp/plugin-color": "^1.6.0",
"@jimp/plugin-contain": "^1.6.0",
@@ -28,6 +29,7 @@
"@jimp/plugin-flip": "^1.6.0",
"@jimp/plugin-mask": "^1.6.0",
"@jimp/plugin-quantize": "^1.6.0",
+ "@jimp/plugin-resize": "^1.6.0",
"@jimp/plugin-rotate": "^1.6.0",
"@jimp/plugin-threshold": "^1.6.0",
"@jimp/wasm-avif": "^1.6.0",
diff --git a/package.json b/package.json
index 0733f177d..9744c2f4a 100644
--- a/package.json
+++ b/package.json
@@ -8,6 +8,7 @@
"@jimp/js-bmp": "^1.6.0",
"@jimp/js-gif": "^1.6.0",
"@jimp/js-tiff": "^1.6.0",
+ "@jimp/plugin-blit": "^1.6.0",
"@jimp/plugin-circle": "^1.6.0",
"@jimp/plugin-color": "^1.6.0",
"@jimp/plugin-contain": "^1.6.0",
@@ -18,6 +19,7 @@
"@jimp/plugin-flip": "^1.6.0",
"@jimp/plugin-mask": "^1.6.0",
"@jimp/plugin-quantize": "^1.6.0",
+ "@jimp/plugin-resize": "^1.6.0",
"@jimp/plugin-rotate": "^1.6.0",
"@jimp/plugin-threshold": "^1.6.0",
"@jimp/wasm-avif": "^1.6.0",
From 2aa5addb1d351101565976f0f10538dcdcfed299 Mon Sep 17 00:00:00 2001
From: 50h100a