Skip to content

Commit fd15cea

Browse files
committed
perf: update default model
1 parent af07000 commit fd15cea

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/lib/components/chat/ModelSelector/ModelItem.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@
255255
>
256256
<button
257257
aria-label={`${$i18n.t('More Options')}`}
258-
class="flex"
258+
class="flex hidden"
259259
on:click={(e) => {
260260
e.preventDefault();
261261
e.stopPropagation();

src/lib/components/chat/ModelSelector/Selector.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import { flyAndScale } from '$lib/utils/transitions';
1212
import { createEventDispatcher, onMount, getContext, tick } from 'svelte';
1313
import { goto } from '$app/navigation';
14-
14+
import { updateUserSettings } from '$lib/apis/users';
1515
import ModelIcon from '$lib/components/icons/models/ModelIcon.svelte';
1616
1717
import { deleteModel, getOllamaVersion, pullModel, unloadModel } from '$lib/apis/ollama';
@@ -109,6 +109,11 @@
109109
}
110110
};
111111
112+
const saveDefaultModel = async (modelId: string) => {
113+
settings.set({ ...$settings, models: [modelId] });
114+
await updateUserSettings({ ui: $settings }, $user?.name);
115+
};
116+
112117
$: if (items) {
113118
updateFuse();
114119
}
@@ -575,6 +580,7 @@
575580
onClick={() => {
576581
value = item.value;
577582
selectedModelIdx = index;
583+
saveDefaultModel(item.value);
578584

579585
show = false;
580586
}}

0 commit comments

Comments
 (0)