Repository files navigation
Dictate
Speak, and get a tidy message typed into any app on your iPhone. Everything runs on the phone: the speech is transcribed by Apple's on-device speech model, the fillers and stumbles are cleaned up by a small language model on the phone, and nothing is sent to a server.
It started as a private alternative to cloud dictation apps such as Wispr Flow, for typing long messages in Telegram and WhatsApp.
What it does
- Dictate in the app. Tap, talk, tap. The raw transcript is copied straight away and replaced by the cleaned text a second or two later.
- Dictate from the keyboard. A full keyboard with a microphone in the bar above it. Speak, tap ✓, and the cleaned text is typed where your cursor is. The arrow key puts back your exact words if the cleanup changed something you wanted.
- Cleanup that keeps your words. It removes um, uh and stutters, fixes punctuation, and lays out numbered lists, bullet lists, menu paths (Settings > Privacy > Microphone) and quotes. A checker compares every cleanup with what you said and falls back to your exact words if the model added, dropped or changed anything.
- Personal dictionary. Names the transcriber gets wrong, with what it hears instead ("GitHub", heard as "get hub").
- History and test cases. Every dictation is kept on the phone (recordings for 7 days). Mark the ones that came out wrong as test cases and compare the cleanup models on them.
How it works
microphone ──▶ Apple SpeechAnalyzer ──▶ personal dictionary ──▶ cleanup model ──▶ checker ──▶ text
(on-device, English) Qwen3.5 2B (MLX)
or Apple's built-in model
- Transcription: Apple's SpeechTranscriber (iOS 26), English only for now.
- Cleanup in the app: Qwen3.5 2B in 4-bit, run on the phone's GPU with MLX Swift. It is a one-time 1.7 GB download, pinned to a fixed revision. Apple's built-in model is the fallback.
- Cleanup in the keyboard: Apple's built-in model. iOS doesn't let a background app or a keyboard use the GPU, so the open model can't run there.
- Why the keyboard needs the app: iOS doesn't give keyboards the microphone. The first tap of the keyboard's mic opens Dictate, which starts listening in the background. Back in your chat, the keyboard asks the app to record through a shared folder, gets the transcript back and cleans it itself. While listening is on (an hour by default, adjustable), iOS shows its orange microphone dot. Nothing is kept unless you dictate. Opening the app turns listening on too.
Measured so far
Measured on one person's dictations: 77 recordings (41 minutes) and 119 messages of up to 150 words, compared with what Wispr Flow produced for the same speech.
- Transcription: Apple's on-device transcriber disagreed with Wispr Flow's raw transcript on about 6% of words, mostly names and spelling variants. Transcribing live gave the same result as transcribing the finished recording.
- Cleanup: both models moved the transcript closer to Wispr Flow's cleaned text more often than further from it: Apple's model 19 closer and 1 further, Qwen3.5 2B 9 closer and 2 further. Most messages needed no change at all.
- Formatting: 16 of 17 test cases (numbered lists, bullets, menu paths, quotes, and plain messages that must stay plain) for both models.
- Speed on an iPhone 17: about 1.9 s for Qwen3.5 2B to clean a 40 to 50-word message in the app. From the keyboard, which uses Apple's model, about 2.5 to 3 s from tapping ✓ to the clean text being typed. Most of the cleanup time goes on the model reading the same 1,400-token prompt on every message. Caching that prompt is the next thing to try.
These are small samples from a single speaker. Treat them as a sanity check, not a benchmark.
Building it
You need a Mac with Xcode (built with 27.2; older versions untested), an iPhone on iOS 26 or later with Apple Intelligence turned on (for Apple's model), and an Apple ID. A free account works, but apps signed with it stop opening after 7 days and need Developer Mode on the phone.
brew install xcodegen
xcodebuild -downloadComponent MetalToolchain # MLX needs it
cp Config/Signing.example.xcconfig Config/Signing.xcconfig
Edit Config/Signing.xcconfig: your team ID and a bundle prefix you own. Then:
xcodegen generate
open Dictate.xcodeproj
Run the Dictate scheme on your phone. MLX doesn't run in the simulator. Launch with -uiTestFakes there to get scripted speech and cleanup.
On the phone:
- Open Dictate and allow the microphone. In Settings (the gear), download the model.
- To use the keyboard: Settings, General, Keyboard, Keyboards, Add New Keyboard, Dictate, then turn on Allow Full Access. In any app, hold the globe key and pick Dictate.
The engine (recording state, store, cleanup checker, dictionary, keyboard link) is a Swift package with its own tests:
swift test --package-path Packages/DictationCore
Repository layout
| Path | What it is |
|---|---|
| App/ | The SwiftUI app: recording, history, settings, model download |
| Keyboard/ | The keyboard extension |
| Link/ | What the app and the keyboard share (App Group folder, notifications) |
| Controls/ , Shared/ | The Control Center button and the "Start dictation" shortcut |
| Packages/DictationCore/ | Everything that can be tested without a phone |
| tools/ | Mac tools used to choose the transcriber, the model and the prompt |
Limits
- English only.
- Words you take back stay in. "Friday, actually no, Thursday" comes out as you said it.
- The keyboard has no autocorrect or swipe typing. Third-party keyboards can't use Apple's.
- The keyboard opens the app through an undocumented route, as other dictation keyboards do. It works today, but App Review might refuse it, and a future iOS might break it.
- Tested on one iPhone 17 only.
License
See LICENSE.