- Rust 78.5%
- JavaScript 6.6%
- TypeScript 4%
- HTML 4%
- Shell 2%
- Other 4.9%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
* ios: clean up what I say with Hex's on-device dictation tagger (experiment)
What changed
- Experiments › Clean up what I say (off by default, App Group key
experiments.cleanupTagger): Hex's trained cleanup tagger removes ums,
repeats, and the words a spoken correction replaces ("3pm, actually 4pm"),
on the iPhone, in in-keyboard dictation and in app dictation. It runs after
transcription and learned fixes (in the app also after custom vocabulary),
before Apple Intelligence cleanup, translation, and formatting, and never
for Verbatim. When both cleanups are on, Apple Intelligence now receives the
tagged text instead of the raw transcript; nothing else changes while the
experiment is off.
- Model: the BERT L-4/H-512 token classifier (ckpt-1200k-l4h512) converted to
an int8 Core ML ML Program (coremltools 9, fp16 compute, enumerated lengths
16/32/64/128 plus a length input that masks the padding; the output is
logit(DELETE) - logit(KEEP)), 28.5 MB, with its WordPiece vocabulary. Both
ship once, in HEXKeyboard.appex (HEXKeyboard/CleanupTagger/), and the app
loads them from its embedded keyboard extension. Core ML codegen is off for
the keyboard target.
- HEXShared: CleanupTokenizer (Hugging Face BertTokenizer: special tokens,
BertNormalizer, BertPreTokenizer, WordPiece, byte-exact vocabulary keys,
HF's Unicode 8.0 character classes), CleanupReconstruction (a port of
js/reconstruct.js with JavaScript's UTF-16 casing), and CleanupTagger
(chunks of whole words within 128 tokens, P(DELETE) > 0.98, one serial
queue, 150 ms budget). A timeout, an error, or a result with no words left
keeps the transcript. The model loads when a dictation starts recording with
the experiment on, stays loaded, and is freed on a memory warning. It runs
on the Neural Engine or the CPU, never the GPU.
- Call sites: one each in KeyboardLocalDictation (after DictationCorrections,
before translation) and DictationController (after VocabularySpelling,
before the Apple Intelligence pass). prepareIfEnabled runs at recording
start, in KeyboardViewController and in DictationController.startRecording.
Why
- In the simulator the first load took 0.15 s on the CPU and 0.8 s on the GPU
path, both over the 150 ms budget. So loading starts when recording starts,
and the GPU isn't used (it also added 30 MB of footprint, against 3 MB on the
CPU, which keeps the int8 weights memory-mapped).
- Threshold 0.98, not the exported 0.95: 1/45 false deletes on hand-written
clean sentences against 3/45, with the same self-correction accuracy.
Verified
- xcodebuild test on the iPhone 18 Pro simulator: 168 tests, 0 failures,
including the new CleanupTaggerTests and DictationControllerTests
testCleanupTaggerRunsAfterLearnedFixesAndSkipsVerbatim. After the fixtures
were rewritten one case per line (same content), CleanupTaggerTests and
DictationControllerTests passed again (28 tests).
- Parity on the 137 hand-written sentences at 0.98: labels match the fp32
checkpoint on all 1,128 words, and 136/137 outputs match the ONNX int8
pipeline. #120 ("The cat keeps trying to scratch that chair.") differs on
two words that ONNX keeps (P 0.9725/0.9794) and Core ML deletes (0.984).
The fp32 checkpoint also deletes them (0.9879/0.9853), so the difference
comes from ONNX's int8 activations. 128/137 outputs match the hand-written
targets. The tokenizer matches HF on 1,891 words, and reconstruction matches
reconstruct.js on 670 cases.
- Simulator, CPU path: load 140-161 ms, first sentence after load about 8 ms,
then 3.3 ms median and 7.5 ms p95 per sentence; phys_footprint +2.9 MB.
- The Release generic iOS build with CODE_SIGNING_ALLOWED=NO succeeds.
HEXKeyboard.appex is 30.2 MB (model 27.8 MB, vocabulary 0.2 MB).
- Not verified on a physical iPhone: Neural Engine load time, latency, and the
keyboard extension's footprint next to Apple Speech.
Note: this adds a 28.4 MB binary (weight.bin) to git; the repo has no LFS.
* Fetch the cleanup tagger's Core ML model at build time instead of committing it
The 27 MB mlpackage would have been ~30x the largest file in the repo, kept in history forever. It is now the ios-model-cleanup-tagger-1 release asset; ios/scripts/fetch-cleanup-model.sh downloads it, checks its SHA-256, and skips when the pinned copy is already in place. Xcode Cloud runs it in ci_post_clone.sh before xcodegen; the folder is gitignored.
Verified the fetched package is byte-identical to the one the tests ran against (diff -r), and a second run is a no-op.
|
||
| .cargo | ||
| .cloudflare/cache | ||
| .config | ||
| .github | ||
| app | ||
| assets | ||
| crates | ||
| design | ||
| docs | ||
| ios | ||
| macos/HexMicrophoneDriver | ||
| native | ||
| nix | ||
| packaging | ||
| perf | ||
| prototypes/app-shell | ||
| release-notes | ||
| resources | ||
| scripts | ||
| sdk | ||
| site | ||
| skills/hex-personal-commands | ||
| src | ||
| tests | ||
| .gitignore | ||
| .hivemind.toml | ||
| .markdownlint-cli2.jsonc | ||
| AGENTS.md | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| clippy.toml | ||
| CONTRIBUTING.md | ||
| flake.lock | ||
| flake.nix | ||
| LICENSE | ||
| README.md | ||
| ROADMAP.md | ||
| SECURITY.md | ||
| strobe.json | ||
| THIRD_PARTY_NOTICES.md | ||
Hex
Hex is local voice dictation for Mac, Windows and Linux. Hold a key, speak, and it pastes.
How it works
- hold the shortcut, speak, then let go
- Hex transcribes on your device and pastes into whatever app you're in
- the first run downloads a speech model; after that nothing leaves your machine
- experimental features live in Labs, at the bottom of the sidebar
What it does
- hold the shortcut to dictate, or set Shortcut mode to Tap to start and stop with a press
- the text lands at the cursor in whatever app you're in
- Option-Shift-V pastes the last dictation again (Ctrl-Alt-V on Windows and Linux)
- History keeps your dictations, searchable, for 7 days by default
- Output runs every dictation through steps you choose (word replacements, built-in cleanups, your own scripts, an optional OpenCode rewrite), with different steps per app or website
- Vocabulary is one list of names Hex should know; Whisper and Qwen3-ASR read it while transcribing, Parakeet models read it with Labs › Vocabulary help on, and the OpenCode rewrite uses it
- Annotate records the screen while you draw and talk, on macOS, Linux and Windows (GNOME Wayland needs Labs › Annotate on GNOME)
- an authenticated local API and the TypeScript SDK transcribe with the same model, for your own tools
- Meetings is a macOS lab that records a call and writes the transcript
Output and History:
Speech models
Hex downloads one model the first time it runs and transcribes with it on your
machine from then on. On an English system that's Parakeet Unified English: it
writes while you talk, so the text is ready when you let go. Other languages
start with the model recommended for them. That model also serves meetings and
hex transcribe.
Settings' picker offers more, among others:
- Parakeet v3: 25 European languages, and it hears which one you speak
- Cohere Transcribe: the fewest wrong words, in 14 languages; a big download
- Whisper large-v3-turbo: almost any language, and it reads your vocabulary
- Qwen3-ASR 0.6B: Chinese and 29 more, and it reads your vocabulary
- SenseVoice Small: Chinese, Japanese, Korean and English; a small download
- Nemotron 3.5 ASR: writes while you talk, in 27 languages
- Granite Speech 5.0: IBM's model, seven languages, with punctuation
- one-language models: ivrit.ai Whisper for Hebrew, GigaAM v3 for Russian, NB-Whisper for Norwegian, KB-Whisper for Swedish, QwenCleo-ASR for Egyptian Arabic
- more English models: Parakeet v2 and Underdog Bark 3.0
Add a GGUF model of your own with "Add model file…" in the picker; see your own speech models.
Downloads
Stable is the current release. Dev is the newest build of dev and updates
itself from the dev channel.
| Platform | Stable | Dev |
|---|---|---|
| macOS (Apple silicon) | DMG | DMG |
| Windows x64 | Installer | Installer |
| Windows ARM64 | Installer | Installer |
| Linux x86_64 | Executable | Executable |
| Linux x86_64 (Debian, Ubuntu) | .deb | .deb |
| Linux x86_64 (Fedora, openSUSE) | .rpm | .rpm |
| Linux ARM64 | Executable | Executable |
| Linux ARM64 (Debian, Ubuntu) | .deb | .deb |
| Linux ARM64 (Fedora, openSUSE) | .rpm | .rpm |
Or install with:
- Homebrew:
brew install --cask anomalyco/tap/hex - AUR:
yay -S hex-bin - install script (Linux):
curl -fsSL https://anoma.ly/hex/install-linux.sh | sh - Nix (Linux):
nix profile add github:anomalyco/hex
Command line
hex transcribe meeting.m4a prints a recording's transcript, whether or not
the app is running. It reads WAV, AIFF, CAF, FLAC, MP3, Ogg, WebM, and
MP4/M4A/MOV, including a video's soundtrack. The same hex controls the
running app (hex status, hex dictation, hex settings); see
docs/cli.md.
On macOS the CLI is inside the app. Homebrew links it for you; otherwise link
it somewhere on your PATH that you own:
ln -s /Applications/Hex.app/Contents/MacOS/hex ~/.local/bin/hex
Linux and Windows installs put hex on your PATH.
More docs are in docs/.
Contributing
We don't take pull requests. Open an issue describing the bug or idea, and our agents usually turn it around fast.
MIT licensed.