Skip to content

Fastest and only macOS Dictation app with on-device STT and custom trained AI enhancement model. Windows, iOS testflight! Android, Linux waitlist open! A local Wispr Flow alternative. Follow https://x.com/fluidvoiceapp for more

fix(ai): prewarm private dictation starts

altic-dev2e955203ac52
diff --git a/Sources/Fluid/ContentView.swift b/Sources/Fluid/ContentView.swift
index a8db967b..9c09ba8c 100644
--- a/Sources/Fluid/ContentView.swift
+++ b/Sources/Fluid/ContentView.swift
@@ -2571,18 +2571,25 @@ struct ContentView: View {
}
}
- // Pre-warm the local AI dictation runtime during recording so the first
- // enhancement is a warm prefix-cache hit instead of paying model load +
- // prompt prefill after the user stops speaking. Only when the private
- // provider is the selected, configured dictation provider; best-effort.
- if PrivateAIProviderPromptFormat.isAvailable(settings: SettingsStore.shared),
- DictationAIPostProcessingGate.isConfigured()
- {
- Task {
- DebugLogger.shared.debug("ContentView: AI dictation prewarm started", source: "ContentView")
- await PrivateAIIntegrationService.shared.prewarmDictation()
- DebugLogger.shared.debug("AI dictation prewarm complete", source: "ContentView")
- }
+ self.prewarmPrivateAIDictationIfNeeded(for: .primary)
+ }
+
+ private func prewarmPrivateAIDictationIfNeeded(for slot: SettingsStore.DictationShortcutSlot) {
+ let appBundleID = self.recordingAppInfo?.bundleId
+ guard PrivateAIProviderPromptFormat.isAvailable(settings: SettingsStore.shared),
+ DictationAIPostProcessingGate.isConfigured(for: slot, appBundleID: appBundleID)
+ else { return }
+
+ Task {
+ DebugLogger.shared.debug(
+ "ContentView: AI dictation prewarm started slot=\(slot.rawValue)",
+ source: "ContentView"
+ )
+ await PrivateAIIntegrationService.shared.prewarmDictation()
+ DebugLogger.shared.debug(
+ "AI dictation prewarm complete slot=\(slot.rawValue)",
+ source: "ContentView"
+ )
}
}
@@ -3101,6 +3108,7 @@ extension ContentView {
self.setActiveRecordingMode(mode)
self.rewriteModeService.clearState()
self.menuBarManager.setOverlayMode(.dictation)
+ self.prewarmPrivateAIDictationIfNeeded(for: slot)
guard !self.asr.isRunning else { return }
if SettingsStore.shared.enableTranscriptionSounds {