- PyInstaller frozen sidecar: spec file, build script, and ffmpeg path resolver for self-contained distribution without Python prerequisites - Dual-mode sidecar launcher: frozen binary (production) with dev mode fallback - Parallel transcription + diarization pipeline (~30-40% faster) - GPU auto-detection for diarization (CUDA when available) - Async run_pipeline command for real-time progress event delivery - Web Audio API backend for instant playback and seeking - OpenAI-compatible provider replacing LiteLLM client-side routing - Cross-platform RAM detection (Linux/macOS/Windows) - Settings: speaker count hint, token reveal toggles, dark dropdown styling - Loading splash screen, flexbox layout fix for viewport overflow - Gitea Actions CI/CD pipeline (Linux, Windows, macOS ARM) - Updated README and CLAUDE.md documentation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
73 lines
2.1 KiB
TypeScript
73 lines
2.1 KiB
TypeScript
import { writable } from 'svelte/store';
|
|
import { invoke } from '@tauri-apps/api/core';
|
|
|
|
export interface AppSettings {
|
|
ai_provider: string;
|
|
openai_api_key: string;
|
|
anthropic_api_key: string;
|
|
openai_model: string;
|
|
anthropic_model: string;
|
|
litellm_model: string;
|
|
litellm_api_key: string;
|
|
litellm_api_base: string;
|
|
local_model_path: string;
|
|
local_binary_path: string;
|
|
transcription_model: string;
|
|
transcription_device: string;
|
|
transcription_language: string;
|
|
skip_diarization: boolean;
|
|
hf_token: string;
|
|
num_speakers: number | null;
|
|
}
|
|
|
|
const defaults: AppSettings = {
|
|
ai_provider: 'local',
|
|
openai_api_key: '',
|
|
anthropic_api_key: '',
|
|
openai_model: 'gpt-4o-mini',
|
|
anthropic_model: 'claude-sonnet-4-6',
|
|
litellm_model: 'gpt-4o-mini',
|
|
litellm_api_key: '',
|
|
litellm_api_base: '',
|
|
local_model_path: '',
|
|
local_binary_path: 'llama-server',
|
|
transcription_model: 'base',
|
|
transcription_device: 'cpu',
|
|
transcription_language: '',
|
|
skip_diarization: false,
|
|
hf_token: '',
|
|
num_speakers: null,
|
|
};
|
|
|
|
export const settings = writable<AppSettings>({ ...defaults });
|
|
|
|
export async function loadSettings(): Promise<void> {
|
|
try {
|
|
const saved = await invoke<Record<string, unknown>>('load_settings');
|
|
settings.update(s => ({ ...s, ...saved } as AppSettings));
|
|
} catch {
|
|
// Use defaults if settings can't be loaded
|
|
}
|
|
}
|
|
|
|
export async function saveSettings(s: AppSettings): Promise<void> {
|
|
settings.set(s);
|
|
await invoke('save_settings', { settings: s });
|
|
|
|
// Configure the AI provider in the Python sidecar
|
|
const configMap: Record<string, Record<string, string>> = {
|
|
openai: { api_key: s.openai_api_key, model: s.openai_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 },
|
|
local: { model: s.local_model_path, base_url: 'http://localhost:8080' },
|
|
};
|
|
const config = configMap[s.ai_provider];
|
|
if (config) {
|
|
try {
|
|
await invoke('ai_configure', { provider: s.ai_provider, config });
|
|
} catch {
|
|
// Sidecar may not be running yet — provider will be configured on first use
|
|
}
|
|
}
|
|
}
|