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
Add Qwen dictation and improve short recordings (#1239)
ALTIC0fccdeb01446
diff --git a/Sources/Fluid/Assets.xcassets/Provider_Qwen.imageset/Contents.json b/Sources/Fluid/Assets.xcassets/Provider_Qwen.imageset/Contents.jsonnew file mode 100644index 00000000..064f3e21--- /dev/null+++ b/Sources/Fluid/Assets.xcassets/Provider_Qwen.imageset/Contents.json@@ -0,0 +1,6 @@+{+ "images" : [+ { "filename" : "logo.png", "idiom" : "universal" }+ ],+ "info" : { "author" : "xcode", "version" : 1 }+}diff --git a/Sources/Fluid/Assets.xcassets/Provider_Qwen.imageset/logo.png b/Sources/Fluid/Assets.xcassets/Provider_Qwen.imageset/logo.pngnew file mode 100644index 00000000..66d58cbbBinary files /dev/null and b/Sources/Fluid/Assets.xcassets/Provider_Qwen.imageset/logo.png differdiff --git a/Sources/Fluid/Persistence/SettingsStore.swift b/Sources/Fluid/Persistence/SettingsStore.swiftindex c33f3b4b..ae090be2 100644--- a/Sources/Fluid/Persistence/SettingsStore.swift+++ b/Sources/Fluid/Persistence/SettingsStore.swift@@ -5186,6 +5186,10 @@ final class SettingsStore: ObservableObject {case whisperLargeTurbo = "whisper-large-turbo"case whisperLarge = "whisper-large"+ // MARK: - Other transcribe.cpp Models++ case qwen3Asr17B = "qwen3-asr-1.7b"+var parakeetDescriptor: ParakeetSpeechModelCatalog.Descriptor? {ParakeetSpeechModelCatalog.descriptor(forModelID: self.rawValue)}@@ -5219,6 +5223,7 @@ final class SettingsStore: ObservableObject {case .whisperMedium: return "Whisper Medium"case .whisperLargeTurbo: return "Whisper Large Turbo"case .whisperLarge: return "Whisper Large"+ case .qwen3Asr17B: return "Qwen3 ASR 1.7B"}}@@ -5226,7 +5231,7 @@ final class SettingsStore: ObservableObject {switch self {case .parakeetTDT, .parakeetTDTv2, .fluidParakeetMini, .fluidParakeetPico: return self.parakeetDescriptor?.languageSupport ?? "English Only"case .parakeetRealtime: return "English Only (Live Streaming)"- case .qwen3Asr: return "30 Languages"+ case .qwen3Asr, .qwen3Asr17B: return "30 Languages"case .cohereTranscribeSixBit: return "14 Languages (Select Manually)"case .nemotronOffline, .nemotronStreaming, .nemotronStreaming320: return "Around 40 Languages"case .appleSpeech: return "System Languages"@@ -5253,6 +5258,7 @@ final class SettingsStore: ObservableObject {case .whisperMedium: return "~793.0 MiB"case .whisperLargeTurbo: return "~845.3 MiB"case .whisperLarge: return "~1.55 GiB"+ case .qwen3Asr17B: return "~2.03 GiB"}}@@ -5270,20 +5276,21 @@ final class SettingsStore: ObservableObject {case .whisperMedium: return 831_538_144case .whisperLargeTurbo: return 886_381_728case .whisperLarge: return 1_668_741_440+ case .qwen3Asr17B: return 2_185_030_624case .appleSpeech, .appleSpeechAnalyzer: return 0}}var requiresAppleSilicon: Bool {switch self {- case .parakeetTDT, .parakeetTDTv2, .fluidParakeetMini, .fluidParakeetPico, .parakeetRealtime, .qwen3Asr, .cohereTranscribeSixBit, .nemotronOffline, .nemotronStreaming, .nemotronStreaming320: return true+ case .parakeetTDT, .parakeetTDTv2, .fluidParakeetMini, .fluidParakeetPico, .parakeetRealtime, .qwen3Asr, .qwen3Asr17B, .cohereTranscribeSixBit, .nemotronOffline, .nemotronStreaming, .nemotronStreaming320: return truedefault: return false}}var isWhisperModel: Bool {switch self {- case .parakeetTDT, .parakeetTDTv2, .fluidParakeetMini, .fluidParakeetPico, .parakeetRealtime, .qwen3Asr, .cohereTranscribeSixBit, .nemotronOffline, .nemotronStreaming, .nemotronStreaming320, .appleSpeech,+ case .parakeetTDT, .parakeetTDTv2, .fluidParakeetMini, .fluidParakeetPico, .parakeetRealtime, .qwen3Asr, .qwen3Asr17B, .cohereTranscribeSixBit, .nemotronOffline, .nemotronStreaming, .nemotronStreaming320, .appleSpeech,.appleSpeechAnalyzer: return falsedefault: return true}@@ -5298,6 +5305,7 @@ final class SettingsStore: ObservableObject {case .whisperMedium: return "whisper-medium-Q8_0.gguf"case .whisperLargeTurbo: return "whisper-large-v3-turbo-Q8_0.gguf"case .whisperLarge: return "whisper-large-v3-Q8_0.gguf"+ case .qwen3Asr17B: return "Qwen3-ASR-1.7B-Q8_0.gguf"default: return nil}}@@ -5414,6 +5422,7 @@ final class SettingsStore: ObservableObject {case .whisperMedium: return "Medium Quality"case .whisperLargeTurbo: return "Higher Quality but Faster"case .whisperLarge: return "Maximum Accuracy"+ case .qwen3Asr17B: return "Qwen3 - Multilingual 1.7B"}}@@ -5450,6 +5459,8 @@ final class SettingsStore: ObservableObject {return "Near-maximum accuracy with optimized speed."case .whisperLarge:return "Best possible accuracy. Large download and memory usage."+ case .qwen3Asr17B:+ return "Automatically detects 30 languages. Transcribes on your Mac after you stop recording."}}@@ -5478,6 +5489,8 @@ final class SettingsStore: ObservableObject {return 6.0case .whisperLarge:return 8.0+ case .qwen3Asr17B:+ return 6.0}}@@ -5514,6 +5527,7 @@ final class SettingsStore: ObservableObject {case .whisperMedium: return 2case .whisperLargeTurbo: return 3case .whisperLarge: return 1+ case .qwen3Asr17B: return 3}}@@ -5534,6 +5548,7 @@ final class SettingsStore: ObservableObject {case .whisperMedium: return 4case .whisperLargeTurbo: return 5case .whisperLarge: return 5+ case .qwen3Asr17B: return 5}}@@ -5554,6 +5569,7 @@ final class SettingsStore: ObservableObject {case .whisperMedium: return 0.40case .whisperLargeTurbo: return 0.65case .whisperLarge: return 0.20+ case .qwen3Asr17B: return 0.50}}@@ -5574,6 +5590,7 @@ final class SettingsStore: ObservableObject {case .whisperMedium: return 0.80case .whisperLargeTurbo: return 0.95case .whisperLarge: return 1.00+ case .qwen3Asr17B: return 1.00}}@@ -5585,6 +5602,7 @@ final class SettingsStore: ObservableObject {case .fluidParakeetMini, .fluidParakeetPico: return "New"case .parakeetRealtime: return "Beta"case .qwen3Asr: return "Beta"+ case .qwen3Asr17B: return nilcase .cohereTranscribeSixBit: return "New"case .nemotronOffline, .nemotronStreaming, .nemotronStreaming320: return "New + Beta"case .appleSpeechAnalyzer: return "New"@@ -5606,7 +5624,7 @@ final class SettingsStore: ObservableObject {/// Large Whisper models are too slow for streaming, so they only do final transcription on stop.var supportsStreaming: Bool {switch self {- case .qwen3Asr, .whisperMedium, .whisperLargeTurbo, .whisperLarge:+ case .qwen3Asr, .qwen3Asr17B, .whisperMedium, .whisperLargeTurbo, .whisperLarge:return false // Too slow for real-time chunk processingdefault:return true // All other models support streaming@@ -5672,7 +5690,7 @@ final class SettingsStore: ObservableObject {return .nvidiacase .appleSpeech, .appleSpeechAnalyzer:return .apple- case .qwen3Asr:+ case .qwen3Asr, .qwen3Asr17B:return .qwencase .cohereTranscribeSixBit:return .cohere@@ -5784,7 +5802,7 @@ final class SettingsStore: ObservableObject {return "FluidVoice"case .parakeetTDT, .parakeetTDTv2, .parakeetRealtime, .nemotronOffline, .nemotronStreaming, .nemotronStreaming320:return "NVIDIA"- case .qwen3Asr:+ case .qwen3Asr, .qwen3Asr17B:return "Qwen"case .cohereTranscribeSixBit:return "Cohere"@@ -5810,7 +5828,7 @@ final class SettingsStore: ObservableObject {return "#1A75FF" // FluidBrandColors.bluecase .parakeetTDT, .parakeetTDTv2, .parakeetRealtime, .nemotronOffline, .nemotronStreaming, .nemotronStreaming320:return "#76B900"- case .qwen3Asr:+ case .qwen3Asr, .qwen3Asr17B:return "#E67E22"case .cohereTranscribeSixBit:return "#FA6B3C"@@ -6272,6 +6290,9 @@ extension SettingsStore.SpeechModel {return "EN"case .cohereTranscribeSixBit:return "AR, DE, EL, EN, ES, FR, IT, JA, KO, NL, PL, PT, VI, ZH"+ case .qwen3Asr, .qwen3Asr17B:+ // https://huggingface.co/Qwen/Qwen3-ASR-1.7B#released-models-description-and-download+ return "ZH, EN, YUE, AR, DE, FR, ES, PT, ID, IT, KO, RU, TH, VI, JA, TR, HI, MS, NL, SV, DA, FI, PL, CS, FIL, FA, EL, HU, MK, RO"case .nemotronOffline, .nemotronStreaming, .nemotronStreaming320:return "40 language-locales"case .appleSpeechAnalyzer:@@ -6291,6 +6312,10 @@ extension SettingsStore.SpeechModel {return "English"case .cohereTranscribeSixBit:return "Arabic, German, Greek, English, Spanish, French, Italian, Japanese, Korean, Dutch, Polish, Portuguese, Vietnamese, and Mandarin Chinese"+ case .qwen3Asr, .qwen3Asr17B:+ return "Chinese, English, Cantonese, Arabic, German, French, Spanish, Portuguese, Indonesian, Italian, Korean, Russian, Thai, " ++ "Vietnamese, Japanese, Turkish, Hindi, Malay, Dutch, Swedish, Danish, Finnish, Polish, Czech, Filipino, Persian, Greek, " ++ "Hungarian, Macedonian, and Romanian"case .nemotronOffline, .nemotronStreaming, .nemotronStreaming320:return "Spanish, Italian, Portuguese, Hindi, Korean, English, German, French, Russian, Turkish, Vietnamese, Dutch, Japanese, Arabic, " +"Ukrainian; Polish, Norwegian Bokmal, Finnish, Mandarin, Czech, Bulgarian, Slovak, Swedish, Croatian, Romanian, Estonian, " +diff --git a/Sources/Fluid/Services/FluidAudioProvider.swift b/Sources/Fluid/Services/FluidAudioProvider.swiftindex 806ce290..18294fac 100644--- a/Sources/Fluid/Services/FluidAudioProvider.swift+++ b/Sources/Fluid/Services/FluidAudioProvider.swift@@ -185,6 +185,8 @@ final class FluidAudioProvider: TranscriptionProvider {private static let incrementalChunkingThresholdSamples = 240_000private static let incrementalAppendBlockSamples = 240_000+ /// Mac capture opens on ~0.17 s of dead audio; 0.25 s of silence first lets Parakeet catch the first word.+ static let finalLeadInSamples = 4000/// Stable admission keeps a ninth word from evicting references used by the next match.struct TemporalReferenceCache {@@ -916,7 +918,7 @@ final class FluidAudioProvider: TranscriptionProvider {// manager so the user still gets a transcription (just without CTC rescoring).do {let startedAt = Date().timeIntervalSince1970- let outcome = try await self.transcribeFinalResult(samples, manager: manager)+ let outcome = try await self.transcribeFinalResult(samples, manager: manager, leadIn: true)try self.requireCurrentRecording(generation)self.logFinalBenchmark(samples: samples, text: outcome.result.text, startedAt: startedAt, usedFallback: false)return outcome.result@@ -930,7 +932,7 @@ final class FluidAudioProvider: TranscriptionProvider {source: "FluidAudioProvider")let startedAt = Date().timeIntervalSince1970- let outcome = try await self.transcribeFinalResult(samples, manager: fallback)+ let outcome = try await self.transcribeFinalResult(samples, manager: fallback, leadIn: true)try self.requireCurrentRecording(generation)self.logFinalBenchmark(samples: samples, text: outcome.result.text, startedAt: startedAt, usedFallback: true)return outcome.result@@ -1211,6 +1213,38 @@ final class FluidAudioProvider: TranscriptionProvider {}}+ /// Pronunciation matching reads encoder frames against the recording itself, and a full window has no room left.+ static func usesFinalLeadIn(sampleCount: Int, hasPronunciationProfiles: Bool) -> Bool {+ !hasPronunciationProfiles && sampleCount + self.finalLeadInSamples <= self.incrementalChunkingThresholdSamples+ }++ static func withLeadIn(_ samples: [Float]) -> [Float] {+ [Float](repeating: 0, count: self.finalLeadInSamples) + samples+ }++ /// Puts timings back on the recording's own clock after transcribing `withLeadIn(_:)`.+ static func removingLeadIn(from result: ASRResult) -> ASRResult {+ let offset = TimeInterval(Self.finalLeadInSamples) / 16_000+ return ASRResult(+ text: result.text,+ confidence: result.confidence,+ duration: max(0, result.duration - offset),+ processingTime: result.processingTime,+ tokenTimings: result.tokenTimings?.map {+ TokenTiming(+ token: $0.token,+ tokenId: $0.tokenId,+ startTime: max(0, $0.startTime - offset),+ endTime: max(0, $0.endTime - offset),+ confidence: $0.confidence+ )+ },+ performanceMetrics: result.performanceMetrics,+ ctcDetectedTerms: result.ctcDetectedTerms,+ ctcAppliedTerms: result.ctcAppliedTerms+ )+ }+private func learningAlignment(for result: ASRResult) -> DictionaryLearningAlignment? {guard DictionaryMatcherExperiment.sharedFeaturesEnabled, SettingsStore.shared.automaticDictionaryLearningEnabled || DictionaryMatcherExperiment.collectNegatives, !self.isWordBoostingActive,let timings = result.tokenTimings, !timings.isEmpty@@ -1219,7 +1253,7 @@ final class FluidAudioProvider: TranscriptionProvider {}private func transcribeFinalResult(- _ samples: [Float], manager: AsrManager+ _ samples: [Float], manager: AsrManager, leadIn: Bool = false) async throws -> (result: ASRTranscriptionResult, tokenTimings: [TokenTiming]?, textMayBeCorrected: Bool) { // swiftlint:disable:this discouraged_optional_collectionlet generation = self.recordingGenerationlet profiles = self.effectivePronunciationMatchingEnabled ? Self.preparedEdgeProfiles(await self.pronunciationProfiles(), cache: self.edgeReferenceCache) : []@@ -1233,7 +1267,12 @@ final class FluidAudioProvider: TranscriptionProvider {let textMayBeCorrected = self.isWordBoostingActive || !profiles.isEmptyawait manager.setPronunciationCustomizationEnabled(!profiles.isEmpty)do {- let result = try await manager.transcribe(samples, source: AudioSource.microphone)+ let result: ASRResult+ if leadIn, Self.usesFinalLeadIn(sampleCount: samples.count, hasPronunciationProfiles: !profiles.isEmpty) {+ result = try await Self.removingLeadIn(from: manager.transcribe(Self.withLeadIn(samples), source: AudioSource.microphone))+ } else {+ result = try await manager.transcribe(samples, source: AudioSource.microphone)+ }let features = await manager.consumePronunciationEncoderFeatures()await manager.setPronunciationCustomizationEnabled(false)guard DictionaryMatcherExperiment.sharedFeaturesEnabled, let features, !profiles.isEmpty else {diff --git a/Sources/Fluid/Services/Meeting/MeetingAutoDetector.swift b/Sources/Fluid/Services/Meeting/MeetingAutoDetector.swiftindex 1081bab6..6ebd669d 100644--- a/Sources/Fluid/Services/Meeting/MeetingAutoDetector.swift+++ b/Sources/Fluid/Services/Meeting/MeetingAutoDetector.swift@@ -166,6 +166,7 @@ final class MeetingAutoDetector {private var titleEnrichmentInFlight: Set<Int32> = []private var lastHealth: Health?private var audioQueryUnknown = false+ private var lastEndWatchStatus: String?init(workspaceEvents: any WorkspaceEventsProviding,@@ -667,6 +668,7 @@ final class MeetingAutoDetector {case .ended:if watched.browserCallEndedAt == nil {watched.browserCallEndedAt = now+ DebugLogger.shared.log("browser-call-state=ended evidence=post-call-page bundle=\(bundleIdentifier)", source: "MeetingAutoDetector")}case .inCall:watched.browserCallEndedAt = nil@@ -791,7 +793,10 @@ final class MeetingAutoDetector {func adoptStartedEpisode(episodeID: UUID) {guard let key = self.episodesByKey.first(where: { $0.value.id == episodeID })?.key,var episode = self.episodesByKey[key]- else { return }+ else {+ DebugLogger.shared.log("end-of-meeting-watch-not-attached reason=episode-retired", source: "MeetingAutoDetector")+ return+ }episode.consumed = trueself.episodesByKey[key] = episodeself.activeConsumedEpisodeKey = key@@ -811,6 +816,8 @@ final class MeetingAutoDetector {sawProcessAudio: record?.processAudioWasActive == true,browserCallEvidenceKey: record?.windowEvidenceKey)+ self.lastEndWatchStatus = nil+ DebugLogger.shared.log("end-of-meeting-watch-started path=prompt bundle=\(episode.bundleIdentifier)", source: "MeetingAutoDetector")}/// Called for every real recording, including manual and menu-bar starts. This observes@@ -844,17 +851,32 @@ final class MeetingAutoDetector {sawProcessAudio: record.processAudioWasActive,browserCallEvidenceKey: record.windowEvidenceKey)+ self.lastEndWatchStatus = nil}+ DebugLogger.shared.log("end-of-meeting-watch-started bundle=\(application.bundleIdentifier)", source: "MeetingAutoDetector")}/// Our recording is over, however it ended. Nothing is left to ask about.- func recordingStopped() {+ func recordingStopped(reason: String = "recording-stopped") {+ if let watched = self.watchedRecording {+ DebugLogger.shared.log("end-of-meeting-watch-stopped reason=\(reason) bundle=\(watched.bundleIdentifier)", source: "MeetingAutoDetector")+ }self.watchedRecording = nil+ self.lastEndWatchStatus = nil}/// The user closed the "Meeting ended?" question without stopping.func stillRecordingNudgeDismissed() {self.watchedRecording?.silenced = true+ if let watched = self.watchedRecording {+ self.logEndWatchStatus("dismissed-by-user", bundleIdentifier: watched.bundleIdentifier)+ }+ }++ private func logEndWatchStatus(_ status: String, bundleIdentifier: String) {+ guard self.lastEndWatchStatus != status else { return }+ self.lastEndWatchStatus = status+ DebugLogger.shared.log("end-of-meeting-watch state=\(status) bundle=\(bundleIdentifier)", source: "MeetingAutoDetector")}/// Atomic gate re-check + single-shot consume. Returns false if the episode is unknown,@@ -1018,6 +1040,17 @@ final class MeetingAutoDetector {if shouldAsk { watched.asked = true }if shouldWithdraw { watched.asked = false }self.watchedRecording = watched+ let status: String+ if watched.asked {+ status = "question-requested"+ } else if askAt != nil {+ status = stillTalking ? "waiting-for-caption-quiet" : "waiting-for-end-grace"+ } else if audioUnknown {+ status = "audio-query-unknown"+ } else {+ status = watched.sawProcessAudio ? "no-end-signal" : "waiting-for-app-audio"+ }+ self.logEndWatchStatus(status, bundleIdentifier: watched.bundleIdentifier)if shouldAsk {DebugLogger.shared.log("end-of-meeting-asked", source: "MeetingAutoDetector")self.onStillRecordingNudge?()@@ -1043,7 +1076,7 @@ final class MeetingAutoDetector {self.activeConsumedEpisodeKey = nil// With the records gone the app would look like it quit. Stop watching instead of guessing.// A question already on screen stays there for the user to answer.- self.watchedRecording = nil+ self.recordingStopped(reason: "lock-sleep-or-session-switch")self.lastBrowserPollAt = [:]for episodeID in unconsumedIDs {self.onEpisodeInvalidated?(episodeID)diff --git a/Sources/Fluid/Services/WhisperProvider.swift b/Sources/Fluid/Services/WhisperProvider.swiftindex b8274fd4..5bfa7d14 100644--- a/Sources/Fluid/Services/WhisperProvider.swift+++ b/Sources/Fluid/Services/WhisperProvider.swift@@ -1,7 +1,7 @@import Foundationimport TranscribeCpp-/// TranscriptionProvider implementation using transcribe.cpp for Whisper GGUF models.+/// TranscriptionProvider implementation using transcribe.cpp for Whisper and Qwen GGUF models.final class WhisperProvider: TranscriptionProvider {let name = "Whisper (Universal)"@@ -187,7 +187,7 @@ final class WhisperProvider: TranscriptionProvider {}if !FileManager.default.fileExists(atPath: self.modelURL.path) {- DebugLogger.shared.info("WhisperProvider: Downloading Whisper GGUF model...", source: "WhisperProvider")+ DebugLogger.shared.info("WhisperProvider: Downloading \(targetModel.displayName) GGUF model...", source: "WhisperProvider")progressHandler?(.preparingDownload)try await self.downloadModel { progress inprogressHandler?(.downloading(progress))@@ -199,10 +199,12 @@ final class WhisperProvider: TranscriptionProvider {throw NSError(domain: "WhisperProvider",code: -3,- userInfo: [NSLocalizedDescriptionKey: "Whisper model file is missing or corrupted. Please re-download the model."]+ userInfo: [NSLocalizedDescriptionKey: "\(targetModel.displayName) model file is missing or corrupted. Please re-download the model."])}- self.removeLegacyModelIfNeeded()+ if targetModel.isWhisperModel {+ self.removeLegacyModelIfNeeded()+ }let requiredMemoryGB = targetModel.requiredMemoryGBlet availableMemoryGB = Self.availableMemoryGB()@@ -250,7 +252,7 @@ final class WhisperProvider: TranscriptionProvider {try Task.checkCancellation()self.installModel(loadedModel, session: loadedSession, modelName: currentModelName)DebugLogger.shared.info(- "WhisperProvider: Model ready (\(currentModelName), backend=\(loadedModel.backend), arch=\(loadedModel.arch))",+ "WhisperProvider: Model ready (\(currentModelName), backend=\(loadedModel.backend), arch=\(loadedModel.arch), maxAudioMs=\(loadedModel.capabilities.maxAudioMs))",source: "WhisperProvider")}@@ -260,7 +262,7 @@ final class WhisperProvider: TranscriptionProvider {throw NSError(domain: "WhisperProvider",code: -5,- userInfo: [NSLocalizedDescriptionKey: "\(model.displayName) requires the Metal Whisper backend on Apple Silicon."]+ userInfo: [NSLocalizedDescriptionKey: "\(model.displayName) requires the Metal transcription backend on Apple Silicon."])}@@ -308,7 +310,7 @@ final class WhisperProvider: TranscriptionProvider {throw NSError(domain: "WhisperProvider",code: -2,- userInfo: [NSLocalizedDescriptionKey: "Audio too short for Whisper transcription"]+ userInfo: [NSLocalizedDescriptionKey: "Audio too short for \(self.selectedModel.displayName) transcription"])}@@ -316,23 +318,33 @@ final class WhisperProvider: TranscriptionProvider {throw NSError(domain: "WhisperProvider",code: -1,- userInfo: [NSLocalizedDescriptionKey: "Whisper model not loaded"]+ userInfo: [NSLocalizedDescriptionKey: "\(self.selectedModel.displayName) model not loaded"])}let resolvedLanguageCode = languageCode?? self.languageCodeOverride- ?? SettingsStore.shared.selectedWhisperLanguageCodelet transcript = try await session.run(samples,- options: Self.runOptions(languageCode: resolvedLanguageCode)+ options: Self.runOptions(+ languageCode: resolvedLanguageCode,+ model: self.selectedModel,+ whisperLanguageCode: SettingsStore.shared.selectedWhisperLanguageCode+ ))let fullText = transcript.text.trimmingCharacters(in: .whitespacesAndNewlines)return ASRTranscriptionResult(text: fullText, confidence: 1.0)}- static func runOptions(languageCode: String?) -> RunOptions {- RunOptions(timestamps: .segment, language: languageCode)+ static func runOptions(+ languageCode: String?,+ model: SettingsStore.SpeechModel = .whisperBase,+ whisperLanguageCode: String? = nil+ ) -> RunOptions {+ // Qwen3-ASR decodes text only and rejects timestamp requests.+ let timestamps: TimestampKind = model == .qwen3Asr17B ? .none : .segment+ let language = languageCode ?? (model.isWhisperModel ? whisperLanguageCode : nil)+ return RunOptions(timestamps: timestamps, language: language)}func modelsExistOnDisk() -> Bool {@@ -361,7 +373,7 @@ final class WhisperProvider: TranscriptionProvider {throw NSError(domain: "WhisperProvider",code: -1,- userInfo: [NSLocalizedDescriptionKey: "Invalid Whisper model URL"]+ userInfo: [NSLocalizedDescriptionKey: "Invalid \(self.selectedModel.displayName) model URL"])}@@ -388,7 +400,7 @@ final class WhisperProvider: TranscriptionProvider {let message: Stringswitch error.code {case NSURLErrorNotConnectedToInternet:- message = "No internet connection. Please connect to the internet to download the Whisper model."+ message = "No internet connection. Please connect to the internet to download \(self.selectedModel.displayName)."case NSURLErrorTimedOut:message = "Download timed out. Please check your internet connection and try again."case NSURLErrorCannotFindHost, NSURLErrorCannotConnectToHost:diff --git a/Sources/Fluid/UI/AISettings/VoiceEngineSettingsViewModel.swift b/Sources/Fluid/UI/AISettings/VoiceEngineSettingsViewModel.swiftindex 4b45a9d2..14b19d95 100644--- a/Sources/Fluid/UI/AISettings/VoiceEngineSettingsViewModel.swift+++ b/Sources/Fluid/UI/AISettings/VoiceEngineSettingsViewModel.swift@@ -97,6 +97,8 @@ final class VoiceEngineSettingsViewModel: ObservableObject {models = models.filter { $0.provider == .cohere }case .openai:models = models.filter { $0.provider == .openai }+ case .qwen:+ models = models.filter { $0.provider == .qwen }}if self.englishOnlyFilter {@@ -216,6 +218,8 @@ final class VoiceEngineSettingsViewModel: ObservableObject {return "Parakeet Flash uses FluidAudio's true streaming EOU pipeline for low-latency English dictation. Best when you want words to appear live as you speak."case .qwen3Asr:return "Qwen3 ASR is a multilingual FluidAudio model with strong quality, but higher memory usage. Requires macOS 15+."+ case .qwen3Asr17B:+ return "On-device dictation for Apple Silicon. Automatically detects 30 languages and produces text after you stop recording."case .cohereTranscribeSixBit:return "Cohere Transcribe downloads a CoreML pipeline from Hugging Face and caches it locally. Select the language manually before dictation. Best on Apple Silicon with 8GB+ RAM."case .nemotronOffline:diff --git a/Sources/Fluid/UI/AISettingsView+SpeechRecognition.swift b/Sources/Fluid/UI/AISettingsView+SpeechRecognition.swiftindex 9e17289a..bea69129 100644--- a/Sources/Fluid/UI/AISettingsView+SpeechRecognition.swift+++ b/Sources/Fluid/UI/AISettingsView+SpeechRecognition.swift@@ -203,6 +203,7 @@ extension VoiceEngineSettingsView {.font(self.theme.typography.bodySmall).foregroundStyle(self.voiceEngineSecondaryText).lineLimit(2)+ .help(model.supportedLanguageNames ?? supportedLanguageCodes)}// Memory warning for large models@@ -831,8 +832,8 @@ extension VoiceEngineSettingsView {private func speechModelBackgroundColor(for model: SettingsStore.SpeechModel) -> Color {let brand = model.brandName.lowercased()- // Both NVIDIA and OpenAI use white/light gray bg (transparent logos)- if brand.contains("nvidia") || brand.contains("openai") || brand.contains("whisper") {+ // Keep these provider marks on a light background in both appearances.+ if brand.contains("nvidia") || brand.contains("openai") || brand.contains("whisper") || brand.contains("qwen") {return Color(red: 0.97, green: 0.97, blue: 0.97)}if brand.contains("apple") || model.usesAppleLogo {@@ -850,6 +851,10 @@ extension VoiceEngineSettingsView {if brand.contains("cohere") {return "Provider_Cohere"}+ if brand.contains("qwen") {+ // Official organization mark from https://github.com/QwenLM.+ return "Provider_Qwen"+ }if brand.contains("openai") || brand.contains("whisper") {return "Provider_OpenAI"}diff --git a/Sources/Fluid/UI/AISettingsView.swift b/Sources/Fluid/UI/AISettingsView.swiftindex 4c845475..43ceb05f 100644--- a/Sources/Fluid/UI/AISettingsView.swift+++ b/Sources/Fluid/UI/AISettingsView.swift@@ -73,6 +73,7 @@ enum SpeechProviderFilter: String, CaseIterable, Identifiable {case apple = "Apple"case cohere = "Cohere"case openai = "OpenAI"+ case qwen = "Qwen"var id: String { self.rawValue }var displayName: String { self == .nvidia ? "FluidVoice / NVIDIA" : self.rawValue }diff --git a/Sources/Fluid/UI/MeetingDetectionPrompt.swift b/Sources/Fluid/UI/MeetingDetectionPrompt.swiftindex d492eb34..a1296022 100644--- a/Sources/Fluid/UI/MeetingDetectionPrompt.swift+++ b/Sources/Fluid/UI/MeetingDetectionPrompt.swift@@ -647,6 +647,7 @@ final class MeetingStillRecordingNudgeController: ObservableObject {panel.setFrame(Self.frame(abovePill: pillFrame, within: screen), display: false)}panel.orderFrontRegardless()+ DebugLogger.shared.log("end-of-meeting-prompt-shown", source: "MeetingAutoDetector")}/// Centered just above the recording pill, pulled back inside the screen when the pill sits@@ -665,6 +666,9 @@ final class MeetingStillRecordingNudgeController: ObservableObject {}func hide() {+ if self.isPresented {+ DebugLogger.shared.log("end-of-meeting-prompt-hidden", source: "MeetingAutoDetector")+ }self.isPresented = falseself.panel?.orderOut(nil)}diff --git a/Tests/FluidDictationIntegrationTests/DictationE2ETests.swift b/Tests/FluidDictationIntegrationTests/DictationE2ETests.swiftindex bc2ee62a..a21a1e24 100644--- a/Tests/FluidDictationIntegrationTests/DictationE2ETests.swift+++ b/Tests/FluidDictationIntegrationTests/DictationE2ETests.swift@@ -1022,6 +1022,48 @@ extension DictationE2ETests {)}+ func testFinalLeadInPadsShortDictationOnly() {+ let lead = FluidAudioProvider.finalLeadInSamples+ XCTAssertTrue(FluidAudioProvider.usesFinalLeadIn(sampleCount: 16_000, hasPronunciationProfiles: false))+ XCTAssertTrue(FluidAudioProvider.usesFinalLeadIn(sampleCount: 240_000 - lead, hasPronunciationProfiles: false))+ XCTAssertFalse(FluidAudioProvider.usesFinalLeadIn(sampleCount: 240_000 - lead + 1, hasPronunciationProfiles: false))+ XCTAssertFalse(FluidAudioProvider.usesFinalLeadIn(sampleCount: 16_000, hasPronunciationProfiles: true))++ let samples: [Float] = [0.5, -0.25]+ let padded = FluidAudioProvider.withLeadIn(samples)+ XCTAssertEqual(padded.count, lead + samples.count)+ XCTAssertTrue(padded.prefix(lead).allSatisfy { $0 == 0 })+ XCTAssertEqual(Array(padded.suffix(samples.count)), samples)+ }++ func testFinalLeadInTimingsReturnToTheRecordingClock() throws {+ let result = ASRResult(+ text: "hi there",+ confidence: 0.9,+ duration: 1.25,+ processingTime: 0.1,+ tokenTimings: [+ TokenTiming(token: "▁hi", tokenId: 7, startTime: 0.1, endTime: 0.4, confidence: 0.9),+ TokenTiming(token: "▁there", tokenId: 8, startTime: 0.48, endTime: 0.8, confidence: 0.8),+ ]+ )++ let restored = FluidAudioProvider.removingLeadIn(from: result)+ let timings = try XCTUnwrap(restored.tokenTimings)++ XCTAssertEqual(restored.text, result.text)+ XCTAssertEqual(restored.confidence, result.confidence)+ XCTAssertEqual(restored.processingTime, result.processingTime)+ XCTAssertEqual(restored.duration, 1.0, accuracy: 1e-9)+ XCTAssertEqual(timings.map(\.tokenId), [7, 8])+ XCTAssertEqual(timings.map(\.confidence), [0.9, 0.8])+ XCTAssertEqual(timings[0].startTime, 0, accuracy: 1e-9)+ XCTAssertEqual(timings[0].endTime, 0.15, accuracy: 1e-9)+ XCTAssertEqual(timings[1].startTime, 0.23, accuracy: 1e-9)+ XCTAssertEqual(timings[1].endTime, 0.55, accuracy: 1e-9)+ XCTAssertNil(FluidAudioProvider.removingLeadIn(from: ASRResult(text: "", confidence: 0, duration: 0, processingTime: 0)).tokenTimings)+ }+func testPronunciationStoreRejectsInconsistentEnrollments() async {let store = PronunciationDictionaryStore()let enrollments = [diff --git a/Tests/FluidDictationIntegrationTests/WhisperLanguageSelectionTests.swift b/Tests/FluidDictationIntegrationTests/WhisperLanguageSelectionTests.swiftindex 73c11477..9b059b89 100644--- a/Tests/FluidDictationIntegrationTests/WhisperLanguageSelectionTests.swift+++ b/Tests/FluidDictationIntegrationTests/WhisperLanguageSelectionTests.swift@@ -20,6 +20,63 @@ final class WhisperLanguageSelectionTests: XCTestCase {XCTAssertNil(WhisperProvider.runOptions(languageCode: nil).language)}+ func testWhisperRunOptionsKeepLanguageFallbackAndTimestamps() {+ let options = WhisperProvider.runOptions(languageCode: nil, whisperLanguageCode: "hu")+ XCTAssertEqual(options.language, "hu")+ XCTAssertEqual(options.timestamps, .segment)+ XCTAssertEqual(WhisperProvider.runOptions(languageCode: "en", whisperLanguageCode: "hu").language, "en")+ }++ func testQwenDetectsLanguageWithoutInheritingWhisperSelection() {+ let options = WhisperProvider.runOptions(languageCode: nil, model: .qwen3Asr17B, whisperLanguageCode: "he")+ XCTAssertNil(options.language)+ XCTAssertEqual(options.timestamps, .none)+ }++ func testQwenHonorsExplicitLanguageWithoutRequestingTimestamps() {+ let options = WhisperProvider.runOptions(languageCode: "en", model: .qwen3Asr17B, whisperLanguageCode: "hu")+ XCTAssertEqual(options.language, "en")+ XCTAssertEqual(options.timestamps, .none)+ }++ func testQwenUsesItsOwnGGUFAndDoesNotExposeWhisperControls() {+ let model = SettingsStore.SpeechModel.qwen3Asr17B+ XCTAssertEqual(model.whisperModelFile, "Qwen3-ASR-1.7B-Q8_0.gguf")+ XCTAssertNil(model.legacyWhisperModelFile)+ XCTAssertEqual(model.provider, .qwen)+ XCTAssertFalse(model.isWhisperModel)+ XCTAssertFalse(model.supportsStreaming)+ XCTAssertTrue(model.hasPerformanceRatings)+ XCTAssertEqual(SettingsStore.SpeechModel.availableModels.contains(model), CPUArchitecture.isAppleSilicon)+ XCTAssertFalse(SettingsStore.SpeechModel.availableModels.contains(.qwen3Asr))+ }++ func testQwenTranscribesFixtureFromExistingModelAndPreservesWhisperCache() async throws {+ guard let modelPath = ProcessInfo.processInfo.environment["FLUIDVOICE_QWEN_MODEL_PATH"] else {+ throw XCTSkip("Set FLUIDVOICE_QWEN_MODEL_PATH to an existing Qwen GGUF for the local inference check.")+ }+ let directory = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString, isDirectory: true)+ try FileManager.default.createDirectory(at: directory, withIntermediateDirectories: true)+ defer { try? FileManager.default.removeItem(at: directory) }+ let modelFile = try XCTUnwrap(SettingsStore.SpeechModel.qwen3Asr17B.whisperModelFile)+ try FileManager.default.linkItem(at: URL(fileURLWithPath: modelPath), to: directory.appendingPathComponent(modelFile))+ let legacyFile = directory.appendingPathComponent("ggml-tiny.bin")+ try Data("unrelated Whisper cache".utf8).write(to: legacyFile)+ let provider = WhisperProvider(modelDirectory: directory, modelOverride: .qwen3Asr17B)+ guard provider.modelsExistOnDisk() else {+ return XCTFail("This check must reuse the existing model without downloading.")+ }++ try await provider.prepare()+ let samples = try AudioFixtureLoader.load16kMonoFloatSamples(named: "dictation_fixture", ext: "wav")+ let result = try await provider.transcribe(samples)++ XCTAssertTrue(result.text.lowercased().contains("hello"), "Unexpected fixture transcription: \(result.text)")+ XCTAssertTrue(FileManager.default.fileExists(atPath: legacyFile.path))+ XCTAssertTrue(FileManager.default.fileExists(atPath: modelPath))+ print("Qwen fixture transcription: \(result.text)")+ }+func testStoredWhisperLanguageSelectionResolution() {XCTAssertNil(SettingsStore.whisperLanguageCode(fromStoredValue: nil))XCTAssertNil(SettingsStore.whisperLanguageCode(fromStoredValue: "auto"))