Architecture
vinoWhisper splits audio capture/UI from model inference using an on-demand local server that starts automatically and exits when idle.
On-demand server (scale-to-zero)
Section titled “On-demand server (scale-to-zero)”Nothing runs in the background until a client needs inference:
- Any client (captions, dictation, file transcription, or
vinowhisper-doctor) connects to$XDG_RUNTIME_DIR/vinowhisper/server.sock. - If no server is listening,
vinowhisper/launch.pyspawnsvinowhisper-serverdetached in its own session, acquires a lock file beside the socket so concurrent clients start only one instance, waits for the socket to accept connections, and retries. This is when the NPU model load (~10–30s cold) occurs. - The server tracks the timestamp of its last request and exits automatically after
config.IDLE_TIMEOUT_S(5 minutes).
vinowhisper-caption runs a /health check before entering the caption loop so a cold start displays an explicit “waiting for the transcription server” message rather than appearing hung.
Startup overhead and history
Section titled “Startup overhead and history”Measured 2026-11-14 on a cloud Xeon with a stubbed model:
vinowhisper-servertakes 0.25–0.30s fromexecuntil the socket accepts (Python importing Flask and NumPy).launch.ensureprobes the socket every 2 ms and returns in ~0.25s; once running, client requests take a singleconnect().launch.pyimportssubprocess,fcntl, and related modules inside its functions, adding ~0.2 ms to CLI startup.launch.server_mainhandlesvinowhisper-server --stopbefore importing the server module (~0.1s with a running server vs. 0.35s when importing the full server), keeping language switches responsive in the tray.
Before 2026-11-14, a systemd user socket unit managed the socket and started the server. Client-side activation removed the systemd dependency and made Flatpak packaging possible (Flatpak cannot export systemd units). vinowhisper-setup, upgrades, and vinowhisper-server --stop clean up old systemd units automatically, while the server still accepts sockets passed by an existing unit until removed. Without systemd, Restart=on-failure is replaced by starting a fresh server on the next client request (failures.py still prevents repeated retries on a broken device).
- Device config: Stored in
~/.config/vinowhisper/server.json(written byvinowhisper-setup --device; overridden by--deviceonvinowhisper-server). - Logs: Written to
~/.local/state/vinowhisper/server.logand rotated toserver.log.oldon startup once past 1 MB.
Why a 5-minute idle timeout
Section titled “Why a 5-minute idle timeout”Measured 2026-10-06 on the multilingual server: the resident server uses 1.17–1.24 GB of RAM, of which 1.06 GB is file-backed compiled NPU model blobs mapped from ~/.cache/ze_intel_npu_cache and only 100–170 MB is anonymous memory. Because swap and zram only reclaim anonymous pages (zram stayed empty) and ~500 MB–1.2 GB rarely triggers reclaim pressure on a 16 GB machine, unloading the process deterministically after 5 idle minutes is more reliable than keeping an always-on daemon.
With a warm NPU blob cache, restarting a stopped server answered /health with the model loaded in 0.69s (single measurement on the Wildcat Lake laptop, to /health rather than first decode). The 40–70s cold compile occurs only on the first run or after an OpenVINO or driver update invalidates the cache key.
Stopping the server manually
Section titled “Stopping the server manually”To unload the model immediately without waiting for IDLE_TIMEOUT_S:
vinowhisper-server --stopThis sends POST /quit over the Unix socket and waits for the process to exit (aborting any in-flight decode).
The server itself
Section titled “The server itself”-
Audio endpoint:
/transcribeaccepts raw little-endian float32 PCM (16 kHz mono, under 30s) with no WAV header, matching the client’s rolling buffer. Payloads larger thanMAX_WINDOW_Splus 4 KB are rejected with HTTP 413 before reading. -
Process hardening: On startup, the server sets umask
0077andPR_SET_NO_NEW_PRIVS(matching the former systemd unit’sUMask=0077andNoNewPrivileges=yes). The former unit’s seccomp directives (RestrictAddressFamilies,RestrictNamespaces,LockPersonality) were dropped when the unit was removed on 2026-11-14. Note thatMemoryDenyWriteExecutebreaks OpenVINO’s JIT-compiled CPU plugin, andPrivateDeviceshides/dev/acceland/dev/dri, preventing NPU and GPU detection. -
Concurrency: Pipeline calls are serialized behind a lock because
WhisperPipelineis not documented as thread-safe and the NPU static pipeline holds a single set of compiled requests. The HTTP server is threaded only so/healthresponds during an active decode. -
Early device selection: The target device is selected before model loading so fallback warnings appear in logs and
/healtheven if loading later fails due to a missing export. -
Unix socket transport: The server binds
$XDG_RUNTIME_DIR/vinowhisper/server.sock(0600inside a0700directory), removes stale sockets left by dead servers, and exits with an error ifXDG_RUNTIME_DIRis unset or if another server is already listening. (Until 0.6.x it used127.0.0.1:8099, which lacked per-user access control.)client.pymounts a customrequestsadapter for Unix sockets. You can query the server manually with:Terminal window curl --unix-socket "$XDG_RUNTIME_DIR/vinowhisper/server.sock" http://localhost/health
Why OpenVINO GenAI instead of ONNX Runtime
Section titled “Why OpenVINO GenAI instead of ONNX Runtime”Evaluated 2026-09-28 (when sibling tool ovfetch, built for ONNX Runtime workloads like Gaze, noted ONNX Runtime as an option). Switching would add maintenance without improving performance:
- Complete Whisper loop:
WhisperPipelinehandles mel feature extraction, encoder execution, autoregressive decoding with KV caching, tokenization, token streaming, andmax_new_tokens. ONNX Runtime executes graphs only, requiring vinoWhisper to reimplement the loop. - Static NPU shapes:
STATIC_PIPELINE=Truewith--disable-statefulis Intel’s supported NPU path for Whisper; using ONNX Runtime’s OpenVINO execution provider would reach the same compiler while moving static-pipeline management into this repository. - OpenVINO version floor: Intel’s
onnxruntime-openvinobundled OpenVINO 2025.4.1 as of 2026-09-28, whereas vinoWhisper requires OpenVINO 2026.4.1+. - Identical backend: Both invoke the same OpenVINO NPU plugin and compiler, offering no speed advantage.
ONNX Runtime would only be considered for non-Intel hardware, where whisper.cpp over Vulkan is currently the preferred candidate (see hardware.md).
Measured 2026-09-12 on the Wildcat Lake laptop over 15–30s intervals with no audio playing:
| Component | Overlay visible (silence) | Overlay hidden |
|---|---|---|
| NPU | suspended | suspended |
| Speaker sink | running (held by capture) | suspended |
vinowhisper-tray |
3.7 wakeups/s | 0 |
vinowhisper-caption + pw-record |
2.2 + 51.5 wakeups/s | not running |
vinowhisper-server |
0 | 0 |
- Idle NPU power: Holding a loaded model costs RAM, not NPU power. The kernel suspends the NPU 100 ms after the last inference (
/sys/class/accel/accel0/device/power), and the caption loop skips inference below the silence gate. - Visible overlay cost: An active sink-monitor capture keeps the audio hardware awake even in silence, and
pw-recordwakes at PipeWire’s graph clock (quantum 1024 at 48 kHz, ~47 times/s). Hiding the overlay stops capture and allows the speaker sink to suspend within seconds. - Hidden overlay cost: Nothing wakes except the server’s idle watchdog once every 30s until exit. (Earlier versions woke more frequently due to a 1s GUI counter timer,
serve_forever’s 0.5s shutdown poll, and redrawing on every silence event; all three were fixed after these measurements.)