Settings: replace llama-server with Ollama, remove Local AI tab, rename Developer to Debug
- AI Provider: "Local (llama-server)" changed to "Ollama" with URL and model fields (defaults to localhost:11434, llama3.2) - Ollama connects via its OpenAI-compatible API (/v1 endpoint) - Removed empty "Local AI" tab - Renamed "Developer" tab to "Debug" Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
let { visible, onClose }: Props = $props();
|
let { visible, onClose }: Props = $props();
|
||||||
|
|
||||||
let localSettings = $state<AppSettings>({ ...$settings });
|
let localSettings = $state<AppSettings>({ ...$settings });
|
||||||
let activeTab = $state<'transcription' | 'speakers' | 'ai' | 'local' | 'developer'>('transcription');
|
let activeTab = $state<'transcription' | 'speakers' | 'ai' | 'debug'>('transcription');
|
||||||
let modelStatus = $state<'idle' | 'downloading' | 'success' | 'error'>('idle');
|
let modelStatus = $state<'idle' | 'downloading' | 'success' | 'error'>('idle');
|
||||||
let modelError = $state('');
|
let modelError = $state('');
|
||||||
let revealedFields = $state<Set<string>>(new Set());
|
let revealedFields = $state<Set<string>>(new Set());
|
||||||
@@ -81,11 +81,8 @@
|
|||||||
<button class="tab" class:active={activeTab === 'ai'} onclick={() => activeTab = 'ai'}>
|
<button class="tab" class:active={activeTab === 'ai'} onclick={() => activeTab = 'ai'}>
|
||||||
AI Provider
|
AI Provider
|
||||||
</button>
|
</button>
|
||||||
<button class="tab" class:active={activeTab === 'local'} onclick={() => activeTab = 'local'}>
|
<button class="tab" class:active={activeTab === 'debug'} onclick={() => activeTab = 'debug'}>
|
||||||
Local AI
|
Debug
|
||||||
</button>
|
|
||||||
<button class="tab" class:active={activeTab === 'developer'} onclick={() => activeTab = 'developer'}>
|
|
||||||
Developer
|
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -184,14 +181,27 @@
|
|||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="ai-provider">AI Provider</label>
|
<label for="ai-provider">AI Provider</label>
|
||||||
<select id="ai-provider" bind:value={localSettings.ai_provider}>
|
<select id="ai-provider" bind:value={localSettings.ai_provider}>
|
||||||
<option value="local">Local (llama-server)</option>
|
<option value="local">Ollama</option>
|
||||||
<option value="openai">OpenAI</option>
|
<option value="openai">OpenAI</option>
|
||||||
<option value="anthropic">Anthropic</option>
|
<option value="anthropic">Anthropic</option>
|
||||||
<option value="litellm">OpenAI Compatible</option>
|
<option value="litellm">OpenAI Compatible</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if localSettings.ai_provider === 'openai'}
|
{#if localSettings.ai_provider === 'local'}
|
||||||
|
<div class="field">
|
||||||
|
<label for="ollama-url">Ollama URL</label>
|
||||||
|
<input id="ollama-url" type="text" bind:value={localSettings.ollama_url} placeholder="http://localhost:11434" />
|
||||||
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label for="ollama-model">Model</label>
|
||||||
|
<input id="ollama-model" type="text" bind:value={localSettings.ollama_model} placeholder="llama3.2" />
|
||||||
|
</div>
|
||||||
|
<p class="hint">
|
||||||
|
Install Ollama from ollama.com, then pull a model with <code>ollama pull llama3.2</code>.
|
||||||
|
The app connects via Ollama's OpenAI-compatible API.
|
||||||
|
</p>
|
||||||
|
{:else if localSettings.ai_provider === 'openai'}
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label for="openai-key">OpenAI API Key</label>
|
<label for="openai-key">OpenAI API Key</label>
|
||||||
<div class="input-reveal">
|
<div class="input-reveal">
|
||||||
@@ -232,20 +242,7 @@
|
|||||||
<input id="litellm-model" type="text" bind:value={localSettings.litellm_model} placeholder="provider/model-name" />
|
<input id="litellm-model" type="text" bind:value={localSettings.litellm_model} placeholder="provider/model-name" />
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else if activeTab === 'debug'}
|
||||||
<div class="field">
|
|
||||||
<label for="llama-binary">llama-server Binary Path</label>
|
|
||||||
<input id="llama-binary" type="text" bind:value={localSettings.local_binary_path} placeholder="llama-server" />
|
|
||||||
</div>
|
|
||||||
<div class="field">
|
|
||||||
<label for="llama-model">GGUF Model Path</label>
|
|
||||||
<input id="llama-model" type="text" bind:value={localSettings.local_model_path} placeholder="~/.voicetonotes/models/model.gguf" />
|
|
||||||
</div>
|
|
||||||
<p class="hint">
|
|
||||||
Place GGUF model files in ~/.voicetonotes/models/ for auto-detection.
|
|
||||||
The local AI server uses the OpenAI-compatible API from llama.cpp.
|
|
||||||
</p>
|
|
||||||
{:else if activeTab === 'developer'}
|
|
||||||
<div class="field checkbox">
|
<div class="field checkbox">
|
||||||
<label>
|
<label>
|
||||||
<input
|
<input
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ export interface AppSettings {
|
|||||||
litellm_model: string;
|
litellm_model: string;
|
||||||
litellm_api_key: string;
|
litellm_api_key: string;
|
||||||
litellm_api_base: string;
|
litellm_api_base: string;
|
||||||
local_model_path: string;
|
ollama_url: string;
|
||||||
local_binary_path: string;
|
ollama_model: string;
|
||||||
transcription_model: string;
|
transcription_model: string;
|
||||||
transcription_device: string;
|
transcription_device: string;
|
||||||
transcription_language: string;
|
transcription_language: string;
|
||||||
@@ -30,8 +30,8 @@ const defaults: AppSettings = {
|
|||||||
litellm_model: 'gpt-4o-mini',
|
litellm_model: 'gpt-4o-mini',
|
||||||
litellm_api_key: '',
|
litellm_api_key: '',
|
||||||
litellm_api_base: '',
|
litellm_api_base: '',
|
||||||
local_model_path: '',
|
ollama_url: 'http://localhost:11434',
|
||||||
local_binary_path: 'llama-server',
|
ollama_model: 'llama3.2',
|
||||||
transcription_model: 'base',
|
transcription_model: 'base',
|
||||||
transcription_device: 'cpu',
|
transcription_device: 'cpu',
|
||||||
transcription_language: '',
|
transcription_language: '',
|
||||||
@@ -61,7 +61,7 @@ export async function saveSettings(s: AppSettings): Promise<void> {
|
|||||||
openai: { api_key: s.openai_api_key, model: s.openai_model },
|
openai: { api_key: s.openai_api_key, model: s.openai_model },
|
||||||
anthropic: { api_key: s.anthropic_api_key, model: s.anthropic_model },
|
anthropic: { api_key: s.anthropic_api_key, model: s.anthropic_model },
|
||||||
litellm: { api_key: s.litellm_api_key, api_base: s.litellm_api_base, model: s.litellm_model },
|
litellm: { api_key: s.litellm_api_key, api_base: s.litellm_api_base, model: s.litellm_model },
|
||||||
local: { model: s.local_model_path, base_url: 'http://localhost:8080' },
|
local: { model: s.ollama_model, base_url: s.ollama_url + '/v1' },
|
||||||
};
|
};
|
||||||
const config = configMap[s.ai_provider];
|
const config = configMap[s.ai_provider];
|
||||||
if (config) {
|
if (config) {
|
||||||
|
|||||||
Reference in New Issue
Block a user