-

+ {#if selectedModelfile && selectedModelfile.imageUrl}
+

+ {:else}
+

+ {/if}
-
- How can I help you today?
+
+ {#if selectedModelfile}
+ {selectedModelfile.desc}
+ {:else}
+ How can I help you today?
+ {/if}
{:else}
@@ -332,6 +343,12 @@
alt="User profile"
/>
{/if}
+ {:else if selectedModelfile}
+

{:else}
-
+
{#if message.role === 'user'}
You
+ {:else if selectedModelfile}
+ {selectedModelfile.title}
{:else}
Ollama
{message.model ? ` ${message.model}` : ''}
+ export let options = {
+ // Advanced
+ seed: 0,
+ stop: '',
+ temperature: '',
+ repeat_penalty: '',
+ repeat_last_n: '',
+ mirostat: '',
+ mirostat_eta: '',
+ mirostat_tau: '',
+ top_k: '',
+ top_p: '',
+ tfs_z: '',
+ num_ctx: ''
+ };
+
+
+
+
+
+
+
+
+
+
Temperature
+
+
+
+
+ {#if options.temperature !== ''}
+
+ {/if}
+
+
+
+
+
Mirostat
+
+
+
+
+ {#if options.mirostat !== ''}
+
+ {/if}
+
+
+
+
+
Mirostat Eta
+
+
+
+
+ {#if options.mirostat_eta !== ''}
+
+ {/if}
+
+
+
+
+
Mirostat Tau
+
+
+
+
+ {#if options.mirostat_tau !== ''}
+
+ {/if}
+
+
+
+
+
Top K
+
+
+
+
+ {#if options.top_k !== ''}
+
+ {/if}
+
+
+
+
+
Top P
+
+
+
+
+ {#if options.top_p !== ''}
+
+ {/if}
+
+
+
+
+
Repeat Penalty
+
+
+
+
+ {#if options.repeat_penalty !== ''}
+
+ {/if}
+
+
+
+
+
Repeat Last N
+
+
+
+
+ {#if options.repeat_last_n !== ''}
+
+ {/if}
+
+
+
+
+
Tfs Z
+
+
+
+
+ {#if options.tfs_z !== ''}
+
+ {/if}
+
+
+
+
+
Context Length
+
+
+
+
+ {#if options.num_ctx !== ''}
+
+ {/if}
+
+
diff --git a/src/lib/components/chat/SettingsModal.svelte b/src/lib/components/chat/SettingsModal.svelte
index 31da70fea..a0d538aa4 100644
--- a/src/lib/components/chat/SettingsModal.svelte
+++ b/src/lib/components/chat/SettingsModal.svelte
@@ -6,6 +6,7 @@
import { onMount } from 'svelte';
import { config, models, settings, user } from '$lib/stores';
import { splitStream, getGravatarURL } from '$lib/utils';
+ import Advanced from './Settings/Advanced.svelte';
export let show = false;
@@ -25,12 +26,21 @@
// Advanced
let requestFormat = '';
- let seed = 0;
- let temperature = '';
- let repeat_penalty = '';
- let top_k = '';
- let top_p = '';
- let num_ctx = '';
+ let options = {
+ // Advanced
+ seed: 0,
+ temperature: '',
+ repeat_penalty: '',
+ repeat_last_n: '',
+ mirostat: '',
+ mirostat_eta: '',
+ mirostat_tau: '',
+ top_k: '',
+ top_p: '',
+ stop: '',
+ tfs_z: '',
+ num_ctx: ''
+ };
// Models
let modelTag = '';
@@ -218,28 +228,6 @@
models.set(await getModels());
};
- $: if (show) {
- let settings = JSON.parse(localStorage.getItem('settings') ?? '{}');
- console.log(settings);
-
- theme = localStorage.theme ?? 'dark';
- API_BASE_URL = settings.API_BASE_URL ?? OLLAMA_API_BASE_URL;
- system = settings.system ?? '';
-
- requestFormat = settings.requestFormat ?? '';
- seed = settings.seed ?? 0;
- temperature = settings.temperature ?? '';
- repeat_penalty = settings.repeat_penalty ?? '';
- top_k = settings.top_k ?? '';
- top_p = settings.top_p ?? '';
- num_ctx = settings.num_ctx ?? '';
-
- titleAutoGenerate = settings.titleAutoGenerate ?? true;
- speechAutoSend = settings.speechAutoSend ?? false;
- gravatarEmail = settings.gravatarEmail ?? '';
- OPENAI_API_KEY = settings.OPENAI_API_KEY ?? '';
- }
-
const getModels = async (url = '', type = 'all') => {
let models = [];
const res = await fetch(`${url ? url : $settings?.API_BASE_URL ?? OLLAMA_API_BASE_URL}/tags`, {
@@ -306,6 +294,26 @@
onMount(() => {
let settings = JSON.parse(localStorage.getItem('settings') ?? '{}');
+ console.log(settings);
+
+ theme = localStorage.theme ?? 'dark';
+ API_BASE_URL = settings.API_BASE_URL ?? OLLAMA_API_BASE_URL;
+ system = settings.system ?? '';
+
+ requestFormat = settings.requestFormat ?? '';
+
+ options.seed = settings.seed ?? 0;
+ options.temperature = settings.temperature ?? '';
+ options.repeat_penalty = settings.repeat_penalty ?? '';
+ options.top_k = settings.top_k ?? '';
+ options.top_p = settings.top_p ?? '';
+ options.num_ctx = settings.num_ctx ?? '';
+ options = { ...options, ...settings.options };
+
+ titleAutoGenerate = settings.titleAutoGenerate ?? true;
+ speechAutoSend = settings.speechAutoSend ?? false;
+ gravatarEmail = settings.gravatarEmail ?? '';
+ OPENAI_API_KEY = settings.OPENAI_API_KEY ?? '';
authEnabled = settings.authHeader !== undefined ? true : false;
if (authEnabled) {
@@ -497,7 +505,7 @@
About
-
+
{#if selectedTab === 'general'}
{:else if selectedTab === 'advanced'}
-
-
-
-
-
-
-
Temperature
-
-
-
-
- {#if temperature !== ''}
-
- {/if}
-
-
-
-
-
Repeat Penalty
-
-
-
-
- {#if repeat_penalty !== ''}
-
- {/if}
-
-
-
-
-
Top K
-
-
-
-
- {#if top_k !== ''}
-
- {/if}
-
-
-
-
-
Top P
-
-
-
-
- {#if top_p !== ''}
-
- {/if}
-
-
-
-
-
Context Length
-
-
-
-
- {#if num_ctx !== ''}
-
- {/if}
-
+
+
-
diff --git a/src/lib/components/layout/Sidebar.svelte b/src/lib/components/layout/Sidebar.svelte
index 656d3f451..bb54dbc1a 100644
--- a/src/lib/components/layout/Sidebar.svelte
+++ b/src/lib/components/layout/Sidebar.svelte
@@ -24,7 +24,7 @@
let showDropdown = false;
- let showDeleteHistoryConfirm = false;
+ let showDeleteHistoryConfirm = false;
onMount(async () => {
if (window.innerWidth > 1280) {
@@ -121,11 +121,11 @@
-
+
@@ -449,91 +449,92 @@
Export
- {#if showDeleteHistoryConfirm}
-
-
-
-
-
-
-
-
- {:else}
-
- {/if}
+ {#if showDeleteHistoryConfirm}
+
+
+
+
+
+
+
+
+ {:else}
+
+ {/if}
{#if $user !== undefined}
-
+
-
+
diff --git a/src/routes/(app)/c/[id]/+page.svelte b/src/routes/(app)/c/[id]/+page.svelte
index e6539e8d9..c8ab7882b 100644
--- a/src/routes/(app)/c/[id]/+page.svelte
+++ b/src/routes/(app)/c/[id]/+page.svelte
@@ -6,7 +6,7 @@
import { onMount, tick } from 'svelte';
import { convertMessagesToHistory, splitStream } from '$lib/utils';
import { goto } from '$app/navigation';
- import { config, user, settings, db, chats, chatId } from '$lib/stores';
+ import { config, modelfiles, user, settings, db, chats, chatId } from '$lib/stores';
import MessageInput from '$lib/components/chat/MessageInput.svelte';
import Messages from '$lib/components/chat/Messages.svelte';
@@ -20,6 +20,12 @@
// let chatId = $page.params.id;
let selectedModels = [''];
+ let selectedModelfile = null;
+ $: selectedModelfile =
+ selectedModels.length === 1 &&
+ $modelfiles.filter((modelfile) => modelfile.tagName === selectedModels[0]).length > 0
+ ? $modelfiles.filter((modelfile) => modelfile.tagName === selectedModels[0])[0]
+ : null;
let title = '';
let prompt = '';
@@ -161,7 +167,8 @@
repeat_penalty: $settings.repeat_penalty ?? undefined,
top_k: $settings.top_k ?? undefined,
top_p: $settings.top_p ?? undefined,
- num_ctx: $settings.num_ctx ?? undefined
+ num_ctx: $settings.num_ctx ?? undefined,
+ ...($settings.options ?? {})
},
format: $settings.requestFormat ?? undefined,
context:
@@ -233,7 +240,8 @@
repeat_penalty: $settings.repeat_penalty ?? undefined,
top_k: $settings.top_k ?? undefined,
top_p: $settings.top_p ?? undefined,
- num_ctx: $settings.num_ctx ?? undefined
+ num_ctx: $settings.num_ctx ?? undefined,
+ ...($settings.options ?? {})
},
messages: messages,
history: history
@@ -301,7 +309,7 @@
.map((message) => ({ role: message.role, content: message.content })),
temperature: $settings.temperature ?? undefined,
top_p: $settings.top_p ?? undefined,
- num_ctx: $settings.num_ctx ?? undefined,
+ num_ctx: $settings.num_ctx ?? undefined,
frequency_penalty: $settings.repeat_penalty ?? undefined
})
});
@@ -362,7 +370,8 @@
repeat_penalty: $settings.repeat_penalty ?? undefined,
top_k: $settings.top_k ?? undefined,
top_p: $settings.top_p ?? undefined,
- num_ctx: $settings.num_ctx ?? undefined
+ num_ctx: $settings.num_ctx ?? undefined,
+ ...($settings.options ?? {})
},
messages: messages,
history: history
@@ -424,7 +433,8 @@
repeat_penalty: $settings.repeat_penalty ?? undefined,
top_k: $settings.top_k ?? undefined,
top_p: $settings.top_p ?? undefined,
- num_ctx: $settings.num_ctx ?? undefined
+ num_ctx: $settings.num_ctx ?? undefined,
+ ...($settings.options ?? {})
},
messages: messages,
history: history
@@ -517,10 +527,42 @@
-
+
-