An entirely offline voice assistant that runs on Raspberry Pi to detect a custom wake-word, transcribe speech, generate responses, and speak them back in a custom TTS voice. DiaOfflineAI focuses on user-friendliness, allowing non-technical users to easily install, customize, and use a powerful voice assistant without cloud dependencies.
- Raspberry Pi 5 (16 GB)
- 64 GB A2 microSD (OS, swap, logs)
- 512 GB NVMe SSD on M.2 HAT+ (large models, RAG store)
- Coral USB Edge TPU + Hailo-8L AI Kit (dual accelerator)
- ReSpeaker 4-Mic Array HAT (far-field voice capture)
- HiFiBerry DAC+ HAT (speaker output)
- Official 27 W USB-C PSU, active-cooler case, GPIO spacers
-
Wake-Word Engine
- Porcupine SDK with custom "Hey Dia" model (.ppn)
-
Offline ASR
- Vosk small-en US model for 16 kHz microphone input
-
Local LLM (optional / future)
- Integration with llama.cpp or similar for on-device chat
-
TTS
- Dia-TTS ("dia-expressive") to synthesize responses as WAV
- Custom voice creator and profile manager
-
Audio I/O
- PyAudio for capture/playback, ALSA config tuned for ReSpeaker & DAC
- Easy Bluetooth headset integration
-
AI Acceleration
- PyCoral / TensorFlow Lite for TPU, plus Hailo SDK integration
- Automatic performance optimization
-
Persistence & RAG
- FAISS+SQLite on NVMe for retrieval of user data or documents
- Simple knowledge pack installation
-
User-Friendly Interfaces
- Visual feedback for speech recognition
- Control Center GUI for easy management
- Personality customization
dia-assistant/
├── config/ # Configuration files for components
│ ├── alsa/ # ALSA configurations for audio hardware
│ ├── systemd/ # Systemd service unit
│ └── dia.yaml # Main configuration
├── docs/ # Documentation
├── logs/ # Log files (symlinked to /var/log/dia)
├── models/ # Model storage directory
│ ├── asr/ # Vosk ASR models
│ ├── llm/ # LLM models
│ ├── tts/ # TTS voice models
│ └── wake/ # Wake word models
├── scripts/ # Utility scripts
│ ├── setup_dia.sh # Main installation script
│ ├── model_download.sh # For downloading models
│ ├── dia-voice.sh # Voice profile manager
│ ├── dia-custom-voice.sh # Custom voice creator
│ ├── dia-knowledge.sh # Knowledge pack manager
│ ├── dia-optimize.sh # Performance optimization
│ ├── dia-personality.sh # Personality customizer
│ ├── dia-bluetooth.sh # Bluetooth device manager
│ ├── dia-visual-test.py # Speech recognition visualizer
│ ├── dia-easy.sh # Easy launcher for all functions
│ ├── dia-control-center.py # Graphical user interface
│ └── install-control-center.sh # GUI installer
├── src/ # Source code
│ ├── asr/ # ASR module
│ ├── llm/ # LLM/response generation
│ ├── rag/ # RAG components
│ ├── tts/ # TTS module
│ ├── wake/ # Wake word detection
│ ├── audio/ # Audio handling
│ ├── utils/ # Utility functions
│ └── dia_assistant.py # Main application entry point
├── Dockerfile # For containerization
├── docker-compose.yml # Docker configuration
└── requirements.txt # Python dependencies
-
Clone this repository:
git clone https://github.com/your-org/DiaOfflineAI.git cd DiaOfflineAI -
Run the easy setup script:
./scripts/easy-setup.sh
The setup script will:
- Create a Python virtual environment
- Install required dependencies
- Download necessary models
- Configure hardware components
- Set up systemd service
- Create desktop shortcuts
- Install the Dia Control Center
Once installed, DiaOfflineAI will automatically start on boot. The easiest way to manage it is through the graphical Control Center:
# Launch the graphical control center
sudo dia-controlAlternatively, you can use command-line tools:
# Launch the easy management menu
dia-easy
# Or use the traditional service commands
sudo systemctl start dia.service
sudo systemctl status dia.service
sudo systemctl stop dia.serviceThe Dia Control Center provides an intuitive graphical interface with:
- Simple start/stop/restart buttons
- Status indicator showing if Dia is running
- Quick access to all tools organized by category
- Clean, modern interface that's easy to navigate
# Voice profile manager
dia-voice
# Custom voice creator
dia-custom-voice
# Personality customizer
dia-personality# Install specialized knowledge packs
dia-knowledge# Set up Bluetooth devices
dia-bluetooth
# Test speech recognition visually
dia-visual
# Optimize performance
dia-optimizePlace your .ppn Porcupine wake word model files in the models/wake/ directory and update the configuration in config/dia.yaml.
-
Download new models to the appropriate directory:
./scripts/model_download.sh --asr large-model ./scripts/model_download.sh --tts new-voice
-
Update the model paths in
config/dia.yaml
- Prepare your documents on a USB drive with a specific format
- Insert the USB drive into the Raspberry Pi
- Run the RAG update script:
./scripts/update_rag.sh --source /media/usb
Use the Control Center to quickly access logs and status information, or check logs at /var/log/dia/ using:
journalctl -u dia.serviceCommon issues:
- Audio device not found: Use
dia-bluetoothto reconfigure audio devices - Wake word not detected: Run
dia-visualto test microphone input visually - High CPU usage: Use
dia-optimizeto tune performance
MIT License