Skip to content

Commit d3cb77a

Browse files
authored
Merge branch 'ggml-org:master' into mradermacher
2 parents b15b4f9 + 1104ca1 commit d3cb77a

File tree

8 files changed

+66
-14
lines changed

8 files changed

+66
-14
lines changed

.github/workflows/docker.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,15 @@ jobs:
8989
TYPE="-${{ matrix.config.tag }}"
9090
fi
9191
PREFIX="ghcr.io/${REPO_OWNER}/${REPO_NAME}:"
92+
CACHETAGS="${PREFIX}buildcache${TYPE}"
9293
FULLTAGS="${PREFIX}full${TYPE},${PREFIX}full${TYPE}-${{ steps.srctag.outputs.name }}"
9394
LIGHTTAGS="${PREFIX}light${TYPE},${PREFIX}light${TYPE}-${{ steps.srctag.outputs.name }}"
9495
SERVERTAGS="${PREFIX}server${TYPE},${PREFIX}server${TYPE}-${{ steps.srctag.outputs.name }}"
96+
echo "cache_output_tags=$CACHETAGS" >> $GITHUB_OUTPUT
9597
echo "full_output_tags=$FULLTAGS" >> $GITHUB_OUTPUT
9698
echo "light_output_tags=$LIGHTTAGS" >> $GITHUB_OUTPUT
9799
echo "server_output_tags=$SERVERTAGS" >> $GITHUB_OUTPUT
100+
echo "cache_output_tags=$CACHETAGS" # print out for debugging
98101
echo "full_output_tags=$FULLTAGS" # print out for debugging
99102
echo "light_output_tags=$LIGHTTAGS" # print out for debugging
100103
echo "server_output_tags=$SERVERTAGS" # print out for debugging
@@ -131,11 +134,14 @@ jobs:
131134
target: full
132135
provenance: false
133136
# using github experimental cache
134-
cache-from: type=gha
135-
cache-to: type=gha,mode=max
137+
#cache-from: type=gha
138+
#cache-to: type=gha,mode=max
136139
# return to this if the experimental github cache is having issues
137140
#cache-to: type=local,dest=/tmp/.buildx-cache
138141
#cache-from: type=local,src=/tmp/.buildx-cache
142+
# using registry cache (no storage limit)
143+
cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }}
144+
cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max
139145

140146
- name: Build and push Light Docker image (tagged + versioned)
141147
if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.light == true }}
@@ -150,11 +156,14 @@ jobs:
150156
target: light
151157
provenance: false
152158
# using github experimental cache
153-
cache-from: type=gha
154-
cache-to: type=gha,mode=max
159+
#cache-from: type=gha
160+
#cache-to: type=gha,mode=max
155161
# return to this if the experimental github cache is having issues
156162
#cache-to: type=local,dest=/tmp/.buildx-cache
157163
#cache-from: type=local,src=/tmp/.buildx-cache
164+
# using registry cache (no storage limit)
165+
cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }}
166+
cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max
158167

159168
- name: Build and push Server Docker image (tagged + versioned)
160169
if: ${{ (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.config.server == true }}
@@ -169,11 +178,14 @@ jobs:
169178
target: server
170179
provenance: false
171180
# using github experimental cache
172-
cache-from: type=gha
173-
cache-to: type=gha,mode=max
181+
#cache-from: type=gha
182+
#cache-to: type=gha,mode=max
174183
# return to this if the experimental github cache is having issues
175184
#cache-to: type=local,dest=/tmp/.buildx-cache
176185
#cache-from: type=local,src=/tmp/.buildx-cache
186+
# using registry cache (no storage limit)
187+
cache-from: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }}
188+
cache-to: type=registry,ref=${{ steps.tag.outputs.cache_output_tags }},mode=max
177189

178190
create_tag:
179191
name: Create and push git tag

tools/server/public/index.html.gz

501 Bytes
Binary file not shown.

tools/server/webui/src/lib/components/app/chat/ChatMessages/ChatMessageAssistant.svelte

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
import { useProcessingState } from '$lib/hooks/use-processing-state.svelte';
44
import { isLoading } from '$lib/stores/chat.svelte';
55
import { fade } from 'svelte/transition';
6-
import { Check, X } from '@lucide/svelte';
6+
import { Check, Copy, Package, X } from '@lucide/svelte';
77
import { Button } from '$lib/components/ui/button';
88
import { Checkbox } from '$lib/components/ui/checkbox';
99
import { INPUT_CLASSES } from '$lib/constants/input-classes';
1010
import ChatMessageActions from './ChatMessageActions.svelte';
1111
import Label from '$lib/components/ui/label/label.svelte';
12+
import { config } from '$lib/stores/settings.svelte';
13+
import { copyToClipboard } from '$lib/utils/copy';
1214
1315
interface Props {
1416
class?: string;
@@ -136,6 +138,23 @@
136138
</div>
137139
{/if}
138140

141+
{#if config().showModelInfo && message.model}
142+
<span class="mt-6 mb-4 inline-flex items-center gap-1 text-xs text-muted-foreground">
143+
<Package class="h-3.5 w-3.5" />
144+
145+
<span>Model used:</span>
146+
147+
<button
148+
class="inline-flex cursor-pointer items-center gap-1 rounded-sm bg-muted-foreground/15 px-1.5 py-0.75"
149+
onclick={() => copyToClipboard(message.model)}
150+
>
151+
{message.model}
152+
153+
<Copy class="ml-1 h-3 w-3 " />
154+
</button>
155+
</span>
156+
{/if}
157+
139158
{#if message.timestamp && !isEditing}
140159
<ChatMessageActions
141160
role="assistant"

tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettingsDialog.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@
7575
key: 'pdfAsImage',
7676
label: 'Parse PDF as image',
7777
type: 'checkbox'
78+
},
79+
{
80+
key: 'showModelInfo',
81+
label: 'Show model information',
82+
type: 'checkbox'
7883
}
7984
]
8085
},

tools/server/webui/src/lib/components/app/misc/ActionButton.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
{size}
3535
{disabled}
3636
{onclick}
37-
class="h-6 w-6 p-0 {className}"
37+
class="h-6 w-6 p-0 {className} flex"
3838
aria-label={ariaLabel || tooltip}
3939
>
4040
{@const IconComponent = icon}

tools/server/webui/src/lib/constants/settings-config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export const SETTING_CONFIG_DEFAULT: Record<string, string | number | boolean> =
1010
askForTitleConfirmation: false,
1111
pasteLongTextToFileLen: 2500,
1212
pdfAsImage: false,
13+
showModelInfo: false,
1314
// make sure these default values are in sync with `common.h`
1415
samplers: 'top_k;typ_p;top_p;min_p;temperature',
1516
temperature: 0.8,
@@ -79,6 +80,7 @@ export const SETTING_CONFIG_INFO: Record<string, string> = {
7980
askForTitleConfirmation:
8081
'Ask for confirmation before automatically changing conversation title when editing the first message.',
8182
pdfAsImage: 'Parse PDF as image instead of text (requires vision-capable model).',
83+
showModelInfo: 'Display the model name used to generate each message below the message content.',
8284
pyInterpreterEnabled:
8385
'Enable Python interpreter using Pyodide. Allows running Python code in markdown code blocks.'
8486
};

tools/server/webui/src/lib/stores/chat.svelte.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ class ChatStore {
353353

354354
await DatabaseStore.updateCurrentNode(this.activeConversation!.id, assistantMessage.id);
355355
this.activeConversation!.currNode = assistantMessage.id;
356-
357356
await this.refreshActiveMessages();
358357

359358
if (onComplete) {
@@ -479,6 +478,9 @@ class ChatStore {
479478
private async createAssistantMessage(parentId?: string): Promise<DatabaseMessage | null> {
480479
if (!this.activeConversation) return null;
481480

481+
// Capture the current model name when creating the assistant message
482+
const currentModelName = serverStore.modelName;
483+
482484
return await DatabaseStore.createMessageBranch(
483485
{
484486
convId: this.activeConversation.id,
@@ -487,7 +489,8 @@ class ChatStore {
487489
content: '',
488490
timestamp: Date.now(),
489491
thinking: '',
490-
children: []
492+
children: [],
493+
model: currentModelName || undefined
491494
},
492495
parentId || null
493496
);
@@ -1138,7 +1141,8 @@ class ChatStore {
11381141
role: messageToEdit.role,
11391142
content: newContent,
11401143
thinking: messageToEdit.thinking || '',
1141-
children: []
1144+
children: [],
1145+
model: messageToEdit.model // Preserve original model info when branching
11421146
},
11431147
messageToEdit.parent!
11441148
);
@@ -1213,7 +1217,8 @@ class ChatStore {
12131217
content: newContent,
12141218
thinking: messageToEdit.thinking || '',
12151219
children: [],
1216-
extra: messageToEdit.extra ? JSON.parse(JSON.stringify(messageToEdit.extra)) : undefined
1220+
extra: messageToEdit.extra ? JSON.parse(JSON.stringify(messageToEdit.extra)) : undefined,
1221+
model: messageToEdit.model // Preserve original model info when branching
12171222
},
12181223
parentId
12191224
);
@@ -1274,6 +1279,9 @@ class ChatStore {
12741279
this.isLoading = true;
12751280
this.currentResponse = '';
12761281

1282+
// Capture the current model name when creating the assistant message
1283+
const currentModelName = serverStore.modelName;
1284+
12771285
const newAssistantMessage = await DatabaseStore.createMessageBranch(
12781286
{
12791287
convId: this.activeConversation.id,
@@ -1282,7 +1290,8 @@ class ChatStore {
12821290
role: 'assistant',
12831291
content: '',
12841292
thinking: '',
1285-
children: []
1293+
children: [],
1294+
model: currentModelName || undefined
12861295
},
12871296
parentMessage.id
12881297
);
@@ -1329,6 +1338,9 @@ class ChatStore {
13291338
false
13301339
) as DatabaseMessage[];
13311340

1341+
// Capture the current model name when creating the assistant message
1342+
const currentModelName = serverStore.modelName;
1343+
13321344
// Create new assistant message branch
13331345
const assistantMessage = await DatabaseStore.createMessageBranch(
13341346
{
@@ -1338,7 +1350,8 @@ class ChatStore {
13381350
role: 'assistant',
13391351
content: '',
13401352
thinking: '',
1341-
children: []
1353+
children: [],
1354+
model: currentModelName || undefined
13421355
},
13431356
userMessageId
13441357
);

tools/server/webui/src/lib/types/database.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,5 @@ export interface DatabaseMessage {
5252
children: string[];
5353
extra?: DatabaseMessageExtra[];
5454
timings?: ChatMessageTimings;
55+
model?: string;
5556
}

0 commit comments

Comments
 (0)