Local-Offline-Voice-Assistant-on-Raspberry-Pi
by Evan Vedh in Circuits > Raspberry Pi
137 Views, 4 Favorites, 0 Comments
Local-Offline-Voice-Assistant-on-Raspberry-Pi
Voice assistants like Alexa and Google Assistant usually depend on cloud services, constant internet access, and powerful servers. In this project, I built a fully offline voice assistant on a Raspberry Pi that can listen for a wake word, understand speech, generate intelligent responses, and speak back — all locally on the device.
This voice assistant uses Vosk for offline speech recognition, Ollama to run a lightweight local language model, and Piper TTS for natural-sounding offline text-to-speech. Once activated by a wake word such as “Hey Assistant”, the system listens for a command, processes it using a local AI model, and responds with spoken output. A beep sound confirms wake word detection, and a thinking sound plays while the assistant processes the request.
To make the project beginner-friendly, all required models, audio files, and code are provided through a single Google Drive download, allowing anyone to set up the assistant easily without searching for individual dependencies. This project is ideal for students, hobbyists, and makers who want to explore offline AI, Raspberry Pi automation, and voice-controlled systems without relying on the cloud. Designed for privacy, low latency, and reliability.
Supplies
Hardware
- Raspberry Pi 4 / 5 (recommended) - https://robu.in/product/raspberry-pi-4-model-b-with-2-gb-ram
- Microphone (USB mic or sound card mic)
- Speaker or headphones
- Internet (only for installing packages & pulling models)
Software
- Raspberry Pi OS (64-bit recommended)
- Python 3.9+
Update Your Raspberry Pi
Open Terminal and run:
Install basic audio tools:
Test audio output:
Press Ctrl + C to stop.
Set Up Microphone
Check if the microphone is detected:
Test recording:
If you hear your voice, the mic works.
Install Python Dependencies
Install system dependencies:
Install Python libraries:
If PyAudio fails:
Download All Required Files (From Google Drive Link)
To make setup easier, all required files are stored in one Google Drive folder.
This folder contains:
- Vosk speech recognition model
- Piper TTS model + config
- Voice assistant Python code
- process.wav (thinking sound)
- beep.wav (wake confirmation sound)
Download from Google Drive
- Open the Google Drive link provided here:
https://drive.google.com/file/d/1HrUWTQNB1PZXy0Y_czlAySrls6E05IO-/view?usp=sharing
- Click Download all
- A ZIP file will be downloaded
Extract Files on Raspberry Pi
Move the ZIP file to /home/pi and extract:
After extraction, your directory structure must look like this:
⚠️ Important: Do not rename folders or files.
Verify File Paths in Code
Open the Python file:
Confirm these paths match exactly:
Save and exit.
Install Ollama (LLM Engine)
Install Ollama:
Start Ollama:
Pull a lightweight model (recommended for Pi):
Test it:
Run the Voice Assistant
Start Ollama (if not running):
In another terminal:
You should see:
How to Use It
- Say "Hey Assistant"
- Hear a beep
- Ask your question
- Assistant thinks (sound plays)
- Assistant speaks the answer
Examples:
- "Hello assistant, tell me a joke"
- "Okay assistant explain Arduino"
Exit the Assistant
Say:
Or press Ctrl + C.
Tips for Better Performance
- Use a USB microphone for accuracy
- Reduce background noise
- Use small LLM models (≤1B parameters)
- Raspberry Pi 4 (4GB+) works best
Final Result
You now have a fully offline voice assistant with:
- Wake word detection
- Offline speech recognition
- Local LLM responses
- Natural-sounding TTS
Perfect for Jarvis-style assistants, smart projects, and AI demos 🚀
🎉 Congratulations! Your Raspberry Pi Voice Assistant is Live!