diff --git a/src/lib/components/admin/Settings/Users.svelte b/src/lib/components/admin/Settings/Users.svelte index f2a8bb19a..44e38f40c 100644 --- a/src/lib/components/admin/Settings/Users.svelte +++ b/src/lib/components/admin/Settings/Users.svelte @@ -1,15 +1,19 @@ @@ -34,10 +39,13 @@ class="flex flex-col h-full justify-between space-y-3 text-sm" on:submit|preventDefault={async () => { // console.log('submit'); - await updateUserPermissions(localStorage.token, permissions); + await setDefaultModels(localStorage.token, defaultModelId); + await updateUserPermissions(localStorage.token, permissions); await updateModelFilterConfig(localStorage.token, whitelistEnabled, whitelistModels); saveHandler(); + + await config.set(await getBackendConfig()); }} >
@@ -88,26 +96,40 @@
-
+
{$i18n.t('Manage Models')}
+
+
+
+
{$i18n.t('Default Model')}
+
+
-
-
+
+ +
+
+ +
+
{$i18n.t('Model Whitelisting')}
- +
diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 77aeca148..d2050dd05 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -137,6 +137,7 @@ } else if ($settings?.models) { selectedModels = $settings?.models; } else if ($config?.default_models) { + console.log($config?.default_models.split(',') ?? ''); selectedModels = $config?.default_models.split(','); } else { selectedModels = ['']; @@ -204,6 +205,7 @@ system: chatContent.system ?? $settings.system, params: chatContent.options ?? $settings.params }); + autoScroll = true; await tick(); diff --git a/src/lib/components/chat/ModelSelector.svelte b/src/lib/components/chat/ModelSelector.svelte index ed7545eb1..637c9c017 100644 --- a/src/lib/components/chat/ModelSelector.svelte +++ b/src/lib/components/chat/ModelSelector.svelte @@ -24,10 +24,6 @@ settings.set({ ...$settings, models: selectedModels }); await updateUserSettings(localStorage.token, { ui: $settings }); - if ($user.role === 'admin') { - console.log('setting default models globally'); - await setDefaultModels(localStorage.token, selectedModels.join(',')); - } toast.success($i18n.t('Default model updated')); };