# Build an Offline Voice Assistant in Python

> Build a voice assistant using Python you can talk to and interrupt, running entirely on your own computer, with no cloud AI and no API keys.

Build an Offline Voice Assistant in Python is a free AI agent skill on Agensi by Joy Nandy, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Joy Nandy](https://www.agensi.io/creators/joyn)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Version: 1.0
- Last updated: 2026-11-29
- Security: scan passed (2026-11-29); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/build-an-offline-voice-assistant-in-python
- Tags: ai-agents, llm-ops, productivity, voice, offline, local-llm, ollama, whisper

## About this skill

Offline Voice Pipeline teaches your AI coding agent to build a private voice assistant that runs entirely on your own computer. Speech recognition, the language model and text-to-speech all run locally, with no cloud AI services and no API keys.

THE PIPELINE
Mic -> Silero VAD -> faster-whisper -> Ollama (streamed) -> Kokoro TTS -> speakers

WHAT YOUR AGENT WILL BUILD
- Microphone capture with voice activity detection and pre-roll, so the first word isn't clipped
- Local speech-to-text with faster-whisper
- Streaming replies from a local Ollama model, split into sentences so speech starts before the reply is finished
- Local text-to-speech with Kokoro
- Barge-in: interrupt the assistant mid-sentence by talking, and your interruption becomes the next turn
- A modular Python project: config, audio_in, stt, llm, tts, playback and main

WHAT'S INCLUDED
- Working module templates for every part of the pipeline
- An environment checker script that reads your setup and reports what's missing
- Architecture notes explaining the threading design that avoids deadlocks on interruption
- Tuning guide for your mic, room and hardware (CPU or NVIDIA GPU)
- Troubleshooting guide for latency, echo, clipped words and false interruptions

GOOD FOR
- Developers building private, local-first voice apps
- Anyone making a JARVIS-style desktop assistant
- Adding voice chat to an existing Python project
- Improving latency or barge-in in an existing local voice loop

REQUIREMENTS
Python 3.10-3.12, a microphone and speakers, and Ollama with a pulled chat model (for example qwen3:4b-instruct). Model files (Silero VAD, Kokoro, Whisper) are downloaded once during setup from their original sources, and your agent asks before downloading or installing anything. After setup the only connection is to your local Ollama server. Model files are not included and each has its own license.

## Requires

- Python 3.10-3.12
- Ollama
- Microphone and speakers (or a headset)
- Python
- Optional: NVIDIA GPU (faster speech recognition)

Everything this skill builds runs on your own computer. Once setup is done, the only connection is to your local Ollama server (localhost:11434). No API keys, no accounts and no cloud AI services are involved. The environment check script is read-only: it installs nothing, downloads nothing and…

## Known limitations

Requires manual download of model weights. Silero VAD is strictly locked to 16kHz sample rates and 512-sample chunks. Hardware must support Python 3.10-3.12.

## 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 Build an Offline Voice Assistant in Python skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does this skill differ from simply connecting separate STT and TTS libraries?

This skill provides a complete Python-based orchestration layer that integrates Whisper, Ollama, and Kokoro into a unified pipeline, specifically solving the common 'deadlock' and high-latency issues found in standard DIY voice loops.

### What kind of hardware is required to achieve the sub-second interruption speeds?

The pipeline is optimized for NVIDIA GPUs (CUDA/float16) for the fastest performance, but it includes configurable 'int8' settings to allow for functional operation on CPU-only hardware or devices with limited RAM.

### What exactly is included in the purchase of this skill?

You will receive the production-ready Python source code, a diagnostic environment audit script, hardware-specific configuration templates, and a guided setup workflow to calibrate the pipeline for your room's acoustics.

### Can I use this with different LLMs, or am I locked into a specific model?

Yes, since the pipeline uses Ollama for inference, you can swap between Llama 3, Mistral, or any other locally hosted model by simply updating the configuration file.

### How does the system handle interruptions if the AI is in the middle of a long response?

The skill includes a dedicated 'Barge-in' management module that uses a multi-threaded architecture to immediately kill the audio output thread the moment Silero VAD detects new user speech.

### Does this skill require any active cloud subscriptions or external API keys?

No internet is required; all models (Whisper, Silero, Kokoro, and Ollama) run locally on your machine, ensuring total data privacy and operation in offline environments.

---

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.
