惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

人人都是产品经理
人人都是产品经理
Apple Machine Learning Research
Apple Machine Learning Research
云风的 BLOG
云风的 BLOG
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
量子位
GbyAI
GbyAI
腾讯CDC
T
Tailwind CSS Blog
博客园 - Franky
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
D
Docker
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
The GitHub Blog
The GitHub Blog
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
Jina AI
Jina AI
IT之家
IT之家
Y
Y Combinator Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built GhostType: inline AI text completion for every ap...
mk668a · 2026-05-15 · via DEV Community

Writing the same kind of sentences over and over — meeting replies, status updates, polite refusals — eats a surprising amount of the day. LLMs can finish those sentences for me, but only if I copy-paste into a chat window. By the time I've done that, I could have just typed the thing.

I wanted the LLM to be right where I'm already typing — in Gmail, in Notes, in the X compose box — and I wanted it to run on my own machine. So I built GhostType.

GhostType in Gmail

What it is

GhostType is a menu bar app for macOS 14+ that watches the text field you're typing in, sends the surrounding context to a local LLM server (LM Studio, Ollama, llama.cpp, vLLM — anything OpenAI-compatible), and shows the completion as translucent ghost text right at the cursor. Tab to accept, Esc to dismiss.

You type:  "The meeting covered "
           (pause)
GhostType: "The meeting covered quarterly sales targets and the product roadmap"
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                 Ghost text — press Tab to accept

Enter fullscreen mode Exit fullscreen mode

It works in Safari, Notes, Pages, Mail, and most native macOS apps via the Accessibility API. For apps where AX doesn't expose text (Slack, Discord, some Electron apps), there's a manual trigger (Option + \) that uses an internal keystroke buffer.

Why local-only

Three reasons I didn't want this to be a cloud product:

  1. Privacy. Every email draft, every DM, every half-written idea would otherwise hit someone else's server.
  2. Latency. A round trip to the cloud is fine for chat, not great for completion-as-you-type.
  3. Cost. Local inference on Apple Silicon is free. I run a 3B model on an M2 and it's snappy.

Recommended models that work well at this size:

Model Size Notes
Qwen2.5-Coder-3B ~2 GB Best all-rounder
DeepSeek-Coder-V2-Lite ~2 GB FIM-tuned, high quality
CodeGemma-2B ~1.5 GB Lowest latency

How it works under the hood

  • NSEvent.addGlobalMonitorForEvents — watches keystrokes system-wide (requires Input Monitoring permission)
  • Accessibility API (AXUIElement) — reads the surrounding text from the focused field and writes back the accepted completion (requires Accessibility permission)
  • Overlay NSWindow — a borderless, click-through window draws the ghost text at the caret position
  • OpenAI-compatible client — talks to whatever local server you're running on 127.0.0.1

The whole thing is Swift, about 6 source files of core logic. No background daemons, no kernel extensions.

GhostType on X

Try it

  1. Install LM Studio or Ollama and pull a model
  2. Download GhostType-0.1.0.dmg from the releases page
  3. Grant Input Monitoring + Accessibility permissions
  4. Start typing in any text field

Requirements: macOS 14+, Apple Silicon recommended, 8 GB RAM minimum.

What's next

This is v0.1.0. Stuff I'd like to tackle next:

  • Better context extraction for web inputs (currently falls back to keystroke buffer)
  • Per-app prompt presets (email tone vs. code comments vs. casual chat)
  • Multi-suggestion popup (cycle through alternatives)

Source is on GitHub under PolyForm Noncommercial: github.com/mk668a/GhostType

Happy to hear feedback, especially from people running it with non-default models or unusual local server setups. What would you want it to do that it doesn't?