Playground/linux-voice-assistant/README.md
A complete on-device voice AI pipeline for Linux (Raspberry Pi 5, x86_64, ARM64). All inference runs locally — no cloud, no API keys.
Pipeline: VAD -> STT -> LLM -> TTS
Microphone (ALSA)
│
▼
Voice Activity Detection (Silero VAD)
│ Buffers speech, detects silence timeout
▼
Speech-to-Text (Whisper Tiny EN)
│
▼
Large Language Model (Qwen3 1.7B Q8)
│
▼
Text-to-Speech (Piper Lessac Medium)
│
▼
Speaker (ALSA)
linux-voice-assistant/
├── src/
│ ├── main.cpp # Entry point, CLI parsing, main loop
│ ├── audio/
│ │ ├── audio_capture.h/cpp # ALSA mic input (16kHz, 16-bit PCM, mono)
│ │ └── audio_playback.h/cpp # ALSA speaker output (multi-rate)
│ ├── pipeline/
│ │ └── voice_pipeline.h/cpp # Full pipeline: VAD -> STT -> LLM -> TTS
│ └── config/
│ └── model_config.h # Model paths, IDs, availability checks
├── tests/
│ └── test_pipeline.cpp # Feed WAV file through pipeline (no mic needed)
├── scripts/
│ └── download-models.sh # Download all required models
├── CMakeLists.txt # Build configuration
├── build.sh # End-to-end build script
└── README.md
sudo apt install libasound2-dev# 1. Build everything (SDK + models + assistant)
./build.sh
# 2. Run the voice assistant
./build/voice-assistant
# Step 1: Download Sherpa-ONNX
cd ../../sdk/runanywhere-commons
./scripts/linux/download-sherpa-onnx.sh
# Step 2: Build runanywhere-commons
./scripts/build-linux.sh
# Step 3: Download models
cd ../../Playground/linux-voice-assistant
./scripts/download-models.sh
# Step 4: Build
mkdir -p build && cd build
cmake ..
cmake --build . -j$(nproc)
# Step 5: Run
./voice-assistant
| Component | Model | Size | Framework |
|---|---|---|---|
| VAD | Silero VAD | ~2 MB | Sherpa-ONNX |
| STT | Whisper Tiny EN | ~150 MB | Sherpa-ONNX |
| LLM | Qwen3 1.7B Q8 | ~1.83 GB | llama.cpp |
| TTS | Piper Lessac Medium | ~65 MB | Sherpa-ONNX |
Download models:
# Required models (VAD, STT, LLM, TTS)
./scripts/download-models.sh
# Download an additional LLM bundle:
./scripts/download-models.sh --llm llama-3.2-3b
./scripts/download-models.sh --llm qwen3-4b
# Basic usage
./build/voice-assistant
# Select audio devices
./build/voice-assistant --list-devices
./build/voice-assistant --input hw:1,0 --output hw:0,0
# Test pipeline with a WAV file (no microphone needed)
./build/test-pipeline path/to/audio.wav
src/audio/audio_capture)src/audio/audio_playback)src/pipeline/voice_pipeline)rac_stt_component_transcriberac_llm_component_generaterac_tts_component_synthesizesrc/config/model_config)~/.local/share/runanywhere/Models/"ALSA: Cannot open audio device"
aplay -l (output) and arecord -l (input)--input hw:1,0"Models are missing"
./scripts/download-models.sh to download all required modelsNo audio output
alsamixerspeaker-test -D default -c 2Slow LLM response on Raspberry Pi
./scripts/download-models.sh --model qwen3-0.6b