-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodelRuntimeDefaults.js
More file actions
27 lines (20 loc) · 888 Bytes
/
modelRuntimeDefaults.js
File metadata and controls
27 lines (20 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict';
const path = require('path');
/**
* Per-model runtime defaults applied on every model load.
* Does not overwrite unrelated user settings (gpuLayers, context, etc.) — only keys listed here.
*/
/** GGUF filenames known to need thinkingMode=off (GLM 4.6V thought-segment trap; GLM 4.7+ not included). */
const GLM_46_THINKING_OFF_PATTERN = /glm-4\.6|glm4\.6|4\.6v-flash|glm-4\.6v/i;
/**
* @param {string} modelPath
* @returns {{ thinkingMode: 'auto'|'off'|'B'|'C', reason: string }}
*/
function resolveRuntimeDefaultsForModel(modelPath) {
const base = path.basename(modelPath || '').toLowerCase();
if (GLM_46_THINKING_OFF_PATTERN.test(base)) {
return { thinkingMode: 'off', reason: 'glm-4.6v-known-trap' };
}
return { thinkingMode: 'auto', reason: 'default-auto' };
}
module.exports = { resolveRuntimeDefaultsForModel, GLM_46_THINKING_OFF_PATTERN };