# Local Voice Assistant (Cross-Platform & Offline)

> A battle-tested, zero-leak, cross-platform (Windows, macOS, Linux) voice assistant skill. Features real-time sentence-by-sentence VAD (0.8s pause detection, 0.3s pre-roll), faster-whisper STT, Ollama streaming, and a 100% stateless backend for total privacy.

Local Voice Assistant (Cross-Platform & Offline) is a paid AI agent skill on Agensi by Rustom Yadav, in APIs & Backend. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $29 (one-time purchase)
- Creator: [Rustom Yadav](https://www.agensi.io/creators/rustom-yadav)
- Category: [APIs & Backend](https://www.agensi.io/skills/apis-backend)
- Version: 1.1
- Last updated: 2026-11-18
- Security: scan passed (2026-11-17); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/local-voice-assistant-cross-platform-offline
- Tags: api, python, electron, whisper, ollama, fastapi

## About this skill

### Overview
Building a local, offline desktop voice assistant from scratch involves complex edge cases: browser WebRTC permissions, messy AudioWorklets, clipping first words of speech, zombie process memory leaks on exit, and Whisper hanging on HuggingFace network checks.

This skill equips your AI Agent (Cursor, Claude Code, Codex, Antigravity) with a production-grade blueprint, modular scripts, and deep references to scaffold a 100% offline desktop voice assistant in under 5 minutes.

---

### Key Differentiators & Highlights

#### 1. Real-Time Sentence-by-Sentence VAD (Voice Activity Detection)
- Direct OS-level 16 kHz audio capture via `sounddevice` (never relies on browser mic streaming).
- **0.3s Pre-Roll Ring Buffer:** The opening consonant of speech is never clipped.
- **0.8s Silence Hangover:** Automatically cuts speech on natural pauses, transcribing each sentence progressively.
- Short noises (<0.3s clicks, coughs) are automatically filtered out.

#### 2. Native Cross-Platform Lifecycle (Zero Memory Leaks)
- Engineered specifically for Windows, macOS, and Linux system behaviors:
  - **Windows:** Auto-resolves `.venv\Scripts\python.exe` and terminates child process trees with `taskkill /T /F`.
  - **macOS / Linux:** Resolves `.venv/bin/python` and uses POSIX `SIGTERM`.
  - **macOS Dock:** Handles `activate` events to cleanly re-launch windows without duplicate backend instances.
- **Zero Zombie Processes:** Guaranteed clean shutdown ensures no leftover background `python.exe` processes.

#### 3. 100% Stateless Backend (Ultimate Privacy)
- The backend never saves audio, prompts, or chat history to disk or databases.
- The transcript lives strictly in the frontend editable textarea, giving users complete control to inspect or modify their question before streaming an answer from the local LLM.

#### 4. Instant Offline Startup
- Uses `faster-whisper` (`small.en`, `int8` CPU quantization) with smart `local_files_only` cache loading to avoid 60-second HuggingFace network timeouts.
- Streams progressive tokens directly from local Ollama (`llama3.2:3b`).

---

### What’s Included in the Package:
- **`SKILL.md`**: Standardized instructions, triggers, and scaffolding workflow.
- **`scripts/`**:
  - `audio_recorder.py` (Microphone capture + VAD)
  - `transcriber.py` (faster-whisper int8 wrapper with offline cache check)
  - `llm_streamer.py` (Ollama streaming generator with friendly error handling)
  - `server.py` (FastAPI WebSocket server + session queue)
  - `verify_pipeline.py` (Automated 3-point diagnostic check)
- **`reference/`**:
  - `websocket_protocol.md` (Bidirectional JSON protocol specifications)
  - `electron_setup.md` (Cross-platform Electron shell blueprint)
  - `architecture.md` (Threading, VAD math, and caching design)
  - `troubleshooting.md` (PortAudio, Ollama, and port resolution)

---

### Tech Stack & Compatibility
- **Desktop Shell:** Electron (Node.js ES Modules)
- **Backend:** Python 3.12 (FastAPI + WebSocket) managed via `uv`
- **Speech-to-Text:** `faster-whisper` (`small.en`, `int8` on CPU)
- **Local LLM:** Ollama (`llama3.2:3b`)
- **OS Support:** Windows, macOS, and Linux

## Requires

- Python

## Known limitations

Requires local Ollama installation. Python 3.12+ and Node.js 18+ required. STT performance depends on CPU for int8 quantization.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Local Voice Assistant (Cross-Platform & Offline) skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### What problem does this skill solve compared to standard web-based voice assistants?

This skill provides a production-ready blueprint for a desktop voice assistant that captures audio directly in Python, bypassing browser-based audio limitations to ensure 100% offline privacy and sub-second latency.

### What assets are included in this skill purchase?

You will receive a complete scaffolding including the Electron frontend, the FastAPI backend scripts, and a diagnostic utility to verify your microphone and hardware compatibility.

### Which operating systems and AI models are supported by this implementation?

The skill is designed for cross-platform use on Windows, macOS, and Linux, and it supports any local models currently compatible with an Ollama installation.

### How does the skill handle audio clipping and silence detection?

It uses a specialized 'pre-roll' buffer and Voice Activity Detection (VAD) logic to ensure the start of your speech isn't cut off and the assistant knows exactly when you've finished speaking.

### Does this skill require any paid API keys or cloud subscriptions to function?

No cloud services are required; the skill runs entirely on your local machine using Python 3.12 and Ollama, though you will need a CPU capable of handling 'int8' inference for the speech-to-text engine.

### Does the skill handle background process management automatically?

Yes, the skill includes specialized process-management logic that ensures the Python backend and Whisper engine shut down cleanly whenever the Electron app is closed, preventing 'zombie' processes.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
