autocomplete anywhere anything
Swift
4
24 commits
updated May 29, 2026
Tabyrus is a macOS daemon that provides AI-powered autocomplete, grammar checking, and code reshaping in any text field across all applications. All inference runs locally via Apple's MLX framework.
┌─────────────────────────────────────┐
│ Swift Frontend (macOS daemon) │
│ • AX monitoring │
│ • Event taps │
│ • Suggestion overlay │
│ • Menu bar UI │
├─────────────────────────────────────┤
│ Rust Backend (FFI via dlopen) │
│ • MLX inference (mlx_lm.generate) │
│ • Completions / Grammar / Reshape │
│ • Clipboard analysis │
│ • Hardware detection │
│ • Model download (Hugging Face) │
└─────────────────────────────────────┘
All ML logic lives in Rust. Swift is a thin layer handling macOS-native concerns: accessibility monitoring, event taps, suggestion overlays, and the menu bar.
mlx_lm.generate on PATH)# Install brisk build tool (if not installed)
wax install brisk
# Build and run
brisk run
On first launch, Tabyrus will prompt you to download an AI model. Choose Gemma 4 (recommended, ~3.6GB) or Qwen 3.5 (lightweight, ~0.5GB).
| Model | Size | Description |
|---|---|---|
| Gemma 4 | ~3.6 GB | Google's instruction-tuned model. Best quality. |
| Qwen 3.5 0.8B | ~0.5 GB | Fast, lightweight. Good for lower-end machines. |
| Zeta-2 | ~0.8 GB | Code editing specialist with next-edit-prediction. |
Models are downloaded from Hugging Face and cached at ~/Library/Caches/tabyrus/models/.
# Build Rust backend
cargo build --features mlx
# Build Swift app
swift build
# or: brisk build
Tabyrus is valid from ~/projects/tabyrus. The old ~/projects/otto path can leave stale SwiftPM module cache entries behind; if Swift reports a module cache path containing otto, remove .build/ and rebuild.
The Rust backend is tabyrus-backend in src/lib.rs. Build it with the default mlx feature, then run the Swift shell against the produced libtabyrus_backend.dylib:
cargo fmt --check
cargo check --all-targets --all-features
cargo test --all-targets --all-features
cargo build --features mlx
swift build
swift test
brisk build
Autocomplete, grammar checking, code reshaping, clipboard classification, and clipboard summarization all route through the Rust FFI boundary and invoke mlx_lm.generate against models cached under ~/Library/Caches/tabyrus/models/. Without a downloaded model, autocomplete and autocorrect return no ML suggestion instead of falling back to cloud inference.
aurorality-core from https://github.com/tschk/aurorality.git.eqswift from crates.io, and TabyrusBackend/Package.swift builds the in-tree Swift binding under TabyrusBackend/Sources/EqSwift.Cotabby is the comparison target at ~/projects/cotabby-fork. Benchmark Tabyrus against Cotabby on the same machine by measuring:
cargo check, cargo test, swift build, and brisk build; Cotabby xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' build.mlx_lm.generate; Cotabby Apple Intelligence or llama.cpp engine time. Report model name, macOS version, CPU, memory, warmup count, sample count, and whether models were already loaded.Latest local baseline, measured on macOS 26.5 (25F71), Apple M5 Pro, 48 GB RAM, 15 CPU threads:
| Check | Tabyrus | Cotabby |
|---|---|---|
| App build | brisk build: 3.54s real | xcodebuild ... build CODE_SIGNING_ALLOWED=NO: 9.39s real |
| Focused autocomplete tests | swift test: 6 tests, 0 failures, 0.40s real | xcodebuild ... test -only-testing:SuggestionTextNormalizerTests -only-testing:SuggestionSessionReconcilerTests: 30 tests, 0 failures, 2.04s real |
| Backend tests | cargo test --all-targets --all-features: 9 tests, 0 failures | Not applicable; Cotabby runtime is Swift/C++ through CotabbyInference |
| Local model state | Tabyrus MLX model directories present; mlx_lm.generate missing on PATH | Cotabby test launch reported 0 GGUF models and Foundation model engine available |
The numbers above are build and deterministic suggestion-policy checks. They are not an inference-latency claim because the Tabyrus MLX CLI was not available on PATH during the run.
Practical desktop smoke test: launched .build/debug/Tabyrus.app, typed into TextEdit through macOS UI automation, and pressed Tab. TextEdit received the literal Tab and no ghost overlay appeared while mlx_lm.generate was unavailable on PATH.
Cargo.toml # Rust backend crate manifest
src/
├── lib.rs # Rust MLX backend and C FFI exports
├── App/
│ ├── AppDelegate.swift # Menu bar, status, downloads
│ ├── AutoCompleteApp.swift # NSApplication entry point
│ ├── Coordinators/
│ │ ├── SettingsCoordinator.swift # Settings sync
│ │ └── SuggestionCoordinator.swift # Completion pipeline
│ └── Core/
│ └── TabyrusEnvironment.swift # Dependency container
├── Services/
│ ├── Focus/FocusTracker.swift # Active app tracking
│ ├── Input/InputMonitor.swift # Keyboard event monitoring
│ ├── Runtime/
│ │ ├── ModelManager.swift # Download/status management
│ │ ├── TabyrusBackend.swift # Rust FFI wrapper
│ │ └── TabyrusSuggestionEngine.swift # Suggestion generation
│ ├── ClipboardMonitor.swift # Clipboard content capture
│ ├── ScreenshotMonitor.swift # Screen capture
│ └── PermissionManager.swift # Accessibility/input permissions
├── Support/
│ ├── AIService.swift # AI service abstraction
│ ├── AppCustomizationManager.swift # Per-app learning
│ ├── CodeReshapeService.swift # Code transformation
│ ├── HardwareDetector.swift # System capability detection
│ ├── SuggestionRequestFactory.swift # Prompt construction
│ ├── SuggestionTextNormalizer.swift # Output cleanup
│ └── TabyrusSettings.swift # Settings + models
├── UI/
│ ├── CompletionOverlay.swift # Ghost-text overlay
│ └── GrammarWidget.swift # Grammar suggestion panel
TabyrusBackend/
├── Package.swift # Swift package wrapper for backend bridge
└── Sources/TabyrusBackend/
└── TabyrusBackend.swift # Reusable Rust FFI Swift wrapper
Tests/
└── TabyrusTests/ # Swift policy tests for autocomplete cleanup
Tabyrus requires Accessibility permissions to monitor text input across applications. On first run, it will prompt you to enable this in System Settings.
Optional: Screen Recording permission for screenshot-based context (disabled by default).
The codebase is designed to be modular:
TabyrusSettings.swift and lib.rs (CompletionModel enum)Services/src/UI/MPL-2.0 — See LICENSE
24 commits
Swift
68.4%
Rust
19.5%
C
12.1%
autocomplete anywhere anything
Swift
4
24 commits
updated May 29, 2026
Tabyrus is a macOS daemon that provides AI-powered autocomplete, grammar checking, and code reshaping in any text field across all applications. All inference runs locally via Apple's MLX framework.
┌─────────────────────────────────────┐
│ Swift Frontend (macOS daemon) │
│ • AX monitoring │
│ • Event taps │
│ • Suggestion overlay │
│ • Menu bar UI │
├─────────────────────────────────────┤
│ Rust Backend (FFI via dlopen) │
│ • MLX inference (mlx_lm.generate) │
│ • Completions / Grammar / Reshape │
│ • Clipboard analysis │
│ • Hardware detection │
│ • Model download (Hugging Face) │
└─────────────────────────────────────┘
All ML logic lives in Rust. Swift is a thin layer handling macOS-native concerns: accessibility monitoring, event taps, suggestion overlays, and the menu bar.
mlx_lm.generate on PATH)# Install brisk build tool (if not installed)
wax install brisk
# Build and run
brisk run
On first launch, Tabyrus will prompt you to download an AI model. Choose Gemma 4 (recommended, ~3.6GB) or Qwen 3.5 (lightweight, ~0.5GB).
| Model | Size | Description |
|---|---|---|
| Gemma 4 | ~3.6 GB | Google's instruction-tuned model. Best quality. |
| Qwen 3.5 0.8B | ~0.5 GB | Fast, lightweight. Good for lower-end machines. |
| Zeta-2 | ~0.8 GB | Code editing specialist with next-edit-prediction. |
Models are downloaded from Hugging Face and cached at ~/Library/Caches/tabyrus/models/.
# Build Rust backend
cargo build --features mlx
# Build Swift app
swift build
# or: brisk build
Tabyrus is valid from ~/projects/tabyrus. The old ~/projects/otto path can leave stale SwiftPM module cache entries behind; if Swift reports a module cache path containing otto, remove .build/ and rebuild.
The Rust backend is tabyrus-backend in src/lib.rs. Build it with the default mlx feature, then run the Swift shell against the produced libtabyrus_backend.dylib:
cargo fmt --check
cargo check --all-targets --all-features
cargo test --all-targets --all-features
cargo build --features mlx
swift build
swift test
brisk build
Autocomplete, grammar checking, code reshaping, clipboard classification, and clipboard summarization all route through the Rust FFI boundary and invoke mlx_lm.generate against models cached under ~/Library/Caches/tabyrus/models/. Without a downloaded model, autocomplete and autocorrect return no ML suggestion instead of falling back to cloud inference.
aurorality-core from https://github.com/tschk/aurorality.git.eqswift from crates.io, and TabyrusBackend/Package.swift builds the in-tree Swift binding under TabyrusBackend/Sources/EqSwift.Cotabby is the comparison target at ~/projects/cotabby-fork. Benchmark Tabyrus against Cotabby on the same machine by measuring:
cargo check, cargo test, swift build, and brisk build; Cotabby xcodebuild -project Cotabby.xcodeproj -scheme Cotabby -destination 'platform=macOS' build.mlx_lm.generate; Cotabby Apple Intelligence or llama.cpp engine time. Report model name, macOS version, CPU, memory, warmup count, sample count, and whether models were already loaded.Latest local baseline, measured on macOS 26.5 (25F71), Apple M5 Pro, 48 GB RAM, 15 CPU threads:
| Check | Tabyrus | Cotabby |
|---|---|---|
| App build | brisk build: 3.54s real | xcodebuild ... build CODE_SIGNING_ALLOWED=NO: 9.39s real |
| Focused autocomplete tests | swift test: 6 tests, 0 failures, 0.40s real | xcodebuild ... test -only-testing:SuggestionTextNormalizerTests -only-testing:SuggestionSessionReconcilerTests: 30 tests, 0 failures, 2.04s real |
| Backend tests | cargo test --all-targets --all-features: 9 tests, 0 failures | Not applicable; Cotabby runtime is Swift/C++ through CotabbyInference |
| Local model state | Tabyrus MLX model directories present; mlx_lm.generate missing on PATH | Cotabby test launch reported 0 GGUF models and Foundation model engine available |
The numbers above are build and deterministic suggestion-policy checks. They are not an inference-latency claim because the Tabyrus MLX CLI was not available on PATH during the run.
Practical desktop smoke test: launched .build/debug/Tabyrus.app, typed into TextEdit through macOS UI automation, and pressed Tab. TextEdit received the literal Tab and no ghost overlay appeared while mlx_lm.generate was unavailable on PATH.
Cargo.toml # Rust backend crate manifest
src/
├── lib.rs # Rust MLX backend and C FFI exports
├── App/
│ ├── AppDelegate.swift # Menu bar, status, downloads
│ ├── AutoCompleteApp.swift # NSApplication entry point
│ ├── Coordinators/
│ │ ├── SettingsCoordinator.swift # Settings sync
│ │ └── SuggestionCoordinator.swift # Completion pipeline
│ └── Core/
│ └── TabyrusEnvironment.swift # Dependency container
├── Services/
│ ├── Focus/FocusTracker.swift # Active app tracking
│ ├── Input/InputMonitor.swift # Keyboard event monitoring
│ ├── Runtime/
│ │ ├── ModelManager.swift # Download/status management
│ │ ├── TabyrusBackend.swift # Rust FFI wrapper
│ │ └── TabyrusSuggestionEngine.swift # Suggestion generation
│ ├── ClipboardMonitor.swift # Clipboard content capture
│ ├── ScreenshotMonitor.swift # Screen capture
│ └── PermissionManager.swift # Accessibility/input permissions
├── Support/
│ ├── AIService.swift # AI service abstraction
│ ├── AppCustomizationManager.swift # Per-app learning
│ ├── CodeReshapeService.swift # Code transformation
│ ├── HardwareDetector.swift # System capability detection
│ ├── SuggestionRequestFactory.swift # Prompt construction
│ ├── SuggestionTextNormalizer.swift # Output cleanup
│ └── TabyrusSettings.swift # Settings + models
├── UI/
│ ├── CompletionOverlay.swift # Ghost-text overlay
│ └── GrammarWidget.swift # Grammar suggestion panel
TabyrusBackend/
├── Package.swift # Swift package wrapper for backend bridge
└── Sources/TabyrusBackend/
└── TabyrusBackend.swift # Reusable Rust FFI Swift wrapper
Tests/
└── TabyrusTests/ # Swift policy tests for autocomplete cleanup
Tabyrus requires Accessibility permissions to monitor text input across applications. On first run, it will prompt you to enable this in System Settings.
Optional: Screen Recording permission for screenshot-based context (disabled by default).
The codebase is designed to be modular:
TabyrusSettings.swift and lib.rs (CompletionModel enum)Services/src/UI/MPL-2.0 — See LICENSE
24 commits
Swift
68.4%
Rust
19.5%
C
12.1%