add ollama package and support for ollama-hosted model

This commit is contained in:
kwaroran
2024-04-17 21:01:56 +09:00
parent e10723aec5
commit 4f8477538d
7 changed files with 61 additions and 0 deletions

View File

@@ -203,6 +203,13 @@
<span class="text-textcolor mt-4">Risu {language.apiKey}</span>
<TextInput marginBottom={false} size={"sm"} bind:value={$DataBase.proxyKey} />
{/if}
{#if $DataBase.aiModel === 'ollama-hosted'}
<span class="text-textcolor mt-4">Ollama URL</span>
<TextInput marginBottom={false} size={"sm"} bind:value={$DataBase.ollamaURL} />
<span class="text-textcolor mt-4">Ollama Model</span>
<TextInput marginBottom={false} size={"sm"} bind:value={$DataBase.ollamaModel} />
{/if}
{#if $DataBase.aiModel === 'openrouter' || $DataBase.subModel === 'openrouter'}
<span class="text-textcolor mt-4">Openrouter Key</span>
<TextInput marginBottom={false} size={"sm"} bind:value={$DataBase.openrouterKey} />

View File

@@ -132,6 +132,7 @@
{/each}
{/await}
</Arcodion>
<button class="hover:bg-selected px-6 py-2 text-lg" on:click={() => {changeModel('ollama-hosted')}}>OLlama</button>
{#if showUnrec}
<Arcodion name="WebLLM Local">
<button class="hover:bg-selected px-6 py-2 text-lg" on:click={() => {changeModel('hf:::Xenova/opt-350m')}}>opt-350m</button>