Offline Talking AI Assistant: Whisper + Ollama + Piper
Speak a question, a local model answers out loud — speech-to-text, a small LLM and text-to-speech all on one Pi 5.
Chain three open-source pieces: whisper.cpp turns your voice into text, Ollama runs a small language model, and Piper speaks the answer in English or Spanish.
Video tutorial

Video by Jdaie Lin, embedded from YouTube. The written steps below are our own and match the parts list.
Mission steps
Set up Ollama
Complete the local chatbot guide and pull a small model.
Build whisper.cpp
Clone and compile whisper.cpp and download a tiny or base model for speed.
Install Piper
Download a Piper release for ARM64 and an English or Spanish voice model.
Wire the loop
Record 5 seconds with arecord, transcribe, send the text to Ollama, speak the reply with Piper.
Add a push-to-talk button
A GPIO button starts recording, so the assistant only listens when you ask.
Code
#!/bin/bash
# talk.sh — paths depend on where you built/downloaded each tool
arecord -d 5 -f S16_LE -r 16000 -c 1 /tmp/q.wav
Q=$(./whisper.cpp/build/bin/whisper-cli -m whisper.cpp/models/ggml-base.bin -f /tmp/q.wav -nt -l auto 2>/dev/null)
A=$(ollama run llama3.2:3b "Answer in two short sentences: $Q")
echo "$A" | ./piper/piper --model voices/en_US-lessac-medium.onnx --output_file /tmp/a.wav
aplay /tmp/a.wavTip: test every script on the bench before installing it in a moving machine.
Questions
How long does an answer take?
Usually several seconds on a Pi 5 with small models. Shorter prompts and the tiny Whisper model are fastest.