Skip to content

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

feat: add OpenWhispr Cloud and Groq provider support to Prompt Studio

Gabriel Steine2b8bec9e5f4
diff --git a/src/components/ui/PromptStudio.tsx b/src/components/ui/PromptStudio.tsx
index f1427de99..1d0bf6c33 100644
--- a/src/components/ui/PromptStudio.tsx
+++ b/src/components/ui/PromptStudio.tsx
@@ -35,6 +35,8 @@ const PROVIDER_CONFIG: Record<string, ProviderConfig> = {
openai: { label: "OpenAI", apiKeyStorageKey: "openaiApiKey" },
anthropic: { label: "Anthropic", apiKeyStorageKey: "anthropicApiKey" },
gemini: { label: "Gemini", apiKeyStorageKey: "geminiApiKey" },
+ groq: { label: "Groq", apiKeyStorageKey: "groqApiKey" },
+ openwhispr: { label: "OpenWhispr Cloud" },
custom: {
label: "Custom endpoint",
apiKeyStorageKey: "openaiApiKey",
@@ -121,14 +123,23 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
setTestResult("");
try {
- const useReasoningModel = localStorage.getItem("useReasoningModel") !== "false";
+ const useReasoningModel = localStorage.getItem("useReasoningModel") === "true";
+ const cloudReasoningMode = localStorage.getItem("cloudReasoningMode") || "openwhispr";
+ const isSignedIn = localStorage.getItem("isSignedIn") === "true";
+ const isCloudMode = isSignedIn && cloudReasoningMode === "openwhispr";
+
const reasoningModel = localStorage.getItem("reasoningModel") || "";
- const reasoningProvider = reasoningModel ? getModelProvider(reasoningModel) : "openai";
+ const reasoningProvider = isCloudMode
+ ? "openwhispr"
+ : reasoningModel
+ ? getModelProvider(reasoningModel)
+ : "openai";
logger.debug(
"PromptStudio test starting",
{
useReasoningModel,
+ isCloudMode,
reasoningModel,
reasoningProvider,
testTextLength: testText.length,
@@ -142,32 +153,39 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
return;
}
- if (!reasoningModel) {
+ // In BYOK mode, a model must be selected
+ if (!isCloudMode && !reasoningModel) {
setTestResult(t("promptStudio.test.noModelSelected"));
return;
}
- const providerConfig = PROVIDER_CONFIG[reasoningProvider] || {
- label: reasoningProvider.charAt(0).toUpperCase() + reasoningProvider.slice(1),
- };
-
- if (providerConfig.baseStorageKey) {
- const baseUrl = (localStorage.getItem(providerConfig.baseStorageKey) || "").trim();
- if (!baseUrl) {
- setTestResult(
- t("promptStudio.test.baseUrlMissing", {
- provider: providerConfig.label,
- })
- );
- return;
+ // In BYOK mode with custom provider, validate base URL
+ if (!isCloudMode) {
+ const providerConfig = PROVIDER_CONFIG[reasoningProvider] || {
+ label: reasoningProvider.charAt(0).toUpperCase() + reasoningProvider.slice(1),
+ };
+
+ if (providerConfig.baseStorageKey) {
+ const baseUrl = (localStorage.getItem(providerConfig.baseStorageKey) || "").trim();
+ if (!baseUrl) {
+ setTestResult(
+ t("promptStudio.test.baseUrlMissing", {
+ provider: providerConfig.label,
+ })
+ );
+ return;
+ }
}
}
+ // Cloud mode doesn't require a specific model — pass a placeholder if none is set
+ const modelToUse = isCloudMode ? reasoningModel || "auto" : reasoningModel;
+
const currentCustomPrompt = localStorage.getItem("customUnifiedPrompt");
localStorage.setItem("customUnifiedPrompt", JSON.stringify(editedPrompt));
try {
- const result = await ReasoningService.processText(testText, reasoningModel, agentName, {});
+ const result = await ReasoningService.processText(testText, modelToUse, agentName, {});
setTestResult(result);
} finally {
if (currentCustomPrompt) {
@@ -342,12 +360,25 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
{activeTab === "test" &&
(() => {
const useReasoningModel = localStorage.getItem("useReasoningModel") === "true";
+ const cloudReasoningMode = localStorage.getItem("cloudReasoningMode") || "openwhispr";
+ const isSignedIn = localStorage.getItem("isSignedIn") === "true";
+ const isCloudMode = isSignedIn && cloudReasoningMode === "openwhispr";
+
const reasoningModel = localStorage.getItem("reasoningModel") || "";
- const reasoningProvider = reasoningModel ? getModelProvider(reasoningModel) : "openai";
+ const reasoningProvider = isCloudMode
+ ? "openwhispr"
+ : reasoningModel
+ ? getModelProvider(reasoningModel)
+ : "openai";
const providerConfig = PROVIDER_CONFIG[reasoningProvider] || {
label: reasoningProvider.charAt(0).toUpperCase() + reasoningProvider.slice(1),
};
+ const displayModel = isCloudMode
+ ? t("promptStudio.test.openwhisprCloud")
+ : reasoningModel || t("promptStudio.test.none");
+ const displayProvider = providerConfig.label;
+
return (
<div className="divide-y divide-border/40 dark:divide-border-subtle">
{!useReasoningModel && (
@@ -374,7 +405,7 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
{t("promptStudio.test.modelLabel")}
</p>
<p className="text-[12px] font-medium text-foreground font-mono">
- {reasoningModel || t("promptStudio.test.none")}
+ {displayModel}
</p>
</div>
<div className="h-3 w-px bg-border/40" />
@@ -382,9 +413,7 @@ export default function PromptStudio({ className = "" }: PromptStudioProps) {
<p className="text-[11px] text-muted-foreground/60 uppercase tracking-wider">
{t("promptStudio.test.providerLabel")}
</p>
- <p className="text-[12px] font-medium text-foreground">
- {providerConfig.label}
- </p>
+ <p className="text-[12px] font-medium text-foreground">{displayProvider}</p>
</div>
</div>
</div>
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index 1ebae698d..449ae334f 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -793,6 +793,7 @@
"none": "Keine",
"outputLabel": "Ausgabe",
"processing": "Verarbeitung...",
+ "openwhisprCloud": "OpenWhispr Cloud",
"providerLabel": "Anbieter",
"run": "Test ausführen"
},
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 30aa6072d..d07e78065 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -793,6 +793,7 @@
"none": "None",
"outputLabel": "Output",
"processing": "Processing...",
+ "openwhisprCloud": "OpenWhispr Cloud",
"providerLabel": "Provider",
"run": "Run Test"
},
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index cb8d79392..4d870ccdc 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -793,6 +793,7 @@
"none": "Ninguno",
"outputLabel": "Salida",
"processing": "Procesando...",
+ "openwhisprCloud": "OpenWhispr Cloud",
"providerLabel": "Proveedor",
"run": "Ejecutar prueba"
},
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index 47098f8a6..1a263874e 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -793,6 +793,7 @@
"none": "Aucun",
"outputLabel": "Sortie",
"processing": "Traitement...",
+ "openwhisprCloud": "OpenWhispr Cloud",
"providerLabel": "Fournisseur",
"run": "Lancer le test"
},
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index 63c211c23..88e7689b5 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -793,6 +793,7 @@
"none": "Nessuno",
"outputLabel": "Output",
"processing": "Elaborazione...",
+ "openwhisprCloud": "OpenWhispr Cloud",
"providerLabel": "Provider",
"run": "Esegui test"
},
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index 0d514897f..b525b4cf9 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -765,6 +765,7 @@
"none": "Nenhum",
"outputLabel": "Saída",
"processing": "Processando...",
+ "openwhisprCloud": "OpenWhispr Cloud",
"providerLabel": "Provedor",
"run": "Executar teste"
},
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index 8e02ad487..26e1675c8 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -794,6 +794,7 @@
"none": "Нет",
"outputLabel": "Результат",
"processing": "Обработка...",
+ "openwhisprCloud": "OpenWhispr Cloud",
"providerLabel": "Провайдер",
"run": "Запустить тест"
},
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index 5e3eb481d..871c611fc 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -793,6 +793,7 @@
"none": "无",
"outputLabel": "输出",
"processing": "处理中...",
+ "openwhisprCloud": "OpenWhispr Cloud",
"providerLabel": "服务商",
"run": "运行测试"
},
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index 01f56c5a7..c98aab3cd 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -793,6 +793,7 @@
"none": "無",
"outputLabel": "輸出",
"processing": "處理中...",
+ "openwhisprCloud": "OpenWhispr Cloud",
"providerLabel": "供應商",
"run": "執行測試"
},