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
refactor: redesign provider tabs as compact pill buttons
Gabriel Stein3e26ba224d6c
diff --git a/src/components/LocalModelPicker.tsx b/src/components/LocalModelPicker.tsxindex 96d63bae4..23b66c00e 100644--- a/src/components/LocalModelPicker.tsx+++ b/src/components/LocalModelPicker.tsx@@ -155,7 +155,7 @@ export default function LocalModelPicker({}, [downloadingModel, downloadProgress, models]);return (- <div className={`${styles.container} ${className}`}>+ <div className={className}><ProviderTabsproviders={providers}selectedId={selectedProvider}@@ -166,7 +166,7 @@ export default function LocalModelPicker({{progressDisplay}- <div className="p-3">+ <div className="mt-2"><h5 className={`${styles.header} mb-2`}>{t("common.availableModels")}</h5><ModelCardListdiff --git a/src/components/ReasoningModelSelector.tsx b/src/components/ReasoningModelSelector.tsxindex 682d5d9eb..2b63cf305 100644--- a/src/components/ReasoningModelSelector.tsx+++ b/src/components/ReasoningModelSelector.tsx@@ -753,236 +753,230 @@ export default function ReasoningModelSelector({{effectiveMode === "cloud" ? (<div className="space-y-2">- <div className="border border-border rounded-lg overflow-hidden">- <ProviderTabs- providers={cloudProviders}- selectedId={selectedCloudProvider}- onSelect={handleCloudProviderChange}- colorScheme="purple"- />-- <div className="p-3">- {selectedCloudProvider === "custom" ? (- <>- <div className="space-y-2">- <h4 className="font-medium text-foreground">- {t("reasoning.custom.endpointTitle")}- </h4>- <Input- value={customBaseInput}- onChange={(event) => setCustomBaseInput(event.target.value)}- onBlur={handleBaseUrlBlur}- placeholder="https://api.openai.com/v1"- className="text-sm"- />- <p className="text-xs text-muted-foreground">- {t("reasoning.custom.endpointExamples")}{" "}- <code className="text-primary">http://localhost:11434/v1</code>{" "}- {t("reasoning.custom.ollama")},{" "}- <code className="text-primary">http://localhost:8080/v1</code>{" "}- {t("reasoning.custom.localAi")}.- </p>- </div>+ <ProviderTabs+ providers={cloudProviders}+ selectedId={selectedCloudProvider}+ onSelect={handleCloudProviderChange}+ colorScheme="purple"+ />- <div className="space-y-2 pt-3">- <h4 className="font-medium text-foreground">- {t("reasoning.custom.apiKeyOptional")}+ <div>+ {selectedCloudProvider === "custom" ? (+ <>+ <div className="space-y-2">+ <h4 className="font-medium text-foreground">+ {t("reasoning.custom.endpointTitle")}+ </h4>+ <Input+ value={customBaseInput}+ onChange={(event) => setCustomBaseInput(event.target.value)}+ onBlur={handleBaseUrlBlur}+ placeholder="https://api.openai.com/v1"+ className="text-sm"+ />+ <p className="text-xs text-muted-foreground">+ {t("reasoning.custom.endpointExamples")}{" "}+ <code className="text-primary">http://localhost:11434/v1</code>{" "}+ {t("reasoning.custom.ollama")},{" "}+ <code className="text-primary">http://localhost:8080/v1</code>{" "}+ {t("reasoning.custom.localAi")}.+ </p>+ </div>++ <div className="space-y-2 pt-3">+ <h4 className="font-medium text-foreground">+ {t("reasoning.custom.apiKeyOptional")}+ </h4>+ <ApiKeyInput+ apiKey={customReasoningApiKey}+ setApiKey={setCustomReasoningApiKey || (() => {})}+ label=""+ helpText={t("reasoning.custom.apiKeyHelp")}+ />+ </div>++ <div className="space-y-2 pt-3">+ <div className="flex items-center justify-between">+ <h4 className="text-sm font-medium text-foreground">+ {t("reasoning.availableModels")}</h4>+ <div className="flex gap-2">+ <Button+ type="button"+ size="sm"+ variant="outline"+ onClick={handleResetCustomBase}+ className="text-xs"+ >+ {t("common.reset")}+ </Button>+ <Button+ type="button"+ size="sm"+ variant="outline"+ onClick={handleRefreshCustomModels}+ disabled={+ customModelsLoading || (!trimmedCustomBase && !hasSavedCustomBase)+ }+ className="text-xs"+ >+ {customModelsLoading+ ? t("common.loading")+ : isCustomBaseDirty+ ? t("reasoning.custom.applyAndRefresh")+ : t("common.refresh")}+ </Button>+ </div>+ </div>+ <p className="text-xs text-muted-foreground">+ {t("reasoning.custom.queryPrefix")}{" "}+ <code className="break-all">+ {hasCustomBase+ ? `${effectiveReasoningBase}/models`+ : `${defaultOpenAIBase}/models`}+ </code>{" "}+ {t("reasoning.custom.querySuffix")}+ </p>+ {isCustomBaseDirty && (+ <p className="text-xs text-primary">{t("reasoning.custom.modelsReloadHint")}</p>+ )}+ {!hasCustomBase && (+ <p className="text-xs text-warning">{t("reasoning.custom.enterEndpoint")}</p>+ )}+ {hasCustomBase && (+ <>+ {customModelsLoading && (+ <p className="text-xs text-primary">+ {t("reasoning.custom.fetchingModels")}+ </p>+ )}+ {customModelsError && (+ <p className="text-xs text-destructive">{customModelsError}</p>+ )}+ {!customModelsLoading &&+ !customModelsError &&+ customModelOptions.length === 0 && (+ <p className="text-xs text-warning">{t("reasoning.custom.noModels")}</p>+ )}+ </>+ )}+ <ModelCardList+ models={selectedCloudModels}+ selectedModel={reasoningModel}+ onModelSelect={setReasoningModel}+ />+ </div>+ </>+ ) : (+ <>+ {selectedCloudProvider === "openai" && (+ <div className="space-y-2">+ <div className="flex items-baseline justify-between">+ <h4 className="font-medium text-foreground">{t("common.apiKey")}</h4>+ <a+ href="https://platform.openai.com/api-keys"+ target="_blank"+ rel="noopener noreferrer"+ onClick={createExternalLinkHandler("https://platform.openai.com/api-keys")}+ className="text-xs text-link underline decoration-link/30 hover:decoration-link/60 cursor-pointer transition-colors"+ >+ {t("reasoning.getApiKey")}+ </a>+ </div><ApiKeyInput- apiKey={customReasoningApiKey}- setApiKey={setCustomReasoningApiKey || (() => {})}+ apiKey={openaiApiKey}+ setApiKey={setOpenaiApiKey}label=""- helpText={t("reasoning.custom.apiKeyHelp")}+ helpText=""/></div>+ )}- <div className="space-y-2 pt-3">- <div className="flex items-center justify-between">- <h4 className="text-sm font-medium text-foreground">- {t("reasoning.availableModels")}- </h4>- <div className="flex gap-2">- <Button- type="button"- size="sm"- variant="outline"- onClick={handleResetCustomBase}- className="text-xs"- >- {t("common.reset")}- </Button>- <Button- type="button"- size="sm"- variant="outline"- onClick={handleRefreshCustomModels}- disabled={- customModelsLoading || (!trimmedCustomBase && !hasSavedCustomBase)- }- className="text-xs"- >- {customModelsLoading- ? t("common.loading")- : isCustomBaseDirty- ? t("reasoning.custom.applyAndRefresh")- : t("common.refresh")}- </Button>- </div>- </div>- <p className="text-xs text-muted-foreground">- {t("reasoning.custom.queryPrefix")}{" "}- <code className="break-all">- {hasCustomBase- ? `${effectiveReasoningBase}/models`- : `${defaultOpenAIBase}/models`}- </code>{" "}- {t("reasoning.custom.querySuffix")}- </p>- {isCustomBaseDirty && (- <p className="text-xs text-primary">- {t("reasoning.custom.modelsReloadHint")}- </p>- )}- {!hasCustomBase && (- <p className="text-xs text-warning">{t("reasoning.custom.enterEndpoint")}</p>- )}- {hasCustomBase && (- <>- {customModelsLoading && (- <p className="text-xs text-primary">- {t("reasoning.custom.fetchingModels")}- </p>- )}- {customModelsError && (- <p className="text-xs text-destructive">{customModelsError}</p>+ {selectedCloudProvider === "anthropic" && (+ <div className="space-y-2">+ <div className="flex items-baseline justify-between">+ <h4 className="font-medium text-foreground">{t("common.apiKey")}</h4>+ <a+ href="https://console.anthropic.com/settings/keys"+ target="_blank"+ rel="noopener noreferrer"+ onClick={createExternalLinkHandler(+ "https://console.anthropic.com/settings/keys")}- {!customModelsLoading &&- !customModelsError &&- customModelOptions.length === 0 && (- <p className="text-xs text-warning">{t("reasoning.custom.noModels")}</p>- )}- </>- )}- <ModelCardList- models={selectedCloudModels}- selectedModel={reasoningModel}- onModelSelect={setReasoningModel}+ className="text-xs text-link underline decoration-link/30 hover:decoration-link/60 cursor-pointer transition-colors"+ >+ {t("reasoning.getApiKey")}+ </a>+ </div>+ <ApiKeyInput+ apiKey={anthropicApiKey}+ setApiKey={setAnthropicApiKey}+ label=""+ helpText=""/></div>- </>- ) : (- <>- {selectedCloudProvider === "openai" && (- <div className="space-y-2">- <div className="flex items-baseline justify-between">- <h4 className="font-medium text-foreground">{t("common.apiKey")}</h4>- <a- href="https://platform.openai.com/api-keys"- target="_blank"- rel="noopener noreferrer"- onClick={createExternalLinkHandler(- "https://platform.openai.com/api-keys"- )}- className="text-xs text-link underline decoration-link/30 hover:decoration-link/60 cursor-pointer transition-colors"- >- {t("reasoning.getApiKey")}- </a>- </div>- <ApiKeyInput- apiKey={openaiApiKey}- setApiKey={setOpenaiApiKey}- label=""- helpText=""- />- </div>- )}-- {selectedCloudProvider === "anthropic" && (- <div className="space-y-2">- <div className="flex items-baseline justify-between">- <h4 className="font-medium text-foreground">{t("common.apiKey")}</h4>- <a- href="https://console.anthropic.com/settings/keys"- target="_blank"- rel="noopener noreferrer"- onClick={createExternalLinkHandler(- "https://console.anthropic.com/settings/keys"- )}- className="text-xs text-link underline decoration-link/30 hover:decoration-link/60 cursor-pointer transition-colors"- >- {t("reasoning.getApiKey")}- </a>- </div>- <ApiKeyInput- apiKey={anthropicApiKey}- setApiKey={setAnthropicApiKey}- label=""- helpText=""- />- </div>- )}+ )}- {selectedCloudProvider === "gemini" && (- <div className="space-y-2">- <div className="flex items-baseline justify-between">- <h4 className="font-medium text-foreground">{t("common.apiKey")}</h4>- <a- href="https://aistudio.google.com/app/api-keys"- target="_blank"- rel="noopener noreferrer"- onClick={createExternalLinkHandler(- "https://aistudio.google.com/app/api-keys"- )}- className="text-xs text-link underline decoration-link/30 hover:decoration-link/60 cursor-pointer transition-colors"- >- {t("reasoning.getApiKey")}- </a>- </div>- <ApiKeyInput- apiKey={geminiApiKey}- setApiKey={setGeminiApiKey}- label=""- helpText=""- />+ {selectedCloudProvider === "gemini" && (+ <div className="space-y-2">+ <div className="flex items-baseline justify-between">+ <h4 className="font-medium text-foreground">{t("common.apiKey")}</h4>+ <a+ href="https://aistudio.google.com/app/api-keys"+ target="_blank"+ rel="noopener noreferrer"+ onClick={createExternalLinkHandler(+ "https://aistudio.google.com/app/api-keys"+ )}+ className="text-xs text-link underline decoration-link/30 hover:decoration-link/60 cursor-pointer transition-colors"+ >+ {t("reasoning.getApiKey")}+ </a></div>- )}+ <ApiKeyInput+ apiKey={geminiApiKey}+ setApiKey={setGeminiApiKey}+ label=""+ helpText=""+ />+ </div>+ )}- {selectedCloudProvider === "groq" && (- <div className="space-y-2">- <div className="flex items-baseline justify-between">- <h4 className="font-medium text-foreground">{t("common.apiKey")}</h4>- <a- href="https://console.groq.com/keys"- target="_blank"- rel="noopener noreferrer"- onClick={createExternalLinkHandler("https://console.groq.com/keys")}- className="text-xs text-link underline decoration-link/30 hover:decoration-link/60 cursor-pointer transition-colors"- >- {t("reasoning.getApiKey")}- </a>- </div>- <ApiKeyInput- apiKey={groqApiKey}- setApiKey={setGroqApiKey}- label=""- helpText=""- />+ {selectedCloudProvider === "groq" && (+ <div className="space-y-2">+ <div className="flex items-baseline justify-between">+ <h4 className="font-medium text-foreground">{t("common.apiKey")}</h4>+ <a+ href="https://console.groq.com/keys"+ target="_blank"+ rel="noopener noreferrer"+ onClick={createExternalLinkHandler("https://console.groq.com/keys")}+ className="text-xs text-link underline decoration-link/30 hover:decoration-link/60 cursor-pointer transition-colors"+ >+ {t("reasoning.getApiKey")}+ </a></div>- )}-- <div className="pt-3 space-y-2">- <h4 className="text-sm font-medium text-foreground">- {t("reasoning.selectModel")}- </h4>- <ModelCardList- models={selectedCloudModels}- selectedModel={reasoningModel}- onModelSelect={setReasoningModel}+ <ApiKeyInput+ apiKey={groqApiKey}+ setApiKey={setGroqApiKey}+ label=""+ helpText=""/></div>- </>- )}- </div>+ )}++ <div className="pt-3 space-y-2">+ <h4 className="text-sm font-medium text-foreground">+ {t("reasoning.selectModel")}+ </h4>+ <ModelCardList+ models={selectedCloudModels}+ selectedModel={reasoningModel}+ onModelSelect={setReasoningModel}+ />+ </div>+ </>+ )}</div></div>) : (diff --git a/src/components/TranscriptionModelPicker.tsx b/src/components/TranscriptionModelPicker.tsxindex 08f046d3d..add7185eb 100644--- a/src/components/TranscriptionModelPicker.tsx+++ b/src/components/TranscriptionModelPicker.tsx@@ -88,10 +88,7 @@ function LocalModelCard({isSelected ? cardStyles.modelCard.selected : cardStyles.modelCard.default} ${isDownloaded && !isSelected ? "cursor-pointer" : ""}`}>- {isSelected && (- <div className="absolute left-0 top-0 bottom-0 w-1 bg-linear-to-b from-primary via-primary to-primary/80 rounded-l-md" />- )}- <div className="flex items-center gap-1.5 p-2 pl-2.5">+ <div className="flex items-center gap-1.5 p-2"><div className="shrink-0">{isDownloaded ? (<div@@ -208,7 +205,7 @@ interface TranscriptionModelPickerProps {const CLOUD_PROVIDER_TABS = [{ id: "openai", name: "OpenAI" },- { id: "groq", name: "Groq", recommended: true },+ { id: "groq", name: "Groq" },{ id: "mistral", name: "Mistral" },{ id: "custom", name: "Custom" },];@@ -216,8 +213,8 @@ const CLOUD_PROVIDER_TABS = [const VALID_CLOUD_PROVIDER_IDS = CLOUD_PROVIDER_TABS.map((p) => p.id);const LOCAL_PROVIDER_TABS: Array<{ id: string; name: string; disabled?: boolean }> = [- { id: "whisper", name: "OpenAI Whisper" },- { id: "nvidia", name: "NVIDIA Parakeet" },+ { id: "whisper", name: "OpenAI" },+ { id: "nvidia", name: "NVIDIA" },];interface ModeToggleProps {@@ -754,12 +751,6 @@ export default function TranscriptionModelPicker({[showConfirmDialog, deleteParakeetModel, t]);- const getParakeetLanguageLabel = (language: string) => {- return language === "multilingual"- ? t("transcription.parakeet.multilingual")- : t("transcription.parakeet.english");- };-const renderParakeetModels = () => {const modelsToRender =parakeetModels.length === 0@@ -796,7 +787,6 @@ export default function TranscriptionModelPicker({isCancelling={isCancellingParakeet}recommended={info.recommended}provider="nvidia"- languageLabel={getParakeetLanguageLabel(info.language)}onSelect={() => handleParakeetModelSelect(modelId)}onDelete={() => handleParakeetDelete(modelId)}onDownload={() =>@@ -821,18 +811,16 @@ export default function TranscriptionModelPicker({{!mode && <ModeToggle useLocalWhisper={effectiveLocal} onModeChange={handleModeChange} />}{!effectiveLocal ? (- <div className={styles.container}>- <div className="p-2 pb-0">- <ProviderTabs- providers={cloudProviderTabs}- selectedId={selectedCloudProvider}- onSelect={handleCloudProviderChange}- colorScheme="purple"- scrollable- />- </div>-- <div className="p-2">+ <>+ <ProviderTabs+ providers={cloudProviderTabs}+ selectedId={selectedCloudProvider}+ onSelect={handleCloudProviderChange}+ colorScheme="purple"+ scrollable+ />++ <div>{selectedCloudProvider === "custom" ? (<div className="space-y-2"><div className="space-y-1.5">@@ -916,17 +904,15 @@ export default function TranscriptionModelPicker({</div>)}</div>- </div>+ </>) : (- <div className={styles.container}>- <div className="p-2 pb-0">- <ProviderTabs- providers={LOCAL_PROVIDER_TABS}- selectedId={internalLocalProvider}- onSelect={handleLocalProviderChange}- colorScheme="purple"- />- </div>+ <>+ <ProviderTabs+ providers={LOCAL_PROVIDER_TABS}+ selectedId={internalLocalProvider}+ onSelect={handleLocalProviderChange}+ colorScheme="purple"+ />{progressDisplay}@@ -949,7 +935,7 @@ export default function TranscriptionModelPicker({!cudaDownloading &&getCachedPlatform() !== "darwin" &&cudaStatus?.gpuInfo.hasNvidiaGpu && (- <div className="mx-2 mt-2 rounded-md border border-border bg-surface-1 p-2.5">+ <div className="rounded-md border border-border bg-surface-1 p-2.5">{cudaStatus.downloaded ? (<div className="flex items-center justify-between"><div className="flex items-center gap-1.5">@@ -994,11 +980,11 @@ export default function TranscriptionModelPicker({</div>)}- <div className="p-2">+ <div>{internalLocalProvider === "whisper" && renderLocalModels()}{internalLocalProvider === "nvidia" && renderParakeetModels()}</div>- </div>+ </>)}<ConfirmDialogdiff --git a/src/components/ui/ModelCardList.tsx b/src/components/ui/ModelCardList.tsxindex f2d8a8058..ab24aaf8a 100644--- a/src/components/ui/ModelCardList.tsx+++ b/src/components/ui/ModelCardList.tsx@@ -110,15 +110,10 @@ export default function ModelCardList({<divkey={model.value}onClick={handleCardClick}- className={`relative w-full p-2 pl-2.5 rounded-md border text-left transition-colors duration-200 group overflow-hidden ${+ className={`relative w-full p-2 rounded-md border text-left transition-colors duration-200 group overflow-hidden ${isSelected ? styles.selected : styles.default} ${!isLocalMode || (isDownloaded && !isSelected) ? "cursor-pointer" : ""}`}>- {/* Left accent bar for selected */}- {isSelected && (- <div className="absolute left-0 top-0 bottom-0 w-1 bg-linear-to-b from-primary via-primary to-primary/80 rounded-l-md" />- )}-<div className="flex items-center gap-1.5">{/* Status dot with LED glow */}<divdiff --git a/src/components/ui/ProviderTabs.tsx b/src/components/ui/ProviderTabs.tsxindex f0143c1a0..bb1de70b4 100644--- a/src/components/ui/ProviderTabs.tsx+++ b/src/components/ui/ProviderTabs.tsx@@ -70,12 +70,11 @@ export function ProviderTabs({return (<divref={containerRef}- className={`relative flex p-0.5 rounded-md bg-surface-raised dark:bg-surface-1 ${scrollable ? "overflow-x-auto" : ""}`}+ className={`relative inline-flex items-center gap-0.5 p-0.5 ${scrollable ? "overflow-x-auto" : ""}`}>- {/* Sliding indicator - frosted glass treatment */}<divref={indicatorRef}- className="absolute top-0.5 left-0 rounded-md bg-card border border-border dark:border-border-subtle shadow-sm dark:shadow-(--shadow-card) transition-[width,height,transform,opacity] duration-200 ease-out pointer-events-none"+ className="absolute top-0.5 left-0 rounded-full bg-primary/10 dark:bg-primary/15 ring-1 ring-primary/30 dark:ring-primary/25 transition-[width,height,transform,opacity] duration-200 ease-out pointer-events-none"style={{ opacity: 0 }}/>@@ -87,14 +86,16 @@ export function ProviderTabs({key={provider.id}data-tab-buttononClick={() => onSelect(provider.id)}- className={`relative z-10 flex-1 flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-md font-medium text-xs transition-colors duration-150 ${+ className={`relative z-10 flex items-center gap-1 px-2.5 py-1 rounded-full font-medium text-xs transition-colors duration-150 ${scrollable ? "whitespace-nowrap" : ""- } ${isSelected ? "text-foreground" : "text-muted-foreground hover:text-foreground"}`}+ } ${isSelected ? "text-foreground [&_svg]:text-primary" : "text-muted-foreground ring-1 ring-border/60 dark:ring-white/10 hover:text-foreground hover:bg-foreground/4 dark:hover:bg-white/5"}`}>{renderIcon ? renderIcon(provider.id) : <ProviderIcon provider={provider.id} />}<span>{provider.name}</span>{provider.recommended && (- <span className="text-xs text-primary/70 font-medium">{t("common.recommended")}</span>+ <span className="text-[10px] text-primary/70 font-medium">+ {t("common.recommended")}+ </span>)}</button>);diff --git a/src/models/modelRegistryData.json b/src/models/modelRegistryData.jsonindex 42dfdbbd4..422dfa86a 100644--- a/src/models/modelRegistryData.json+++ b/src/models/modelRegistryData.json@@ -2,7 +2,7 @@"parakeetModels": {"parakeet-tdt-0.6b-v3": {"name": "Parakeet TDT 0.6B",- "description": "Fast multilingual ASR with auto language detection (25 languages)",+ "description": "Fast multilingual ASR with auto language detection","size": "680MB","sizeMb": 680,"language": "multilingual",@@ -33,7 +33,6 @@"ru","uk"],- "recommended": true,"downloadUrl": "https://github.com/k2-fsa/sherpa-onnx/releases/download/asr-models/sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8.tar.bz2","extractDir": "sherpa-onnx-nemo-parakeet-tdt-0.6b-v3-int8","descriptionKey": "models.descriptions.parakeet.parakeet_tdt_0_6b_v3"@@ -510,7 +509,7 @@},{"id": "mistral",- "name": "Mistral AI",+ "name": "Mistral","baseUrl": "https://huggingface.co","promptTemplate": "[INST] {system}\n\n{user} [/INST]","models": [@@ -600,7 +599,7 @@},{"id": "openai-oss",- "name": "OpenAI OSS",+ "name": "OpenAI","baseUrl": "https://huggingface.co","promptTemplate": "<|im_start|>system\n{system}<|im_end|>\n<|im_start|>user\n{user}<|im_end|>\n<|im_start|>assistant\n","models": [