Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.
JavaScript aianthropiccross-platformgeminigroqlinuxmacosnvidiaopen-sourceopenaiparakeetspeech-to-texttranscribewhisperwindows
feat: added mistral and llama, cleaned up logging
Gabriel Stein4bde0c2db1fd
diff --git a/main.js b/main.jsindex 1ca8d8ff5..88a7b1044 100644--- a/main.js+++ b/main.js@@ -122,10 +122,6 @@ async function startApp() {// App event handlersapp.whenReady().then(() => {- // Only log debug status in development- if (DebugLogger.isEnabled() && process.env.NODE_ENV === 'development') {- console.log(`Debug logging enabled: ${DebugLogger.getLogPath()}`);- }startApp();});diff --git a/src/App.jsx b/src/App.jsxindex e5fea7b41..68208713f 100644--- a/src/App.jsx+++ b/src/App.jsx@@ -144,9 +144,6 @@ export default function App() {const processAudio = async (audioBlob) => {try {- console.log(`π§ [App] π¬ Starting audio processing...`);-- // Use our enhanced AudioManager with reasoning supportconst audioManager = new AudioManager();audioManager.setCallbacks({onStateChange: ({ isRecording, isProcessing }) => {@@ -161,9 +158,6 @@ export default function App() {});},onTranscriptionComplete: async (result) => {- console.log(- `π§ [App] β Transcription completed with source: ${result.source}`- );if (result.success && result.text) {setTranscript(result.text);@@ -174,7 +168,7 @@ export default function App() {const savePromise = window.electronAPI.saveTranscription(result.text).catch((err) => {- console.error("Failed to save transcription:", err);+ // Failed to save transcription});// Wait for paste to complete, but don't block on database save@@ -186,7 +180,6 @@ export default function App() {// Process the audio using our enhanced AudioManagerawait audioManager.processAudio(audioBlob);} catch (err) {- console.error(`π§ [App] β Transcription error:`, err);toast({title: "Transcription Error",description: "Transcription failed: " + err.message,diff --git a/src/components/SettingsPage.tsx b/src/components/SettingsPage.tsxindex 8cbdfdbdc..9e818c24b 100644--- a/src/components/SettingsPage.tsx+++ b/src/components/SettingsPage.tsx@@ -115,6 +115,16 @@ export default function SettingsPage({const statusResult = await window.electronAPI?.getUpdateStatus();if (statusResult && mounted) {setUpdateStatus(statusResult);+ if (statusResult.updateAvailable) {+ const updateInfoResult = await window.electronAPI?.getUpdateInfo?.();+ if (updateInfoResult) {+ setUpdateInfo({+ version: updateInfoResult.version || 'unknown',+ releaseDate: updateInfoResult.releaseDate,+ releaseNotes: updateInfoResult.releaseNotes,+ });+ }+ }subscribeToUpdates();}@@ -141,11 +151,13 @@ export default function SettingsPage({if (window.electronAPI) {const handleUpdateAvailable = (event, info) => {setUpdateStatus((prev) => ({ ...prev, updateAvailable: true }));- setUpdateInfo({- version: info.version,- releaseDate: info.releaseDate,- releaseNotes: info.releaseNotes,- });+ if (info) {+ setUpdateInfo({+ version: info.version || 'unknown',+ releaseDate: info.releaseDate,+ releaseNotes: info.releaseNotes,+ });+ }};const handleUpdateDownloaded = (event, info) => {@@ -407,7 +419,7 @@ export default function SettingsPage({) : (<><Download size={16} className="mr-2" />- Download Update v{updateInfo.version}+ Download Update {updateInfo.version ? `v${updateInfo.version}` : ''}</>)}</Button>@@ -418,7 +430,7 @@ export default function SettingsPage({onClick={async () => {showConfirmDialog({title: "Install Update",- description: `Ready to install update v${updateInfo.version}. The app will restart to complete installation.`,+ description: `Ready to install update${updateInfo.version ? ` v${updateInfo.version}` : ''}. The app will restart to complete installation.`,onConfirm: async () => {try {await window.electronAPI?.installUpdate();diff --git a/src/helpers/environment.js b/src/helpers/environment.jsindex 3933c153c..23be33a59 100644--- a/src/helpers/environment.js+++ b/src/helpers/environment.js@@ -48,7 +48,7 @@ class EnvironmentManager {process.env.OPENAI_API_KEY = key;return { success: true };} catch (error) {- console.error("Error saving OpenAI API key:", error.message);+ // Silent error - already throwingthrow error;}}@@ -64,7 +64,7 @@ class EnvironmentManager {process.env.ANTHROPIC_API_KEY = key;return { success: true };} catch (error) {- console.error("Error saving Anthropic API key:", error.message);+ // Silent error - already throwingthrow error;}}@@ -80,7 +80,7 @@ class EnvironmentManager {process.env.GEMINI_API_KEY = key;return { success: true };} catch (error) {- console.error("Error saving Gemini API key:", error.message);+ // Silent error - already throwingthrow error;}}@@ -100,7 +100,7 @@ OPENAI_API_KEY=${apiKey}return { success: true, path: envPath };} catch (error) {- console.error("Error creating production .env file:", error.message);+ // Silent error - already throwingthrow error;}}diff --git a/src/models/ModelRegistry.ts b/src/models/ModelRegistry.tsindex 96f0aa70f..aec24109f 100644--- a/src/models/ModelRegistry.ts+++ b/src/models/ModelRegistry.ts@@ -144,15 +144,150 @@ ${text}<|im_end|>}});- // Future: Add Mistral provider- // this.registerProvider({- // id: 'mistral',- // name: 'Mistral AI',- // baseUrl: 'https://huggingface.co',- // models: [...],- // formatPrompt: ...,- // getDownloadUrl: ...- // });+ this.registerProvider({+ id: 'mistral',+ name: 'Mistral AI',+ baseUrl: 'https://huggingface.co',+ models: [+ {+ id: 'mistral-7b-instruct-v0.3-q4_k_m',+ name: 'Mistral 7B Instruct v0.3',+ size: '4.4GB',+ sizeBytes: 4724956928,+ description: 'Fast and efficient instruction model',+ fileName: 'Mistral-7B-Instruct-v0.3-Q4_K_M.gguf',+ quantization: 'q4_k_m',+ contextLength: 32768,+ recommended: true,+ },+ {+ id: 'mistral-7b-instruct-v0.3-q5_k_m',+ name: 'Mistral 7B Instruct v0.3 (Q5)',+ size: '5.1GB',+ sizeBytes: 5477387264,+ description: 'Higher quality instruction model',+ fileName: 'Mistral-7B-Instruct-v0.3-Q5_K_M.gguf',+ quantization: 'q5_k_m',+ contextLength: 32768,+ },+ {+ id: 'mistral-7b-v0.1-q4_k_m',+ name: 'Mistral 7B v0.1',+ size: '4.4GB',+ sizeBytes: 4724956928,+ description: 'Base model for general text',+ fileName: 'mistral-7b-v0.1.Q4_K_M.gguf',+ quantization: 'q4_k_m',+ contextLength: 32768,+ },+ ],+ formatPrompt(text: string, systemPrompt: string): string {+ return `[INST] ${systemPrompt}\n\n${text} [/INST]`;+ },+ getDownloadUrl(model: ModelDefinition): string {+ if (model.id.includes('v0.3')) {+ return `${this.baseUrl}/bartowski/Mistral-7B-Instruct-v0.3-GGUF/resolve/main/${model.fileName}`;+ }+ return `${this.baseUrl}/TheBloke/Mistral-7B-v0.1-GGUF/resolve/main/${model.fileName}`;+ }+ });++ // Llama Provider+ this.registerProvider({+ id: 'llama',+ name: 'Meta Llama',+ baseUrl: 'https://huggingface.co',+ models: [+ {+ id: 'llama-3.2-1b-instruct-q4_k_m',+ name: 'Llama 3.2 1B',+ size: '0.9GB',+ sizeBytes: 966367642,+ description: 'Tiny model for edge devices',+ fileName: 'Llama-3.2-1B-Instruct-Q4_K_M.gguf',+ quantization: 'q4_k_m',+ contextLength: 131072,+ },+ {+ id: 'llama-3.2-3b-instruct-q4_k_m',+ name: 'Llama 3.2 3B',+ size: '2.0GB',+ sizeBytes: 2147483648,+ description: 'Small but capable multilingual model',+ fileName: 'Llama-3.2-3B-Instruct-Q4_K_M.gguf',+ quantization: 'q4_k_m',+ contextLength: 131072,+ recommended: true,+ },+ {+ id: 'llama-3.1-8b-instruct-q4_k_m',+ name: 'Llama 3.1 8B',+ size: '4.9GB',+ sizeBytes: 5260091802,+ description: 'Powerful model with great performance',+ fileName: 'Meta-Llama-3.1-8B-Instruct-Q4_K_M.gguf',+ quantization: 'q4_k_m',+ contextLength: 131072,+ },+ ],+ formatPrompt(text: string, systemPrompt: string): string {+ return `<|begin_of_text|><|start_header_id|>system<|end_header_id|>++${systemPrompt}<|eot_id|><|start_header_id|>user<|end_header_id|>++${text}<|eot_id|><|start_header_id|>assistant<|end_header_id|>++`;+ },+ getDownloadUrl(model: ModelDefinition): string {+ if (model.id.includes('3.2')) {+ return `${this.baseUrl}/bartowski/Llama-3.2-${model.name.split(' ')[2]}-Instruct-GGUF/resolve/main/${model.fileName}`;+ }+ return `${this.baseUrl}/bartowski/Meta-Llama-3.1-8B-Instruct-GGUF/resolve/main/${model.fileName}`;+ }+ });++ // OpenAI OSS Provider+ this.registerProvider({+ id: 'openai-oss',+ name: 'OpenAI OSS',+ baseUrl: 'https://huggingface.co',+ models: [+ {+ id: 'gpt-oss-20b-q4_k_m',+ name: 'GPT-OSS 20B',+ size: '12.1GB',+ sizeBytes: 12999763968,+ description: 'OpenAI\'s open-source model for consumer hardware',+ fileName: 'openai_gpt-oss-20b-Q4_K_M.gguf',+ quantization: 'q4_k_m',+ contextLength: 128000,+ recommended: true,+ },+ {+ id: 'gpt-oss-20b-q5_k_m',+ name: 'GPT-OSS 20B (Q5)',+ size: '14.7GB',+ sizeBytes: 15783559168,+ description: 'Higher quality OpenAI model',+ fileName: 'openai_gpt-oss-20b-Q5_K_M.gguf',+ quantization: 'q5_k_m',+ contextLength: 128000,+ },+ ],+ formatPrompt(text: string, systemPrompt: string): string {+ // GPT-OSS uses ChatML format+ return `<|im_start|>system+${systemPrompt}<|im_end|>+<|im_start|>user+${text}<|im_end|>+<|im_start|>assistant+`;+ },+ getDownloadUrl(model: ModelDefinition): string {+ return `${this.baseUrl}/bartowski/openai_gpt-oss-20b-GGUF/resolve/main/${model.fileName}`;+ }+ });}}diff --git a/src/services/ReasoningService.ts b/src/services/ReasoningService.tsindex 044a66e69..07ad02a6e 100644--- a/src/services/ReasoningService.ts+++ b/src/services/ReasoningService.ts@@ -33,7 +33,7 @@ class ReasoningService extends BaseReasoningService {this.apiKeyCache.set(provider, apiKey);}} catch (error) {- console.error(`Failed to retrieve ${provider} API key:`, error);+ // API key retrieval failed}}@@ -66,7 +66,7 @@ class ReasoningService extends BaseReasoningService {throw new Error(`Unsupported reasoning provider: ${provider}`);}} catch (error) {- console.error(`ReasoningService error (${provider}):`, (error as Error).message);+ // Re-throw error with provider contextthrow error;}}diff --git a/src/updater.js b/src/updater.jsindex 891e380a8..147d78833 100644--- a/src/updater.js+++ b/src/updater.js@@ -20,7 +20,7 @@ class UpdateManager {setupAutoUpdater() {// Only configure auto-updater in productionif (process.env.NODE_ENV === "development") {- console.log("β οΈ Auto-updater disabled in development mode");+ // Auto-updater disabled in development modereturn;}@@ -32,31 +32,24 @@ class UpdateManager {private: false,});- // Auto-updater logging- autoUpdater.logger = console;+ autoUpdater.logger = null;// Set up event handlersthis.setupEventHandlers();}setupEventHandlers() {- autoUpdater.on("checking-for-update", () => {- console.log("π Checking for updates...");- });+ autoUpdater.on("checking-for-update", () => {});autoUpdater.on("update-available", (info) => {- console.log("π₯ Update available:", info);this.updateAvailable = true;- // Send notification to renderer processesthis.notifyRenderers("update-available", info);});autoUpdater.on("update-not-available", (info) => {- console.log("β Update not available:", info);this.updateAvailable = false;- // Send notification to renderer processesthis.notifyRenderers("update-not-available", info);});@@ -65,25 +58,16 @@ class UpdateManager {this.updateAvailable = false;this.updateDownloaded = false;- // Send error notification to renderer processesthis.notifyRenderers("update-error", err);});autoUpdater.on("download-progress", (progressObj) => {- let logMessage = `π Download speed: ${progressObj.bytesPerSecond}`;- logMessage += ` - Downloaded ${progressObj.percent}%`;- logMessage += ` (${progressObj.transferred}/${progressObj.total})`;- console.log(logMessage);-- // Send progress to renderer processesthis.notifyRenderers("update-download-progress", progressObj);});autoUpdater.on("update-downloaded", (info) => {- console.log("β Update downloaded:", info);this.updateDownloaded = true;- // Send notification to renderer processesthis.notifyRenderers("update-downloaded", info);});}@@ -102,14 +86,12 @@ class UpdateManager {ipcMain.handle("check-for-updates", async () => {try {if (process.env.NODE_ENV === "development") {- console.log("β οΈ Update check skipped in development mode");return {updateAvailable: false,message: "Update checks are disabled in development mode",};}- console.log("π Manual update check requested...");const result = await autoUpdater.checkForUpdates();if (result && result.updateInfo) {@@ -122,7 +104,6 @@ class UpdateManager {releaseNotes: result.updateInfo.releaseNotes,};} else {- console.log("β No updates available");return {updateAvailable: false,message: "You are running the latest version",@@ -138,14 +119,12 @@ class UpdateManager {ipcMain.handle("download-update", async () => {try {if (process.env.NODE_ENV === "development") {- console.log("β οΈ Update download skipped in development mode");return {success: false,message: "Update downloads are disabled in development mode",};}- console.log("π₯ Manual update download requested...");await autoUpdater.downloadUpdate();return { success: true, message: "Update download started" };@@ -175,7 +154,7 @@ class UpdateManager {}console.log("π Installing update and restarting...");-+// Use setImmediate to ensure the response is sent before quittingsetImmediate(() => {autoUpdater.quitAndInstall();@@ -188,7 +167,6 @@ class UpdateManager {}});- // Get app versionipcMain.handle("get-app-version", async () => {try {const { app } = require("electron");@@ -200,7 +178,6 @@ class UpdateManager {}});- // Get update statusipcMain.handle("get-update-status", async () => {try {return {