KeyType: Open-Source System-Wide AI Autocomplete for macOS

GitHub trending KeyType delivers on-device, system-wide tab-autocomplete via local LLM on macOS as MIT-licensed alternative to Cotypist.

KeyType: Open-Source System-Wide AI Autocomplete for macOS

Overview of the Release

KeyType is an open-source macOS utility that adds system-wide tab autocomplete powered by local LLMs. The project appeared on GitHub trending lists in recent weeks as an MIT-licensed replacement for the closed-source Cotypist application. It monitors the focused text field in any app, runs inference on-device, and renders inline ghost text that users accept with the Tab key.

How the Architecture Works

The repository organizes logic across several SwiftPM packages rather than a single monolith. MacContextCapture relies on Accessibility APIs to read the current AX focused element, caret position, and surrounding text snapshot. Prompting builds a budgeted, sectioned context string that stays under token limits. ModelRuntime wraps llama.cpp for loading quantized models such as qwen3-5 or gemma variants.

ConstrainedGeneration applies logit masking and trie-based admissibility checks so completions remain valid within the current text field rules. TokenProfiles loads ACPF files that define per-app token restrictions. CompletionUI draws the ghost text overlay without injecting into the target application. TextInsertion falls back between pasteboard and simulated keystrokes depending on the frontmost process.

These choices keep the app lightweight while supporting per-domain overrides stored in AppCompatibility. The design trades some latency for privacy since no text leaves the machine.

Building and Running the Project

Developers targeting macOS 14 or later need a current Xcode installation. After cloning

KeyTypejohnbean393
View on GitHub โ†’
, open the workspace file and build the KeyType scheme. Individual packages can be tested in isolation with commands such as swift test --package-path Packages/Prompting.

The release DMG contains a ready-to-run binary for users who prefer not to compile. Onboarding inside the app requests Accessibility permissions and lets users select a local model file. No additional cloud accounts or API keys are required.

Practical Trade-offs

On-device inference removes data exfiltration risks but shifts compute cost to the user's hardware. Performance varies with model size and Apple Silicon generation. Some applications block Accessibility reads or reject simulated input, so the AppCompatibility layer maintains a growing list of exceptions.

Compared with cloud-based autocomplete services, KeyType offers lower latency once the model is loaded yet cannot match the breadth of a hosted 70B-parameter network. The open repository allows contributors to extend prompt templates or add new insertion strategies without reverse-engineering a proprietary binary.

FAQs

Does KeyType require an internet connection? No. All inference runs through the bundled llama.cpp runtime using models stored locally on disk.

Can I train or fine-tune models for KeyType? The current release consumes pre-quantized GGUF files. No training pipeline is included in the repository.

How does it handle secure text fields such as password prompts? The AppCompatibility package contains rules that disable ghost text in password and credit-card fields by default.

---

๐Ÿ“– Related articles

Need a consultation?

I help companies and startups build software, automate workflows, and integrate AI. Let's talk.

Get in touch
โ† Back to blog