llms-py 2.0.9__py3-none-any.whl → 3.0.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- llms/__init__.py +4 -0
- llms/__main__.py +9 -0
- llms/db.py +359 -0
- llms/extensions/analytics/ui/index.mjs +1444 -0
- llms/extensions/app/README.md +20 -0
- llms/extensions/app/__init__.py +589 -0
- llms/extensions/app/db.py +536 -0
- {llms_py-2.0.9.data/data → llms/extensions/app}/ui/Recents.mjs +100 -73
- llms_py-2.0.9.data/data/ui/Sidebar.mjs → llms/extensions/app/ui/index.mjs +150 -79
- llms/extensions/app/ui/threadStore.mjs +433 -0
- llms/extensions/core_tools/CALCULATOR.md +32 -0
- llms/extensions/core_tools/__init__.py +637 -0
- llms/extensions/core_tools/ui/codemirror/addon/edit/closebrackets.js +201 -0
- llms/extensions/core_tools/ui/codemirror/addon/edit/closetag.js +185 -0
- llms/extensions/core_tools/ui/codemirror/addon/edit/continuelist.js +101 -0
- llms/extensions/core_tools/ui/codemirror/addon/edit/matchbrackets.js +160 -0
- llms/extensions/core_tools/ui/codemirror/addon/edit/matchtags.js +66 -0
- llms/extensions/core_tools/ui/codemirror/addon/edit/trailingspace.js +27 -0
- llms/extensions/core_tools/ui/codemirror/addon/selection/active-line.js +72 -0
- llms/extensions/core_tools/ui/codemirror/addon/selection/mark-selection.js +119 -0
- llms/extensions/core_tools/ui/codemirror/addon/selection/selection-pointer.js +98 -0
- llms/extensions/core_tools/ui/codemirror/codemirror.css +344 -0
- llms/extensions/core_tools/ui/codemirror/codemirror.js +9884 -0
- llms/extensions/core_tools/ui/codemirror/doc/docs.css +225 -0
- llms/extensions/core_tools/ui/codemirror/doc/source_sans.woff +0 -0
- llms/extensions/core_tools/ui/codemirror/mode/clike/clike.js +942 -0
- llms/extensions/core_tools/ui/codemirror/mode/javascript/index.html +118 -0
- llms/extensions/core_tools/ui/codemirror/mode/javascript/javascript.js +962 -0
- llms/extensions/core_tools/ui/codemirror/mode/javascript/typescript.html +62 -0
- llms/extensions/core_tools/ui/codemirror/mode/python/python.js +402 -0
- llms/extensions/core_tools/ui/codemirror/theme/dracula.css +40 -0
- llms/extensions/core_tools/ui/codemirror/theme/mocha.css +135 -0
- llms/extensions/core_tools/ui/index.mjs +650 -0
- llms/extensions/gallery/README.md +61 -0
- llms/extensions/gallery/__init__.py +63 -0
- llms/extensions/gallery/db.py +243 -0
- llms/extensions/gallery/ui/index.mjs +482 -0
- llms/extensions/katex/README.md +39 -0
- llms/extensions/katex/__init__.py +6 -0
- llms/extensions/katex/ui/README.md +125 -0
- llms/extensions/katex/ui/contrib/auto-render.js +338 -0
- llms/extensions/katex/ui/contrib/auto-render.min.js +1 -0
- llms/extensions/katex/ui/contrib/auto-render.mjs +244 -0
- llms/extensions/katex/ui/contrib/copy-tex.js +127 -0
- llms/extensions/katex/ui/contrib/copy-tex.min.js +1 -0
- llms/extensions/katex/ui/contrib/copy-tex.mjs +105 -0
- llms/extensions/katex/ui/contrib/mathtex-script-type.js +109 -0
- llms/extensions/katex/ui/contrib/mathtex-script-type.min.js +1 -0
- llms/extensions/katex/ui/contrib/mathtex-script-type.mjs +24 -0
- llms/extensions/katex/ui/contrib/mhchem.js +3213 -0
- llms/extensions/katex/ui/contrib/mhchem.min.js +1 -0
- llms/extensions/katex/ui/contrib/mhchem.mjs +3109 -0
- llms/extensions/katex/ui/contrib/render-a11y-string.js +887 -0
- llms/extensions/katex/ui/contrib/render-a11y-string.min.js +1 -0
- llms/extensions/katex/ui/contrib/render-a11y-string.mjs +800 -0
- llms/extensions/katex/ui/fonts/KaTeX_AMS-Regular.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_AMS-Regular.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-Bold.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-Bold.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-Bold.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-BoldItalic.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-Italic.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-Italic.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-Italic.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-Regular.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-Regular.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Main-Regular.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Math-Italic.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Math-Italic.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Math-Italic.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Script-Regular.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Script-Regular.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Script-Regular.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size1-Regular.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size1-Regular.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size2-Regular.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size2-Regular.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size3-Regular.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size3-Regular.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size4-Regular.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size4-Regular.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- llms/extensions/katex/ui/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- llms/extensions/katex/ui/index.mjs +92 -0
- llms/extensions/katex/ui/katex-swap.css +1230 -0
- llms/extensions/katex/ui/katex-swap.min.css +1 -0
- llms/extensions/katex/ui/katex.css +1230 -0
- llms/extensions/katex/ui/katex.js +19080 -0
- llms/extensions/katex/ui/katex.min.css +1 -0
- llms/extensions/katex/ui/katex.min.js +1 -0
- llms/extensions/katex/ui/katex.min.mjs +1 -0
- llms/extensions/katex/ui/katex.mjs +18547 -0
- llms/extensions/providers/__init__.py +22 -0
- llms/extensions/providers/anthropic.py +233 -0
- llms/extensions/providers/cerebras.py +37 -0
- llms/extensions/providers/chutes.py +153 -0
- llms/extensions/providers/google.py +481 -0
- llms/extensions/providers/nvidia.py +103 -0
- llms/extensions/providers/openai.py +154 -0
- llms/extensions/providers/openrouter.py +74 -0
- llms/extensions/providers/zai.py +182 -0
- llms/extensions/system_prompts/README.md +22 -0
- llms/extensions/system_prompts/__init__.py +45 -0
- llms/extensions/system_prompts/ui/index.mjs +280 -0
- llms/extensions/system_prompts/ui/prompts.json +1067 -0
- llms/extensions/tools/__init__.py +144 -0
- llms/extensions/tools/ui/index.mjs +706 -0
- llms/index.html +58 -0
- llms/llms.json +400 -0
- llms/main.py +4407 -0
- llms/providers-extra.json +394 -0
- llms/providers.json +1 -0
- llms/ui/App.mjs +188 -0
- llms/ui/ai.mjs +217 -0
- llms/ui/app.css +7081 -0
- llms/ui/ctx.mjs +412 -0
- llms/ui/index.mjs +131 -0
- llms/ui/lib/chart.js +14 -0
- llms/ui/lib/charts.mjs +16 -0
- llms/ui/lib/color.js +14 -0
- llms/ui/lib/servicestack-vue.mjs +37 -0
- llms/ui/lib/vue.min.mjs +13 -0
- llms/ui/lib/vue.mjs +18530 -0
- {llms_py-2.0.9.data/data → llms}/ui/markdown.mjs +33 -15
- llms/ui/modules/chat/ChatBody.mjs +976 -0
- llms/ui/modules/chat/SettingsDialog.mjs +374 -0
- llms/ui/modules/chat/index.mjs +991 -0
- llms/ui/modules/icons.mjs +46 -0
- llms/ui/modules/layout.mjs +271 -0
- llms/ui/modules/model-selector.mjs +811 -0
- llms/ui/tailwind.input.css +742 -0
- {llms_py-2.0.9.data/data → llms}/ui/typography.css +133 -7
- llms/ui/utils.mjs +261 -0
- llms_py-3.0.10.dist-info/METADATA +49 -0
- llms_py-3.0.10.dist-info/RECORD +177 -0
- llms_py-3.0.10.dist-info/entry_points.txt +2 -0
- {llms_py-2.0.9.dist-info → llms_py-3.0.10.dist-info}/licenses/LICENSE +1 -2
- llms.py +0 -1402
- llms_py-2.0.9.data/data/index.html +0 -64
- llms_py-2.0.9.data/data/llms.json +0 -447
- llms_py-2.0.9.data/data/requirements.txt +0 -1
- llms_py-2.0.9.data/data/ui/App.mjs +0 -20
- llms_py-2.0.9.data/data/ui/ChatPrompt.mjs +0 -389
- llms_py-2.0.9.data/data/ui/Main.mjs +0 -680
- llms_py-2.0.9.data/data/ui/app.css +0 -3951
- llms_py-2.0.9.data/data/ui/lib/servicestack-vue.min.mjs +0 -37
- llms_py-2.0.9.data/data/ui/lib/vue.min.mjs +0 -12
- llms_py-2.0.9.data/data/ui/tailwind.input.css +0 -261
- llms_py-2.0.9.data/data/ui/threadStore.mjs +0 -273
- llms_py-2.0.9.data/data/ui/utils.mjs +0 -114
- llms_py-2.0.9.data/data/ui.json +0 -1069
- llms_py-2.0.9.dist-info/METADATA +0 -941
- llms_py-2.0.9.dist-info/RECORD +0 -30
- llms_py-2.0.9.dist-info/entry_points.txt +0 -2
- {llms_py-2.0.9.data/data → llms}/ui/fav.svg +0 -0
- {llms_py-2.0.9.data/data → llms}/ui/lib/highlight.min.mjs +0 -0
- {llms_py-2.0.9.data/data → llms}/ui/lib/idb.min.mjs +0 -0
- {llms_py-2.0.9.data/data → llms}/ui/lib/marked.min.mjs +0 -0
- /llms_py-2.0.9.data/data/ui/lib/servicestack-client.min.mjs → /llms/ui/lib/servicestack-client.mjs +0 -0
- {llms_py-2.0.9.data/data → llms}/ui/lib/vue-router.min.mjs +0 -0
- {llms_py-2.0.9.dist-info → llms_py-3.0.10.dist-info}/WHEEL +0 -0
- {llms_py-2.0.9.dist-info → llms_py-3.0.10.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { ref, computed, watch, inject } from 'vue'
|
|
2
|
+
import { storageObject } from '../../utils.mjs'
|
|
3
|
+
|
|
4
|
+
const settingsKey = 'llms.settings'
|
|
5
|
+
|
|
6
|
+
export function useSettings() {
|
|
7
|
+
const intFields = [
|
|
8
|
+
'max_completion_tokens',
|
|
9
|
+
'n',
|
|
10
|
+
'seed',
|
|
11
|
+
'top_logprobs',
|
|
12
|
+
]
|
|
13
|
+
const floatFields = [
|
|
14
|
+
'frequency_penalty',
|
|
15
|
+
'presence_penalty',
|
|
16
|
+
'temperature',
|
|
17
|
+
'top_p',
|
|
18
|
+
]
|
|
19
|
+
const boolFields = [
|
|
20
|
+
'enable_thinking',
|
|
21
|
+
'parallel_tool_calls',
|
|
22
|
+
'store',
|
|
23
|
+
]
|
|
24
|
+
const strFields = [
|
|
25
|
+
'prompt_cache_key',
|
|
26
|
+
'reasoning_effort',
|
|
27
|
+
'safety_identifier',
|
|
28
|
+
'service_tier',
|
|
29
|
+
'verbosity',
|
|
30
|
+
]
|
|
31
|
+
const listFields = [
|
|
32
|
+
'stop',
|
|
33
|
+
]
|
|
34
|
+
const allFields = [
|
|
35
|
+
...intFields,
|
|
36
|
+
...floatFields,
|
|
37
|
+
...boolFields,
|
|
38
|
+
...strFields,
|
|
39
|
+
...listFields,
|
|
40
|
+
]
|
|
41
|
+
|
|
42
|
+
let settings = ref(storageObject(settingsKey))
|
|
43
|
+
|
|
44
|
+
function validSettings(localSettings) {
|
|
45
|
+
const to = {}
|
|
46
|
+
intFields.forEach(f => {
|
|
47
|
+
if (localSettings[f] != null && localSettings[f] !== '' && !isNaN(parseInt(localSettings[f]))) {
|
|
48
|
+
to[f] = parseInt(localSettings[f])
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
floatFields.forEach(f => {
|
|
52
|
+
if (localSettings[f] != null && localSettings[f] !== '' && !isNaN(parseFloat(localSettings[f]))) {
|
|
53
|
+
to[f] = parseFloat(localSettings[f])
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
boolFields.forEach(f => {
|
|
57
|
+
if (localSettings[f] != null && localSettings[f] !== '' && !!localSettings[f]) {
|
|
58
|
+
to[f] = !!localSettings[f]
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
strFields.forEach(f => {
|
|
62
|
+
if (localSettings[f] != null && localSettings[f] !== '') {
|
|
63
|
+
to[f] = localSettings[f]
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
listFields.forEach(f => {
|
|
67
|
+
if (localSettings[f] != null && localSettings[f] !== '') {
|
|
68
|
+
to[f] = Array.isArray(localSettings[f])
|
|
69
|
+
? localSettings[f]
|
|
70
|
+
: typeof localSettings[f] == 'string'
|
|
71
|
+
? localSettings[f].split(',').map(x => x.trim())
|
|
72
|
+
: []
|
|
73
|
+
}
|
|
74
|
+
})
|
|
75
|
+
return to
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function applySettings(chatRequest) {
|
|
79
|
+
console.log('applySettings', JSON.stringify(settings.value, undefined, 2))
|
|
80
|
+
const removeFields = allFields.filter(f => !(f in settings.value))
|
|
81
|
+
removeFields.forEach(f => delete chatRequest[f])
|
|
82
|
+
Object.keys(settings.value).forEach(k => {
|
|
83
|
+
chatRequest[k] = settings.value[k]
|
|
84
|
+
})
|
|
85
|
+
console.log('applySettings.chatRequest', JSON.stringify(chatRequest, undefined, 2))
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function resetSettings() {
|
|
89
|
+
return saveSettings({})
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function saveSettings(localSettings) {
|
|
93
|
+
// console.log('saveSettings', JSON.stringify(localSettings, undefined, 2))
|
|
94
|
+
settings.value = validSettings(localSettings)
|
|
95
|
+
console.log('saveSettings.settings', JSON.stringify(settings.value, undefined, 2))
|
|
96
|
+
return storageObject(settingsKey, settings.value)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
allFields,
|
|
101
|
+
settings,
|
|
102
|
+
applySettings,
|
|
103
|
+
saveSettings,
|
|
104
|
+
resetSettings,
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default {
|
|
109
|
+
template: `
|
|
110
|
+
<div v-if="isOpen" class="fixed inset-0 z-100 overflow-y-auto" @click.self="close">
|
|
111
|
+
<div class="flex min-h-screen items-center justify-center p-4">
|
|
112
|
+
<!-- Backdrop -->
|
|
113
|
+
<div class="fixed inset-0 bg-black/40 transition-opacity" @click="close"></div>
|
|
114
|
+
|
|
115
|
+
<!-- Dialog -->
|
|
116
|
+
<div class="relative bg-white dark:bg-gray-800 rounded-lg shadow-xl max-w-2xl w-full max-h-[90vh] overflow-hidden">
|
|
117
|
+
<!-- Header -->
|
|
118
|
+
<div class="flex items-center justify-between px-6 py-4 border-b border-gray-200 dark:border-gray-700">
|
|
119
|
+
<h2 class="text-xl font-semibold text-gray-900 dark:text-gray-100">Chat Request Settings</h2>
|
|
120
|
+
<button type="button" @click="close" class="text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300">
|
|
121
|
+
<svg class="size-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
|
122
|
+
<path fill="currentColor" d="M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z"/>
|
|
123
|
+
</svg>
|
|
124
|
+
</button>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<!-- Content -->
|
|
128
|
+
<form class="px-6 py-4 overflow-y-auto max-h-[calc(90vh-140px)]" @submit.prevent="save">
|
|
129
|
+
<p class="text-sm text-gray-600 dark:text-gray-400 mb-4">
|
|
130
|
+
Configure default values for chat request options. Leave empty to use model defaults.
|
|
131
|
+
</p>
|
|
132
|
+
|
|
133
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
134
|
+
<!-- Temperature -->
|
|
135
|
+
<div>
|
|
136
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
137
|
+
Temperature
|
|
138
|
+
<span class="text-gray-500 dark:text-gray-400 font-normal">(0-2)</span>
|
|
139
|
+
</label>
|
|
140
|
+
<input type="number" v-model="localSettings.temperature"
|
|
141
|
+
step="0.1" min="0" max="2"
|
|
142
|
+
placeholder="e.g., 0.7"
|
|
143
|
+
class="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500" />
|
|
144
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Higher values more random, lower for more focus</p>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<!-- Max Completion Tokens -->
|
|
148
|
+
<div>
|
|
149
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
150
|
+
Max Completion Tokens
|
|
151
|
+
</label>
|
|
152
|
+
<input type="number" v-model="localSettings.max_completion_tokens"
|
|
153
|
+
step="1" min="1"
|
|
154
|
+
placeholder="e.g., 2048"
|
|
155
|
+
class="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500" />
|
|
156
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Max tokens for completion (inc. reasoning tokens)</p>
|
|
157
|
+
</div>
|
|
158
|
+
|
|
159
|
+
<!-- Seed -->
|
|
160
|
+
<div>
|
|
161
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
162
|
+
Seed
|
|
163
|
+
</label>
|
|
164
|
+
<input type="number" v-model="localSettings.seed"
|
|
165
|
+
step="1"
|
|
166
|
+
placeholder="e.g., 42"
|
|
167
|
+
class="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500" />
|
|
168
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">For deterministic sampling (Beta feature)</p>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
<!-- Top P -->
|
|
172
|
+
<div>
|
|
173
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
174
|
+
Top P
|
|
175
|
+
<span class="text-gray-500 dark:text-gray-400 font-normal">(0-1)</span>
|
|
176
|
+
</label>
|
|
177
|
+
<input type="number" v-model="localSettings.top_p"
|
|
178
|
+
step="0.1" min="0" max="1"
|
|
179
|
+
placeholder="e.g., 0.9"
|
|
180
|
+
class="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500" />
|
|
181
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Nucleus sampling - alternative to temperature</p>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
<!-- Frequency Penalty -->
|
|
185
|
+
<div>
|
|
186
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
187
|
+
Frequency Penalty
|
|
188
|
+
<span class="text-gray-500 dark:text-gray-400 font-normal">(-2.0 to 2.0)</span>
|
|
189
|
+
</label>
|
|
190
|
+
<input type="number" v-model="localSettings.frequency_penalty"
|
|
191
|
+
step="0.1" min="-2" max="2"
|
|
192
|
+
placeholder="e.g., 0.5"
|
|
193
|
+
class="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500" />
|
|
194
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Penalize tokens based on frequency in text</p>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
<!-- Presence Penalty -->
|
|
198
|
+
<div>
|
|
199
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
200
|
+
Presence Penalty
|
|
201
|
+
<span class="text-gray-500 dark:text-gray-400 font-normal">(-2.0 to 2.0)</span>
|
|
202
|
+
</label>
|
|
203
|
+
<input type="number" v-model="localSettings.presence_penalty"
|
|
204
|
+
step="0.1" min="-2" max="2"
|
|
205
|
+
placeholder="e.g., 0.5"
|
|
206
|
+
class="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500" />
|
|
207
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Penalize tokens based on presence in text</p>
|
|
208
|
+
</div>
|
|
209
|
+
|
|
210
|
+
<!-- Stop Sequences -->
|
|
211
|
+
<div>
|
|
212
|
+
<label for="stop" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
213
|
+
Stop Sequences
|
|
214
|
+
</label>
|
|
215
|
+
<TagInput id="stop" inputClass="h-[37px] !shadow-none"
|
|
216
|
+
v-model="localSettings.stop"
|
|
217
|
+
placeholder=""
|
|
218
|
+
label=""
|
|
219
|
+
/>
|
|
220
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Up to 4 sequences where API stops generating</p>
|
|
221
|
+
</div>
|
|
222
|
+
|
|
223
|
+
<!-- Reasoning Effort -->
|
|
224
|
+
<div>
|
|
225
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
226
|
+
Reasoning Effort
|
|
227
|
+
</label>
|
|
228
|
+
<select v-model="localSettings.reasoning_effort"
|
|
229
|
+
class="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500">
|
|
230
|
+
<option value="">Default</option>
|
|
231
|
+
<option value="minimal">Minimal</option>
|
|
232
|
+
<option value="low">Low</option>
|
|
233
|
+
<option value="medium">Medium</option>
|
|
234
|
+
<option value="high">High</option>
|
|
235
|
+
</select>
|
|
236
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Constrains effort on reasoning for reasoning models</p>
|
|
237
|
+
</div>
|
|
238
|
+
|
|
239
|
+
<!-- Verbosity -->
|
|
240
|
+
<div>
|
|
241
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
242
|
+
Verbosity
|
|
243
|
+
</label>
|
|
244
|
+
<select v-model="localSettings.verbosity"
|
|
245
|
+
class="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500">
|
|
246
|
+
<option value="">Default</option>
|
|
247
|
+
<option value="low">Low</option>
|
|
248
|
+
<option value="medium">Medium</option>
|
|
249
|
+
<option value="high">High</option>
|
|
250
|
+
</select>
|
|
251
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Constrains verbosity of model's response</p>
|
|
252
|
+
</div>
|
|
253
|
+
|
|
254
|
+
<!-- Service Tier -->
|
|
255
|
+
<div>
|
|
256
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
257
|
+
Service Tier
|
|
258
|
+
</label>
|
|
259
|
+
<input type="text" v-model="localSettings.service_tier"
|
|
260
|
+
placeholder="e.g., auto, default"
|
|
261
|
+
class="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500" />
|
|
262
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Processing type for serving the request</p>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
<!-- Top Logprobs -->
|
|
266
|
+
<div>
|
|
267
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
268
|
+
Top Logprobs
|
|
269
|
+
<span class="text-gray-500 dark:text-gray-400 font-normal">(0-20)</span>
|
|
270
|
+
</label>
|
|
271
|
+
<input type="number" v-model="localSettings.top_logprobs"
|
|
272
|
+
step="1" min="0" max="20"
|
|
273
|
+
placeholder="e.g., 5"
|
|
274
|
+
class="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500" />
|
|
275
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Number of most likely tokens to return with log probs</p>
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
<!-- Safety Identifier -->
|
|
279
|
+
<div>
|
|
280
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
|
|
281
|
+
Safety Identifier
|
|
282
|
+
</label>
|
|
283
|
+
<input type="text" v-model="localSettings.safety_identifier"
|
|
284
|
+
placeholder="Unique user identifier"
|
|
285
|
+
class="block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500" />
|
|
286
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Identifier to help detect policy violations</p>
|
|
287
|
+
</div>
|
|
288
|
+
|
|
289
|
+
<!-- Store -->
|
|
290
|
+
<div>
|
|
291
|
+
<label class="flex items-center">
|
|
292
|
+
<input type="checkbox" v-model="localSettings.store"
|
|
293
|
+
class="rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500" />
|
|
294
|
+
<span class="ml-2 text-sm font-medium text-gray-700 dark:text-gray-300">Store Output</span>
|
|
295
|
+
</label>
|
|
296
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Store output for model distillation or evals</p>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
<!-- Enable Thinking -->
|
|
300
|
+
<div>
|
|
301
|
+
<label class="flex items-center">
|
|
302
|
+
<input type="checkbox" v-model="localSettings.enable_thinking"
|
|
303
|
+
class="rounded border-gray-300 dark:border-gray-600 text-blue-600 focus:ring-blue-500" />
|
|
304
|
+
<span class="ml-2 text-sm font-medium text-gray-700 dark:text-gray-300">Enable Thinking</span>
|
|
305
|
+
</label>
|
|
306
|
+
<p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Enable thinking mode for supported models (Qwen)</p>
|
|
307
|
+
</div>
|
|
308
|
+
</div>
|
|
309
|
+
</form>
|
|
310
|
+
|
|
311
|
+
<!-- Footer -->
|
|
312
|
+
<div class="flex items-center justify-between px-6 py-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800">
|
|
313
|
+
<button type="button" @click="reset"
|
|
314
|
+
class="px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-gray-100">
|
|
315
|
+
Reset to Defaults
|
|
316
|
+
</button>
|
|
317
|
+
<div class="flex space-x-3">
|
|
318
|
+
<button type="button" @click="close"
|
|
319
|
+
class="px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 rounded-md hover:bg-gray-50 dark:hover:bg-gray-700">
|
|
320
|
+
Cancel
|
|
321
|
+
</button>
|
|
322
|
+
<button type="submit" @click="save"
|
|
323
|
+
class="px-4 py-2 text-sm font-medium text-white bg-blue-600 dark:bg-blue-500 rounded-md hover:bg-blue-700 dark:hover:bg-blue-600">
|
|
324
|
+
Save Settings
|
|
325
|
+
</button>
|
|
326
|
+
</div>
|
|
327
|
+
</div>
|
|
328
|
+
</div>
|
|
329
|
+
</div>
|
|
330
|
+
</div>
|
|
331
|
+
`,
|
|
332
|
+
props: {
|
|
333
|
+
isOpen: {
|
|
334
|
+
type: Boolean,
|
|
335
|
+
default: false
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
emits: ['close'],
|
|
339
|
+
setup(props, { emit }) {
|
|
340
|
+
const ctx = inject('ctx')
|
|
341
|
+
const { settings, saveSettings, resetSettings } = ctx.chat.settings
|
|
342
|
+
|
|
343
|
+
// Local copy for editing
|
|
344
|
+
const localSettings = ref(Object.assign({}, settings.value))
|
|
345
|
+
|
|
346
|
+
// Watch for dialog open to sync local settings
|
|
347
|
+
watch(() => props.isOpen, (isOpen) => {
|
|
348
|
+
if (isOpen) {
|
|
349
|
+
localSettings.value = Object.assign({}, settings.value)
|
|
350
|
+
}
|
|
351
|
+
})
|
|
352
|
+
|
|
353
|
+
function close() {
|
|
354
|
+
emit('close')
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function save() {
|
|
358
|
+
saveSettings(localSettings.value)
|
|
359
|
+
close()
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function reset() {
|
|
363
|
+
localSettings.value = resetSettings()
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return {
|
|
367
|
+
localSettings,
|
|
368
|
+
close,
|
|
369
|
+
save,
|
|
370
|
+
reset,
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
|