macOS-wide autocomplete that runs a local LLM on every keystroke
An open-source, on-device answer to Cotypist that puts LLM-powered tab-autocomplete in every macOS text field.

What it does KeyType is a menu-bar utility that watches the focused text field in any macOS app, predicts a short continuation using a local LLM, and renders it as inline ghost text. Hit Tab to accept the suggestion; keep typing to ignore it.
The interesting bit
Beneath the surface, the repo is sliced into nine local Swift packages that solve the unglamorous problems of system-wide autocomplete: scraping the caret position via accessibility APIs, budgeted prompt assembly, constrained generation with logit masking, and per-app compatibility overrides. It is engineered like a research artifact, not a thin wrapper around llama.cpp.
Key highlights
- Runs fully offline; no keystrokes leave the machine
- Uses macOS accessibility APIs to snapshot focused text fields across apps
- Renders ghost-text overlays and inserts completions via pasteboard or synthetic keystrokes
- Includes constrained generation logic (trie admissibility, logit masking) to keep predictions in bounds
- MIT-licensed alternative to the closed-source app Cotypist
Verdict macOS developers curious about on-device LLM inference and accessibility-driven UI automation should dig into the package layout. If you just want polished autocomplete today, the README frames this as an alternative to the closed-source original.
Frequently asked
- What is johnbean393/KeyType?
- An open-source, on-device answer to Cotypist that puts LLM-powered tab-autocomplete in every macOS text field.
- Is KeyType open source?
- Yes — johnbean393/KeyType is open source, released under the MIT license.
- What language is KeyType written in?
- johnbean393/KeyType is primarily written in Swift.
- How popular is KeyType?
- johnbean393/KeyType has 540 stars on GitHub.
- Where can I find KeyType?
- johnbean393/KeyType is on GitHub at https://github.com/johnbean393/KeyType.