Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LocalTypist

LocalTypist is a private native macOS autocomplete app inspired by Cotypist's workflow. It is built from scratch in Swift/SwiftUI and uses your local GGUF model through llama.cpp.

What Is Included

  • SwiftPM macOS app project.
  • Menu bar app with Settings.
  • Safe auto-start of text monitoring when completions are enabled and Accessibility permission is already granted.
  • Direct Gemma model auto-loads in the background by default when direct mode is selected.
  • Accessibility permission onboarding.
  • Setup preflight checks for Accessibility, optional Screen Recording, model readability, llama.cpp runtime libraries, and selected backend readiness.
  • Model backend self-test from Settings, with elapsed time and output preview for the selected direct or server backend.
  • Observer-first focused text monitoring through macOS Accessibility, with fallback polling.
  • Local suggestion overlay using a non-activating NSPanel.
  • Optional floating accessory button beside focused text fields for force-completing manually.
  • Tested overlay layout for inline and mirror suggestions, including edge clamping and below-screen flipping.
  • Local spelling-fix suggestions using macOS spell checking, with exact source-text replacement on accept.
  • Local emoji shortcode suggestions such as :rocket -> 🚀, with exact shortcode replacement on accept.
  • Global event tap for:
    • configurable next-word acceptance
    • configurable full-completion acceptance
    • configurable dismiss, force-complete, pause-current-app, and global toggle shortcuts
  • Clipboard context toggle.
  • Optional ScreenCaptureKit + Vision OCR context toggle; screen text is processed locally and not persisted.
  • Obvious secret patterns are redacted from prompt context before local model generation.
  • Custom AI instructions.
  • Autocorrect controls for suppressing completions while typing a likely typo and showing suggested fixes.
  • Mid-line completion toggle for suggesting text when there is existing text after the cursor.
  • Emoji settings pane with a local shortcode suggestion toggle.
  • Personalization settings pane with custom AI instructions, opt-in encrypted local typing history, and a word-choice strength slider.
  • Per-app rules and temporary pause support.
  • Per-app privacy controls for clipboard context, screen context, and personalization data.
  • Per-app custom AI instructions that merge with global writing preferences for the current prompt.
  • Menu bar quick controls for current-app enablement, mirror/pill mode, troubleshooting insertion, pause/resume, per-app privacy controls, global context toggles, and model loading.
  • Compatibility defaults for terminals, browser/editor edge cases, and Electron-style apps.
  • Launch-at-login settings using SMAppService.
  • Local JSON completion statistics in Application Support, including generated/accepted counts and average generation latency.
  • Local encrypted typing-history records in Application Support when personalization is enabled; the AES key is stored in Keychain.
  • Typing-history personalization also redacts obvious secrets before encrypted local storage.
  • Direct in-process libllama integration through a small C shim target.
  • Vendored llama.cpp bootstrap script pinned to a Gemma 4-capable official tag; SwiftPM prefers this runtime when built.
  • Cancellation-aware direct generation: queued stale requests are skipped, in-progress token generation checks cancellation, and only the newest request can publish a suggestion.
  • Optional llama-server fallback backend.
  • Shortcut recorder controls in the Completion settings pane.
  • Build script discovers vendored or Homebrew libllama/ggml dylib dependencies, stages them into dist/LocalTypist.app/Contents/Frameworks, rewrites load paths to @rpath, and fails if Homebrew load paths remain.
  • Staged app bundle includes a ScreenCaptureKit purpose string for optional screen-context OCR.
  • llama-server process management and /completion API client.
  • Build/run script that stages a real .app bundle.

Requirements

  • macOS 14 or newer.
  • Apple Silicon Mac.
  • Swift 6 toolchain / Xcode command line tools.
  • Homebrew llama.cpp tools, already found on this machine at:
    • /opt/homebrew/bin/llama-server
    • /opt/homebrew/bin/llama-cli
  • For direct Gemma 4 E2B support, run the vendored bootstrap once:
    • ./script/bootstrap_llama_cpp.sh
  • A local GGUF model file. Choose its path in Settings after first launch.

Run

cd LocalTypist
./script/bootstrap_llama_cpp.sh
./script/build_and_run.sh

Open Settings from the menu bar item, grant Accessibility permission, then start the model server. Direct libllama mode is the default; the server backend remains available from Settings as a fallback.

Notes

The first direct model load can take a while because the 3.2 GB GGUF model must be loaded into the app process. The Model settings pane lets you choose between the direct libllama backend and a llama-server fallback backend.

The installed Homebrew llama.cpp 8610 does not understand the model's gemma4 GGUF architecture on this machine. The project therefore vendors a newer official llama.cpp tag under .vendor/llama.cpp for direct mode.

This app does not copy Cotypist's proprietary executable code, bundled libraries, assets, fonts, local database, or private implementation.

Current Limitations

  • The app bundle carries the direct libllama/ggml dylibs copied from the vendored llama.cpp build when present, falling back to Homebrew only if the vendored build has not been created.
  • Screen OCR context depends on macOS Screen Recording permission and app/window capture compatibility.
  • App compatibility will need iterative testing in the apps you actually type in.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages