feat: on-device llm rewrite pass for dictated takes - #28
Merged
Conversation
After a take finalizes, Apple's on-device Foundation model polishes it in place: punctuation, repeated-word dedup, vocabulary-aware fixes, optional symbol-speak. Deterministic regex handles fillers; the model only does judgment work. Transcript goes in as delimited data (never a message); an acceptability gate rejects answers, refusals, and silent profanity censorship, degrading to the filler-stripped text. Applied as a prefix-cut keystroke edit ~1-3s after release; cancelled by squeeze/ erase/send/app switch; blue menu dot while the model runs. Off by default ([rewrite] enabled in config). Also: permission prompts now sequence (mic then accessibility) so the second dialog isn't buried, and live progress cards drop their OK button until done. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Optional post-dictation polish using Apple's on-device Foundation model (Apple Intelligence, macOS 26+), configured via a new literate
[rewrite]section: templated switches (removeFillers,fixPunctuation,fixGrammar,correctVocabulary,technicalFormatting) plus one freeformcustomInstructions. Off by default.Design
<transcript>tags with instructions that questions/requests inside are things the speaker said. Without this, the 3B model answers meta-dictation instead of editing it.Prompt was tuned across four eval rounds against 50 real dictations via the new
--rewrite-evalharness (runs the production pipeline against a sample file): final round has zero gate rejections, ~1.7s average latency.Also carries two live-verified UX fixes: sequenced permission prompts (mic → accessibility, so the second dialog isn't buried) and no OK button on in-progress cards.
Testing
swift run tingle-tests), including new suites for filler strip, gate, prompt assembly, profanity backstop, and the edit/apply path🤖 Generated with Claude Code