voice-assistant

workflowv1.0.0

Fully offline voice assistant: wake phrase, STT, LLM response, TTS - no cloud

Install

kdeps registry install voice-assistant

Then run locally:

kdeps exec voice-assistant

Configure LLM provider in ~/.kdeps/config.yaml (created automatically on first run).

README

Voice Assistant Example

A fully offline voice assistant that listens for a wake phrase, transcribes speech, generates an LLM response, and speaks the answer aloud — no cloud required.

Features

  • ✅ Wake phrase detection ("hey kdeps") using whisper offline
  • ✅ Continuous audio capture from a microphone
  • ✅ Offline speech-to-text transcription
  • ✅ LLM response generation with Ollama (llama3.2:1b)
  • ✅ Offline text-to-speech output using Piper TTS
  • ✅ Fully air-gapped — no internet connection needed

Prerequisites

Install required tools:

# Piper TTS (for speech output)
pip install piper-tts

# whisper (for wake detection + transcription)
pip install whisper

# Ollama (for LLM)
curl -fsSL https://ollama.ai/install.sh | sh
ollama pull llama3.2:1b

Configure Your Microphone

Find your audio device:

# Linux
arecord -l

# macOS / Windows
ffmpeg -list_devices true -f avfoundation -i dummy   # macOS
ffmpeg -list_devices true -f dshow -i dummy          # Windows

Update workflow.yaml with your device identifier:

audio:
  device: hw:0,0          # Linux example
  # device: "Built-in Microphone"   # macOS
  # device: "Microphone (Realtek Audio)"  # Windows

Run

# From examples/voice-assistant directory
kdeps run workflow.yaml

# Or from project root
kdeps run examples/voice-assistant/workflow.yaml

Once running, say "hey kdeps" followed by your question. The assistant will:

  1. Detect the wake phrase
  2. Capture and transcribe your speech
  3. Generate an LLM response
  4. Speak the response aloud

Structure

voice-assistant/
├── workflow.yaml              # Input sources, activation, and transcription config
├── components/
│   └── tts/
│       └── component.yaml     # .komponent: offline TTS via espeak
└── resources/
    └── respond.yaml           # LLM chat resource (takes transcribed speech as input)

The tts component encapsulates the run.tts executor and is auto-loaded from the components/ directory. Swap the TTS engine by replacing the component without touching the workflow:

# Build a packaged version to share or version-control
kdeps package components/tts --output components/

# Or install a community component
kdeps component install tts

How It Works

Pipeline

Microphone → Wake Phrase Detection → Audio Capture → Transcription → LLM → TTS → Speaker

Activation Loop

The runtime captures chunkSeconds (3s) of audio in a continuous loop. Each chunk is transcribed with whisper tiny and checked against the wake phrase "hey kdeps" with 90% similarity threshold. When detected, the full workflow runs.

Key Expressions

ExpressionDescription
inputTranscriptThe transcribed speech text
get('respond')The LLM response text
ttsOutputPath to the generated audio file

Customization

Use a Different LLM

# workflow.yaml
agentSettings:
  models:
    - mistral:7b             # or any Ollama model

# resources/respond.yaml
chat:
  model: mistral:7b

Change the Wake Phrase

activation:
  phrase: "okay computer"
  sensitivity: 0.85          # Lower = more flexible matching

Use eSpeak Instead of Piper (Lighter Weight)

Edit components/tts/component.yaml:

tts:
  mode: offline
  offline:
    engine: espeak
    voice: en

Raspberry Pi / Edge Device Optimizations

For resource-constrained hardware, use the smallest models:

activation:
  offline:
    engine: whisper
    model: tiny              # Smallest, fastest

transcriber:
  offline:
    engine: whisper
    model: tiny              # Use tiny on Pi Zero / limited RAM

# resources/respond.yaml
chat:
  model: llama3.2:1b         # Smallest Llama model

# components/tts/component.yaml
tts:
  offline:
    engine: espeak           # Lightest TTS engine

See Also

Versions

VersionPublishedStatus
1.0.04/11/2026active

Details

Author
kdeps
License
Apache-2.0
Latest Version
1.0.0
Published
4/11/2026

Tags

voicestttts