Skip to content

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

refactor: use model registry for disableThinking flag

Claude3c04be0d4f65
diff --git a/src/models/ModelRegistry.ts b/src/models/ModelRegistry.ts
index 7b5048af8..e4a9afdd8 100644
--- a/src/models/ModelRegistry.ts
+++ b/src/models/ModelRegistry.ts
@@ -34,6 +34,7 @@ export interface CloudModelDefinition {
id: string;
name: string;
description: string;
+ disableThinking?: boolean;
}
export interface CloudProviderData {
@@ -276,3 +277,11 @@ export function getWhisperModelInfo(modelId: string): WhisperModelInfo | undefin
}
export const WHISPER_MODEL_INFO = modelData.whisperModels;
+
+export function getCloudModel(modelId: string): CloudModelDefinition | undefined {
+ for (const provider of modelData.cloudProviders) {
+ const model = provider.models.find((m) => m.id === modelId);
+ if (model) return model;
+ }
+ return undefined;
+}
diff --git a/src/models/modelRegistryData.json b/src/models/modelRegistryData.json
index 15f9bd8a9..2994dfdd8 100644
--- a/src/models/modelRegistryData.json
+++ b/src/models/modelRegistryData.json
@@ -160,7 +160,8 @@
{
"id": "qwen/qwen3-32b",
"name": "Qwen3 32B",
- "description": "Powerful reasoning model, 131K context"
+ "description": "Powerful reasoning model, 131K context",
+ "disableThinking": true
},
{
"id": "openai/gpt-oss-120b",
diff --git a/src/services/ReasoningService.ts b/src/services/ReasoningService.ts
index dae5e091b..f3eebc591 100644
--- a/src/services/ReasoningService.ts
+++ b/src/services/ReasoningService.ts
@@ -1,4 +1,4 @@
-import { getModelProvider } from "../models/ModelRegistry";
+import { getModelProvider, getCloudModel } from "../models/ModelRegistry";
import { BaseReasoningService, ReasoningConfig } from "./BaseReasoningService";
import { SecureCache } from "../utils/SecureCache";
import { withRetry, createApiRetryStrategy } from "../utils/retry";
@@ -235,11 +235,11 @@ class ReasoningService extends BaseReasoningService {
),
};
- // Disable thinking mode for Qwen models on Groq
- // Thinking mode outputs internal reasoning which we don't want in dictation output
- if (providerName === "Groq" && model.toLowerCase().includes("qwen")) {
+ // Check model registry for provider-specific options
+ const modelDef = getCloudModel(model);
+ if (modelDef?.disableThinking) {
requestBody.chat_template_kwargs = { enable_thinking: false };
- logger.logReasoning("GROQ_QWEN_THINKING_DISABLED", { model });
+ logger.logReasoning("THINKING_DISABLED", { model, provider: providerName });
}
logger.logReasoning(`${providerName.toUpperCase()}_REQUEST`, {