Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

Merge branch 'main' of https://github.com/HeroTools/open-whispr into groq-integration

Gabriel Steine835b3327760
diff --cc src/helpers/audioManager.js
index 1d09c7284,c5d358abf..f1de28ac2
--- a/src/helpers/audioManager.js
+++ b/src/helpers/audioManager.js
@@@ -536,10 -493,8 +493,8 @@@ class AudioManager
const formData = new FormData();
formData.append("file", optimizedAudio, "audio.wav");
- formData.append("model", "whisper-1");
+ formData.append("model", this.getTranscriptionModel());
- // Add language hint if set (improves processing speed)
- const language = localStorage.getItem("preferredLanguage");
if (language && language !== "auto") {
formData.append("language", language);
}
@@@ -613,34 -558,11 +558,38 @@@
}
}
+ getTranscriptionModel() {
+ try {
+ // Check if a custom model is configured
+ const customModel = typeof localStorage !== "undefined"
+ ? localStorage.getItem("cloudTranscriptionModel") || ""
+ : "";
+
+ if (customModel.trim()) {
+ return customModel.trim();
+ }
+
+ // Auto-detect model based on endpoint
+ const endpoint = typeof localStorage !== "undefined"
+ ? localStorage.getItem("cloudTranscriptionBaseUrl") || ""
+ : "";
+
+ if (endpoint.includes("groq.com")) {
+ return "whisper-large-v3-turbo"; // Groq's fast model
+ }
+
+ // Default to OpenAI's model
+ return "whisper-1";
+ } catch (error) {
+ return "whisper-1";
+ }
+ }
+
getTranscriptionEndpoint() {
+ if (this.cachedTranscriptionEndpoint) {
+ return this.cachedTranscriptionEndpoint;
+ }
+
try {
const stored = typeof localStorage !== "undefined"
? localStorage.getItem("cloudTranscriptionBaseUrl") || ""