WisprClaw is a macOS menu bar voice assistant client that records speech, transcribes it with a local Whisper gateway, and sends the resulting text to an OpenClaw agent.
Winner of Best Solo Hack at UGAHacks 11
- Runs as a menu bar app on macOS.
- Starts/stops recording via menu action (
Start Recording/Stop Recording) or double-tap⌘global hotkey (toggleable in settings). - Records microphone input to temporary WAV.
- Sends audio to a local Python gateway (
/transcribe). - Gateway transcribes audio with Whisper.
- Gateway can optionally compress transcript with LLMLingua before returning text.
- Sends returned text to OpenClaw over WebSocket Gateway protocol (v3).
- Shows the agent response in both the menu bar item and a floating popup (
ResponsePopupPanel).
AudioRecordercaptures mic audio and writes.wav.TranscriptionClientuploads the file as multipart form-data toPOST {gatewayURL}/transcribe.gateway/whisper_gateway.pyloads.env, runs Whisper STT, optionally applies LLMLingua compression (LLMLINGUA_ENABLED), and returns{"text": "..."}.OpenClawClientconnects to OpenClaw via WebSocket and sends anagentrequest.StatusItemManagerupdates UI state and displays/copies transcript/response.
Sources/WisprClaw/Appapp entry points (WisprClawApp,AppDelegate)Sources/WisprClaw/Servicesrecorder, gateway clients, hotkey, env loader, device identitySources/WisprClaw/Viewssettings and response popup UIgateway/whisper_gateway.pymain Python transcription gateway (Whisper + LLMLingua)gateway/main.pyolder stub gateway (not used in main flow)
- macOS 13+
- Swift 5.9+
- Python 3.10+ (3.12 works)
- OpenClaw gateway running locally (default
http://127.0.0.1:18789) ffmpeginstalled (needed by Whisper)
Python packages for gateway:
pip install fastapi "uvicorn[standard]" python-multipart openai-whisper llmlingua accelerate certifiCreate .env in repo root:
GATEWAY_TOKEN="your_openclaw_gateway_token"
WHISPER_MODEL=base
WHISPER_DOWNLOAD_ROOT=~/.cache/whisper
WHISPER_SSL_CA_FILE=/path/to/ca-bundle.pem
WHISPER_INSECURE_DOWNLOAD=0
LLMLINGUA_ENABLED=0
LLMLINGUA_MODEL=microsoft/llmlingua-2-xlm-roberta-large-meetingbank
LLMLINGUA_DEVICE=auto
LLMLINGUA_RATE=0.6
LLMLINGUA_USE_V2=1
GATEWAY_HOST=127.0.0.1
GATEWAY_PORT=8001
MAX_AUDIO_MB=25From repo root:
python3 gateway/whisper_gateway.pyswift run WisprClawOr open the Swift package in Xcode and run the WisprClaw target.
In Settings...:
General tab:
Transcription Gateway URLdefault:http://localhost:8001Compress with LLMLinguaon/off — compresses the transcript before sending to the agent, reducing input tokens. Requiresllmlinguaandaccelerateinstalled in the gateway Python environment.Double-tap ⌘ to recordon/off
AI Agent tab:
OpenClaw URLdefault:http://127.0.0.1:18789Gateway Tokenoptional in UI; if empty, falls back toGATEWAY_TOKENorOPENCLAW_GATEWAY_TOKENin.env
WisprClaw optionally compresses voice transcripts using LLMLingua before sending them to the OpenClaw agent. This reduces input token count (typically ~40% reduction at the default rate) which lowers cost and can improve agent response latency.
How it works:
- Whisper transcribes audio to text
- If LLMLingua is enabled, the gateway runs the transcript through a compression model (
microsoft/llmlingua-2-xlm-roberta-large-meetingbankby default) - The compressed text is sent to the OpenClaw agent instead of the raw transcript
Enabling/disabling:
- Toggle "Compress with LLMLingua" in Settings → General (takes effect immediately, no gateway restart needed)
- Or set
LLMLINGUA_ENABLED=1in.envfor the server-side default
Configuration (.env):
LLMLINGUA_ENABLED— server default:1(on). The macOS Settings toggle overrides this per-request.LLMLINGUA_MODEL— compression model (default:microsoft/llmlingua-2-xlm-roberta-large-meetingbank)LLMLINGUA_RATE— target compression rate, 0.0–1.0 (default:0.6, meaning ~60% of original tokens retained)LLMLINGUA_DEVICE— compute device:auto(default),mps,cuda, orcpuLLMLINGUA_USE_V2— use LLMLingua-2 API (default:1)
Requirements:
pip install llmlingua accelerateThe gateway auto-detects the best device (MPS on Apple Silicon, CUDA on NVIDIA GPUs, CPU fallback).
- Device identity keys are persisted at
~/.openclaw/wisprclaw-device.json. - The Python gateway prints both the original Whisper transcript and the final transcript returned to Swift (compressed or original, depending on toggle).
- Changing
.envvalues requires restartinggateway/whisper_gateway.py.
certificate verify failedduring Whisper model download: setWHISPER_SSL_CA_FILEto a trusted CA bundle, or setWHISPER_INSECURE_DOWNLOAD=1as a last resort.torch not compiled with cuda enabledon Apple Silicon: useLLMLINGUA_DEVICE=autoorLLMLINGUA_DEVICE=cpu.LLMLINGUA_ENABLED=0but old behavior persists: restart the Python gateway process (env values are read at startup).- OpenClaw connection issues: verify the OpenClaw gateway is running and URL/token are correct in Settings or
.env.