Skip to content

Repository files navigation

PromptVoice

A macOS menu bar utility that converts spoken language into optimized AI prompts — in under 2 seconds. Windows support is planned.

Voice → Speech-to-Text → LLM Prompt Optimization → Insert into Active Text Field

Hold the hotkey, speak naturally, release — and a clean, structured prompt appears wherever your cursor is.

The difference from plain dictation:

You say:   "uh can you summarize this article quickly"
You get:   "Summarize the following article concisely."

Features

  • Global push-to-talk — hold Ctrl+Space (configurable) from any app to start recording
  • Live waveform overlay — floating panel shows audio visualization while you speak, without stealing focus
  • Local-first — defaults to whisper.cpp (offline, private) for STT and Ollama for LLM
  • Cloud providers — switch to OpenAI, Deepgram, or Google Cloud STT; OpenAI, Anthropic, Google AI Studio, Mistral, or OpenRouter for LLM optimization
  • Enable Prompt Optimizer toggle — bypass LLM entirely to inject raw transcription directly
  • Auto text injection — result is typed directly into the focused text field (browser, IDE, terminal, etc.)
  • Menu bar only — no dock icon, stays out of the way

Requirements

For local (default) setup

  • Ollama running locally with a model pulled (e.g. ollama pull llama3.2)
  • A whisper.cpp model file placed at:
    ~/Library/Application Support/promptvoice/models/ggml-base.bin
    
    Download from HuggingFace — ggerganov/whisper.cpp
Model Size Use case
ggml-tiny.bin ~75 MB Fastest
ggml-base.bin ~142 MB Default — best balance
ggml-small.bin ~466 MB Better accuracy

For cloud setup

Configure API keys inline in each provider's settings tab:

  • OpenAI — Whisper API (STT) and GPT models (LLM)
  • Anthropic — Claude models (LLM)
  • Google — Google Cloud STT and Google AI Studio / Gemini (LLM)
  • Deepgram — Deepgram STT
  • Mistral — Mistral models (LLM)
  • OpenRouter — any model via OpenRouter (LLM)

API keys are stored in macOS Keychain, not on disk.

Note: Cloud providers are implemented but not yet fully validated end-to-end. The local stack (whisper.cpp + Ollama) is the tested default. Cloud integrations may have rough edges — bug reports and PRs welcome.


Build from Source

Prerequisites

  • Rust (stable)
  • Node.js 20+ and pnpm
  • CMake (for whisper.cpp compilation): brew install cmake
  • Xcode Command Line Tools: xcode-select --install

Dev

git clone <repo-url>
cd promptvoice
pnpm install
PATH="$HOME/.cargo/bin:$PATH" MACOSX_DEPLOYMENT_TARGET=10.15 pnpm tauri dev

Release build

PATH="$HOME/.cargo/bin:$PATH" MACOSX_DEPLOYMENT_TARGET=10.15 pnpm tauri build

Output: src-tauri/target/release/bundle/macos/PromptVoice.app

Note: The first build compiles whisper.cpp from source and takes several minutes. Subsequent builds are fast.


Tech Stack

Layer Technology
Desktop framework Tauri v2 (Rust backend, lightweight)
Frontend React + TypeScript + Tailwind CSS v4 + shadcn/ui
STT — local whisper.cpp via whisper-rs
STT — cloud OpenAI Whisper API, Deepgram, Google Cloud STT
LLM — local Ollama
LLM — cloud OpenAI, Anthropic, Google AI Studio (Gemini), Mistral, OpenRouter
Audio capture cpal
Text injection enigo (simulated typing) + clipboard fallback

Project Structure

src/                        # React frontend
  components/
    Overlay.tsx             # Recording overlay with live waveform
    Settings.tsx            # Settings panel (3 tabs)
  lib/config.ts             # Config types and defaults
  providers/                # TypeScript provider interfaces
  styles/globals.css        # Tailwind + theme

src-tauri/                  # Rust backend
  src/
    audio/                  # Mic capture (cpal) + resampling
    providers/
      stt.rs                # WhisperLocal, OpenAI, Deepgram, Google
      llm.rs                # Ollama, OpenAI, Anthropic, Google AI, Mistral, OpenRouter
    config.rs               # Settings persistence (~/Library/Application Support/promptvoice/)
    injection.rs            # Text injection
    lib.rs                  # App setup: tray, hotkey, pipeline

Settings

Open from the menu bar icon → Settings.

  • General — hotkey, Enable Prompt Optimizer toggle, start on login, overlay opacity
  • Speech-to-Text — provider, model size, language, silence sensitivity
  • Prompt Optimization — provider, model, temperature, editable system prompt (API keys are set inline per provider)

Settings are saved to ~/Library/Application Support/promptvoice/config.json. API keys are stored in macOS Keychain.


How It Works

  1. Hold the hotkey — mic recording starts, overlay appears
  2. Speak naturally
  3. Release — recording stops, audio is transcribed by whisper.cpp (or cloud STT)
  4. If the Prompt Optimizer is enabled, the transcript is sent to an LLM that removes filler words and sharpens intent
  5. The result is typed into whatever text field was focused before the overlay appeared

See SPEC.md for the full technical specification.


Permissions

On macOS, the app requires:

  • Microphone access — for audio capture
  • Accessibility access — for simulated keyboard input (text injection)

Both are requested on first use.


License

MIT

About

A utility tool that converts spoken language into optimized AI prompts

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages