# Local Dictation: A dictation app for my Mac that runs entirely on-device.

> An on-device macOS dictation app: hold fn, talk, release, and cleaned-up text appears at the cursor. Nothing leaves the Mac.

- Builder: Idrees Kamal (https://idreeskamal.com)
- Context: Personal project · Solo builder · 2026
- Status: Open source · MIT
- Stack: Swift, CoreML / Apple Neural Engine, llama.cpp, MLX LoRA fine-tuning, Accessibility APIs
- Source code: https://github.com/ikamal97/local-dictation
- Last updated: 2026-11-11

## Results

- ~50 ms: from key-down to recording (source: Measured on an M5 MacBook Air)
- ~250 ms: from release to pasted text (source: Measured on an M5 MacBook Air across 130 held-out recordings)
- 3.2%: word error rate (Whisper large-v3-turbo: 8.0%) (source: 130 held-out real recordings (44 minutes), scored against the cloud service’s transcripts)
- 10.5%: cleanup error, fine-tuned 1.2B (prompted Qwen3 4B: 15.0%) (source: Content word error rate on the same held-out set)

## The problem

I was paying $15 a month for a cloud dictation app with a one-to-two-second delay between pressing the key and the app actually listening. Investigating it showed why: the microphone opened cold on every keypress, Bluetooth headsets added a 1–2 s profile switch, and audio crossed several processes before transcription.

## What I did

I built it solo with Claude Code. I benchmarked speech and cleanup models on my own voice before writing the app, then built the native Swift app, the audio pipeline, the fine-tuning data and run, and the evaluation. Along the way I fixed the recognizer emitting “Thank you.” on trailing silence, fixed an MLX-to-GGUF convolution-weight layout bug for LFM2, and set up a signing identity so macOS permissions survive rebuilds.

## Decisions that mattered

1. One native Swift menu-bar process. The microphone stays open in a ring buffer with 0.3 s of pre-roll, and a listen-only event tap watches fn, so recording starts about 50 ms after key-down.
2. Cut audio at pauses and transcribe while I’m still talking, with Parakeet TDT 0.6B v3 on the Apple Neural Engine through FluidAudio and CoreML, so little work is left at release.
3. Fine-tune a small cleanup model instead of prompting a big one: LFM2.5 1.2B Instruct, LoRA-trained with MLX on about 3,700 of my own raw-to-cleaned dictation pairs, run through llama.cpp on Metal.
4. Read the surrounding text through Accessibility APIs so dictation continues mid-sentence in lowercase, fixes spacing and spells on-screen names correctly. Paste, then restore the clipboard.
5. Use llama.cpp’s prebuilt framework instead of MLX-Swift so the app builds with the Command Line Tools alone, no Xcode.

## What changed

On an M5 MacBook Air across 130 held-out real recordings (44 minutes): recording starts about 50 ms after key-down, speech recognition takes 0.09 s median for clips up to 20 s, and text is pasted about 250 ms after release. Word error rate was 3.2% against the cloud service’s transcripts; Whisper large-v3-turbo scored 8.0% and was more than ten times slower. The fine-tuned 1.2B cleanup model scored 10.5% content error against 15.0% for a prompted Qwen3 4B, at under half the latency, with no dropped or invented content in testing. It ships with searchable history, a personal dictionary and one-click import from the cloud app.

## How it was tested

- Measured: Word error rate, cleanup error and latency
- Data: 130 held-out real recordings (44 min)
- Bar: Whisper large-v3-turbo (8.0% WER); a prompted Qwen3 4B for cleanup (15.0%)
- Result: 3.2% WER, 10.5% cleanup error, text pasted ~250 ms after release

## Next

Evaluate across more speakers, microphones and Macs, with a hand-checked reference set.

## Evidence

MIT-licensed source code, benchmark tables and a demo recording.
- View the code: https://github.com/ikamal97/local-dictation

More of Idrees Kamal's work: https://idreeskamal.com/ · Contact: ikamal97@gmail.com
