Speech recognition engines
Speech recognition engines turn the 16 kHz mono audio from voice dictation into text. The system gives dictation one common provider contract while each engine chooses its own model, language, download, live-preview, and long-audio behavior.
Provider abstraction
Transcription provider contract
TranscriptionProvider is the boundary between dictation and speech recognition. A provider reports availability and readiness, prepares its model or system service, accepts PCM samples, and returns an ASRTranscriptionResult with text and confidence. The result can also carry pronunciation enrollment or dictionary-learning data for later processing.
The contract separates the main uses of captured audio:
transcribeStreamingsupplies live preview text.transcribeFinalsupplies the text used after recording stops.transcribeDictionaryTrainingpreserves a training phrase and can capture pronunciation data.transcribeFilelets a provider handle a complete file when its model has a native long-audio path.
The same boundary covers model-cache checks, preparation progress, cache clearing, cancellation, and optional word timings. Providers without a native file path use the shared file-transcription flow described in the audio capture pipeline and dictation processing and typing.
References: Sources/…/TranscriptionProvider.swift• L3-26 Sources/…/TranscriptionProvider.swift• L105-205
Provider routing
ASRService maps the persisted SettingsStore.selectedSpeechModel choice to one provider. The model is the product-level choice. The provider is the engine instance that fulfills it.
The routing relationship is:
flowchart TD
A[Selected speech model] --> B{Model family}
B --> C[Apple Speech]
B --> D[Whisper]
B --> E[Parakeet]
B --> F[Nemotron]
B --> G[External Core ML]
C --> H[TranscriptionProvider]
D --> H
E --> H
F --> H
G --> H
H --> I[ASRService]
I --> J[Live preview or final text]
ASRService reuses the provider for the active model and retires its state when the model changes. It also serializes model work so concurrent recognition does not use the same engine state at the same time.
References: Sources/…/ASRService.swift• L254-372 Sources/…/ASRService.swift• L599-648 Sources/…/ASRService.swift• L4076-4187
Model preparation
Preparation makes an engine usable before dictation starts. The service reports download, optimization, and load phases, then keeps the prepared provider ready for later audio.
The path supports both system engines and local downloaded engines. A valid cache can load without a new download. A model change or failed preparation clears readiness so the next request cannot use stale engine state.
References: Sources/…/TranscriptionProvider.swift• L3-26 Sources/…/ASRService.swift• L4195-4289 Sources/…/SettingsStore.swift• L5693-5735
Apple Speech engines
Apple Speech legacy
Apple Speech legacy uses macOS SFSpeechRecognizer and does not download an app-managed model. It requests speech permission and creates a recognizer for the selected Apple locale.
Each request goes through the system speech service. macOS chooses the available local or online recognition path, so availability depends on system speech services and permission state.
References: Sources/…/AppleSpeechProvider.swift• L5-60 Sources/…/AppleSpeechProvider.swift• L62-113 Sources/…/AppleSpeechProvider.swift• L117-161
Apple Speech Analyzer
Apple Speech Analyzer is the newer on-device Apple engine for macOS 26 and later. It checks locale support, installs the matching system asset when needed, and converts captured audio to the analyzer’s required format.
The provider collects final analyzer results for each request. On older macOS versions, model selection falls back to Apple Speech legacy instead of using an unavailable analyzer API.
References: Sources/…/AppleSpeechAnalyzerProvider.swift• L9-23 Sources/…/AppleSpeechAnalyzerProvider.swift• L41-120 Sources/…/AppleSpeechAnalyzerProvider.swift• L150-168 Sources/…/ASRService.swift• L345-372
Whisper engines
Whisper model family
The Whisper provider runs local Whisper and Qwen GGUF models on Intel and Apple Silicon Macs. Whisper model sizes trade speed and memory use against recognition quality, while Qwen provides a separate local model choice through the same provider boundary.
The provider downloads the selected GGUF model when needed and rejects a cache with the wrong file size. It checks available memory before loading and uses Metal on Apple Silicon or the CPU backend on Intel. Smaller models can support live previews. Medium and Large models favor final transcription because their cost is too high for responsive previews.
References: Sources/…/SettingsStore.swift• L4969-5015 Sources/…/WhisperProvider.swift• L157-256 Sources/…/WhisperProvider.swift• L301-347
Whisper language handling
Whisper supports a broad language set through language codes. The language catalog maps a user language to the code passed to the recognition session, so language choice does not require a different model download.
The setting stores either a supported code or automatic detection. Automatic detection uses the stable auto value. An unsupported restored value resolves to automatic detection rather than reaching the backend.
References: Sources/…/VoiceEngineLanguageCatalog.swift• L96-101 Sources/…/VoiceEngineLanguageCatalog.swift• L361-382 Sources/…/WhisperProvider.swift• L301-335 Sources/…/SettingsStore.swift• L5775-5797 Tests/…/WhisperLanguageSelectionTests.swift• L4-48
Parakeet engines
Parakeet model family
Parakeet is the fast local family for Apple Silicon dictation. TDT v3, Fluid Speech Mini, Fluid Speech Pico, and Fluid Speech Pro support 25 languages. TDT v2 focuses on English, while Parakeet Flash remains the low-latency English engine for live dictation.
The catalog gives each model a stable identity, language set, resource profile, cache location, and pronunciation identity. TDT v2 and v3 use the established model keys. Mini, Pico, and Pro bind pronunciation data to the installed archive revision so an update cannot reuse embeddings from a different checkpoint. Fluid Speech Pro also uses a bundled audio preprocessor for its current archive revision, which keeps that supporting asset aligned with the model checkpoint.
| Model | Main role | Language behavior |
|---|---|---|
| Parakeet TDT v2 | Fast English transcription | English only |
| Parakeet TDT v3 | Fast multilingual transcription | 25 supported languages |
| Fluid Speech Mini | Smaller multilingual model | 25 supported languages |
| Fluid Speech Pico | Smallest multilingual model | 25 supported languages |
| Fluid Speech Pro | Highest-accuracy multilingual model | 25 supported languages |
| Parakeet Flash | Low-latency live dictation | English only |
References: Sources/…/ParakeetSpeechModelCatalog.swift• L4-69 Sources/…/ParakeetSpeechModelCatalog.swift• L180-276 Sources/…/ParakeetSpeechModelBackend.swift• L5-15 Sources/…/LocalParakeetModelLoader.swift• L15-49 Sources/…/SettingsStore.swift• L5060-5112
Parakeet model installation
Parakeet installation has two sources of model truth. Built-in descriptors describe the supported model shape. The signed model feed can update the archive URL, size, and hashes for hosted Mini and Pico releases, while Pro keeps its built-in hosted release metadata and its archive-specific bundled preprocessor.
The feed is accepted only when its signature, schema, sequence, URL, size, and hashes pass validation. It selects the newest release that the current app build and feed format support. Historical entries may use the former download host, but accepted downloads use the trusted current host. The installation snapshot checks the local model outside the UI path and reports installed models and available updates.
A staged release that fails runtime checks can be remembered as rejected without removing the last usable release. The preparation path keeps an installed compact checkpoint usable without waiting for a network refresh. A new download replaces it only after the archive and model pass validation.
References: Sources/…/SpeechModelFeed.swift• L6-15 Sources/…/SpeechModelFeed.swift• L44-106 Sources/…/CompactSpeechModelReleaseCatalog.swift• L88-137 Sources/…/CompactSpeechModelReleaseCatalog.swift• L196-219 Sources/…/ParakeetSpeechModelCatalog.swift• L71-169 Sources/…/SpeechModelInstallationSnapshot.swift• L46-63 Sources/…/SpeechModelInstallationSnapshot.swift• L190-257 Sources/…/FluidAudioProvider.swift• L421-495 Sources/…/LocalParakeetModelLoader.swift• L15-49
Parakeet TDT engines
Parakeet TDT uses a light path for live previews and a stronger final path that can apply vocabulary or pronunciation work. For long recordings, incremental processing can reuse stable earlier work instead of decoding the full growing recording for every preview.
References: Sources/…/FluidAudioProvider.swift• L55-184 Sources/…/FluidAudioProvider.swift• L198-259 Sources/…/FluidAudioProvider.swift• L352-406
Parakeet Flash
Parakeet Flash keeps a streaming end-of-utterance session and consumes only new audio between preview calls. At the end of recording, Flash finishes and resets the session for the next utterance.
References: Sources/…/ParakeetRealtimeProvider.swift• L7-23 Sources/…/ParakeetRealtimeProvider.swift• L125-166 Sources/…/SettingsStore.swift• L5006-5015
Nemotron engines
Nemotron modes
Nemotron 3.5 supplies multilingual Core ML engines in offline and streaming modes. Offline mode favors a complete final pass. Streaming and streaming320 keep recognition state between preview calls and favor low latency.
Streaming modes finish and reset their session when recording stops. Offline and file transcription split long input into model-sized pieces before combining the text. The provider uses the neural engine when it can and retries with CPU and GPU when a model execution plan cannot load on the neural engine.
References: Sources/…/NemotronProvider.swift• L8-37 Sources/…/NemotronProvider.swift• L115-189 Sources/…/NemotronProvider.swift• L204-327 Sources/…/NemotronProvider.swift• L556-565
Nemotron language selection
Nemotron supports automatic detection and a set of manual language locales. The language catalog maps each supported user language to a Nemotron locale and stores that choice separately from the speech model.
The provider applies the selected language to the loaded engine before recognition. A language change therefore affects the next operation. It does not require a model download.
References: Sources/…/SettingsStore.swift• L5612-5644 Sources/…/VoiceEngineLanguageCatalog.swift• L157-160 Sources/…/NemotronProvider.swift• L472-477
External Core ML engines
Cohere Transcribe model
The external Core ML provider loads a registered model bundle outside the built-in engine families. The current registered model is Cohere Transcribe. It supports multiple languages through a manual language choice and runs on Apple Silicon with macOS 15 or later.
The registry defines the model identity, required artifacts, sample rate, audio window, source, and compute plan. The provider validates that contract before loading, downloads missing artifacts, and uses the model’s native file path for complete files.
References: Sources/…/ExternalCoreMLModelRegistry.swift• L60-131 Sources/…/ExternalCoreMLModelRegistry.swift• L208-251 Sources/…/ExternalCoreMLTranscriptionProvider.swift• L7-87 Sources/…/ExternalCoreMLTranscriptionProvider.swift• L115-179
External model language prompts
Cohere Transcribe selects a language by inserting a language token into its prompt. The provider reads the model manifest, maps each supported Cohere language to its token, and applies that prompt for preview, final, and file requests.
Streaming previews use a bounded recent audio window. Final and file requests use the full model input allowed by the artifact contract, so preview text is an early view rather than the final quality pass.
References: Sources/…/ExternalCoreMLTranscriptionProvider.swift• L384-446 Sources/…/SettingsStore.swift• L5648-5691 Sources/…/VoiceEngineLanguageCatalog.swift• L153-155
Model selection
Selection rules
SpeechModel is the persisted choice for the active engine and model. The speech settings page lets the user preview a model, inspect its language and resource needs, download or update it, and activate it. The preview choice stays separate from the active model, so a user can compare models without changing the engine used by dictation.
The available list applies platform gates before selection. Apple Silicon engines are hidden on Intel. Newer system engines require their minimum macOS version. The page also shows when a model is cached, ready, being prepared, or unavailable because the download check failed. The default is Parakeet TDT on Apple Silicon or Whisper Base on Intel.
| Family | Main choice | Language behavior | Live behavior | Platform boundary |
|---|---|---|---|---|
| Apple Speech | Legacy or Analyzer | Apple locale | Provider-specific support | Analyzer requires macOS 26; legacy uses system speech |
| Whisper | Tiny to Large and Qwen GGUF models | Automatic detection or selected Whisper code | Smaller models can stream; heavier models favor final text | Local models; Large variants need Apple Silicon |
| Parakeet | TDT v2, TDT v3, Mini, Pico, Pro, or Flash | TDT v3, Mini, Pico, and Pro support 25 languages; TDT v2 and Flash are English | TDT supports previews; Flash targets low latency | FluidAudio engines require Apple Silicon |
| Nemotron | Offline, Streaming, or Streaming320 | Automatic or selected locale | Offline favors final work; streaming modes return partial text | Apple Silicon and macOS 14 or later |
| External Core ML | Cohere Transcribe | Manual Cohere language | Bounded preview plus native final and file work | Apple Silicon and macOS 15 or later |
References: Sources/…/SettingsStore.swift• L4969-5051 Sources/…/AISettingsView+SpeechRecognition.swift• L164-303 Sources/…/AISettingsView+SpeechRecognition.swift• L315-509 Sources/…/ExternalCoreMLModelRegistry.swift• L236-251 Sources/…/ParakeetSpeechModelCatalog.swift• L173-281
Language routes
VoiceEngineLanguageCatalog presents language-first choices. A route pairs a human language with a model and an engine-specific binding such as an Apple locale, Cohere language, Nemotron locale, or Whisper code. The speech settings page exposes the matching picker for each provider: searchable automatic or manual choices for Whisper, manual language choices for Cohere and Nemotron, and searchable system locales for Apple Speech Analyzer.
Applying a route updates the model and only the language setting required by that engine. Fixed-language models do not need an extra picker. This keeps the language choice consistent in the UI while preserving each provider’s native language format.
References: Sources/…/VoiceEngineLanguageCatalog.swift• L17-57 Sources/…/VoiceEngineLanguageCatalog.swift• L104-139 Sources/…/VoiceEngineLanguageCatalog.swift• L141-176 Sources/…/AISettingsView+SpeechRecognition.swift• L534-559 Sources/…/AISettingsView+SpeechRecognition.swift• L588-714 Sources/…/AISettingsView+SpeechRecognition.swift• L757-797
Streaming cadence
The model choice also sets the minimum audio prefix and preview cadence. Fast streaming engines can update often. Heavier engines use a longer interval or skip live work when they cannot provide a useful preview in time.
ASRService starts streaming only for models marked as streaming-capable. It skips live recognition for dictionary-training captures, so final-only engines and training flows use the same dictation boundary.
References: Sources/…/SettingsStore.swift• L5006-5051 Sources/…/ASRService.swift• L2015-2025
Vocabulary support
Parakeet custom vocabulary
Custom vocabulary helps Parakeet TDT recognize names, product terms, and other uncommon words. It applies only to Parakeet TDT v2 and v3 on supported Apple Silicon systems.
The vocabulary store keeps user terms with optional aliases and weights. It normalizes terms, limits the active set, and tokenizes them for the Parakeet recognition path. Instant replacement rules remain deterministic post-recognition rules and do not become fuzzy vocabulary candidates. Final recognition can use the boosted context, while live previews use the lighter path for stable streaming.
References: Sources/…/ParakeetVocabularyStore.swift• L127-187 Sources/…/ParakeetVocabularyStore.swift• L193-228 Sources/…/ParakeetVocabularyStore.swift• L331-401 Sources/…/FluidAudioProvider.swift• L131-167
Vocabulary reloads
Saving vocabulary does not change the selected model. It sends a change notice to ASRService, which reloads the Parakeet provider while idle so the next session sees the new terms.
If recording is active, the service delays the reload until recording stops. This protects the recognition state of the current session.
References: Sources/…/ParakeetVocabularyStore.swift• L136-141 Sources/…/ParakeetVocabularyStore.swift• L164-187 Sources/…/ASRService.swift• L1316-1345
Change checklist
When these files or sections are changed, remember to consider these:
- Keep
SpeechModelcases, provider routing inASRService, and language routes inVoiceEngineLanguageCatalogaligned. A selectable model without a route or provider can fail after selection. - Keep platform and OS gates aligned with provider availability. The settings list and runtime fallback must make the same choice.
- Keep Whisper model metadata and backend validation aligned. A model can download successfully and still fail if the selected compute backend cannot load it.
- Preserve the
autoWhisper language value and supported-code validation when changing language storage. Invalid restored values must not reach the recognition backend. - When changing a model’s audio window or language-token contract, update the external Core ML registry and manifest handling together. A complete cache can still be incompatible with the selected model.
- Keep Parakeet descriptors, model-feed entries, archive hashes, manifest hashes, and installation snapshots aligned. A release can appear installed or current while its cache is not the advertised checkpoint.
- Preserve the compact-model pronunciation key revision. Reusing an old archive identity can apply pronunciation data to an incompatible model.
- Keep the Fluid Speech Pro archive revision and its bundled preprocessor contract aligned. A model can load with an incompatible supporting asset if the revision check changes without the bundled resource.
- Preserve the idle boundary for Parakeet vocabulary reloads. Reloading during a session can discard provider state.
- When changing streaming support, update both
SpeechModel.supportsStreamingand the provider’s streaming and final semantics. The service uses the flag to decide whether live recognition starts. - Keep the speech settings display and model actions aligned with installation state. A model can be shown as active only when its selected model is installed and the provider is ready.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| Speech permission is denied or Apple Speech is restricted | Apple Speech cannot prepare or recognize audio | Preparation requests authorization and reports the provider error |
| A selected model is unavailable for the Mac architecture or OS | The model is hidden, falls back, or cannot prepare | Model availability applies platform and OS gates |
| A downloaded model or external artifact bundle is incomplete or invalid | The provider cannot load a ready engine | Providers validate required files and model metadata before loading |
| The Fluid Speech Pro preprocessor is missing or does not match its archive revision | Pro preparation cannot load a usable model | The local loader substitutes the bundled preprocessor only for the known archive revision and reports a reinstall error when it is missing |
| A signed Parakeet feed is stale, invalid, or rejected | New hosted weights are not advertised or downloaded | The feed checks signature, sequence, schema, hashes, and release state |
| A feed release is valid but does not support the current app build or format | The app keeps the built-in or last compatible model metadata | Feed selection requires a compatible build and format |
| A hosted model archive or manifest differs from the installed revision | The app reports an update or refuses to treat the cache as the current release | Installation snapshots compare archive and manifest identity |
| A staged compact release fails runtime validation | The app could replace a working model with unusable weights | The download path validates before publication and remembers rejected manifests |
| A stored Whisper language code is unsupported | Whisper uses automatic detection instead of the intended forced language | Settings validate stored codes against the language catalog |
| Nemotron receives an unsupported language or cannot load its neural-engine plan | Recognition can fail or use the wrong language | The provider applies a supported target and retries with CPU and GPU when needed |
| Parakeet vocabulary changes during recording | New terms are not used by the current session | ASRService queues the reload until recording stops |
| A live preview uses an engine that cannot meet its cadence | Text appears late or live recognition is skipped | Model metadata marks streaming support and sets preview cadence |
| The settings page treats a cached or selected model as ready before provider preparation completes | Activation can appear complete while dictation has no usable engine | UI readiness combines installation state with ASRService readiness |
Key files
| File | Why to read it |
|---|---|
| Sources/…/TranscriptionProvider.swift | Defines the shared provider boundary, preparation phases, and result types. |
| Sources/…/ASRService.swift | Shows model routing, provider lifecycle, reset behavior, and live-recognition decisions. |
| Sources/…/SettingsStore.swift | Defines model choices, platform gates, language settings, and streaming metadata. |
| Sources/…/VoiceEngineLanguageCatalog.swift | Shows how user language choices map to models and provider-specific settings. |
| Sources/…/AISettingsView+SpeechRecognition.swift | Shows how users preview, download, activate, update, delete, and set languages for speech models. |
| Sources/…/AppleSpeechProvider.swift | Shows the legacy macOS speech path. |
| Sources/…/AppleSpeechAnalyzerProvider.swift | Shows the macOS 26 Speech Analyzer path and system asset preparation. |
| Sources/…/WhisperProvider.swift | Shows local Whisper and Qwen model preparation, backend choice, validation, and language handling. |
| Sources/…/FluidAudioProvider.swift | Shows Parakeet TDT live, final, incremental, and enhancement-aware recognition. |
| Sources/…/ParakeetSpeechModelCatalog.swift | Defines Parakeet model identities, language support, hosted model contracts, archive revisions, and pronunciation identities. |
| Sources/…/LocalParakeetModelLoader.swift | Shows the archive-specific bundled preprocessor used when loading Fluid Speech Pro. |
| Sources/…/ParakeetSpeechModelBackend.swift | Maps catalog variants to the speech model backend. |
| Sources/…/CompactSpeechModelReleaseCatalog.swift | Applies signed compact-model releases and keeps usable releases across feed failures. |
| Sources/…/SpeechModelFeed.swift | Defines the signed release-feed contract, compatibility selection, trusted host rules, and validation rules. |
| Sources/…/SpeechModelInstallationSnapshot.swift | Reports installed models and available updates without blocking model selection. |
| Sources/…/ParakeetRealtimeProvider.swift | Shows the Parakeet Flash streaming boundary. |
| Sources/…/NemotronProvider.swift | Shows Nemotron offline, streaming, language, fallback, and native file behavior. |
| Sources/…/ExternalCoreMLModelRegistry.swift | Defines the external Core ML artifact and manifest contract. |
| Sources/…/ExternalCoreMLTranscriptionProvider.swift | Shows external model preparation, language prompts, previews, and native file work. |
| Sources/…/ParakeetVocabularyStore.swift | Shows how custom terms become Parakeet vocabulary and how changes notify the service. |
| Tests/…/WhisperLanguageSelectionTests.swift | Captures the Whisper language-code and automatic-detection contract. |