feat: ollama support

This commit is contained in:
2026-03-01 21:31:33 +01:00
parent 4daa5f450b
commit 9fdbccc687
15 changed files with 796 additions and 25 deletions

View File

@@ -451,7 +451,7 @@ export interface ChatReadyStatus {
ready: boolean;
error?: string;
backend?: string;
providers?: { opencode: boolean; mistral: boolean };
providers?: { opencode: boolean; mistral: boolean; ollama: boolean };
}
export interface ChatApiKeyStatus {
@@ -832,6 +832,13 @@ export interface ElectronAPI {
setMistralApiKey: (apiKey: string) => Promise<{ success: boolean; error?: string }>;
getMistralApiKey: () => Promise<ChatApiKeyStatus>;
// Ollama (local)
getOllamaEnabled: () => Promise<boolean>;
setOllamaEnabled: (enabled: boolean) => Promise<{ success: boolean; error?: string }>;
getOllamaModels: () => Promise<ChatModel[]>;
getOllamaModelCapabilities: () => Promise<Record<string, { tools: boolean; vision: boolean }>>;
setOllamaModelCapabilities: (modelId: string, caps: { tools: boolean; vision: boolean }) => Promise<{ success: boolean; error?: string }>;
// Settings
getAvailableModels: () => Promise<{ success: boolean; models?: ChatModel[]; selectedModel?: string; error?: string }>;
setDefaultModel: (modelId: string) => Promise<{ success: boolean; error?: string }>;