This file contains essential information for AI coding agents working on the Reachy Mini Chat project.
Reachy Mini Chat is a voice-enabled conversational AI demo for the Reachy Mini desktop robot. It integrates:
- Ollama LLM for conversational AI (local inference)
- Piper-TTS for offline text-to-speech synthesis
- faster-whisper for automatic speech recognition (ASR)
- WebRTC VAD for voice activity detection
- Reachy Mini SDK for robot motion control and animation
The project enables a fully offline conversational robot experience with emotion-driven gestures, synchronized movements, and lip-sync animations.
| Component | Technology |
|---|---|
| Language | Python 3 |
| Robot SDK | reachy-mini (MuJoCo simulation support) |
| LLM Backend | Ollama (local API at http://localhost:11434) |
| TTS Engine | Piper-TTS (offline ONNX models) |
| ASR Engine | faster-whisper (CPU inference) |
| VAD | webrtcvad-wheels |
| Audio I/O | sounddevice + soundfile |
| HTTP Client | aiohttp (async) |
ReachyMiniChat/
├── emo_v1.py → emo_v9.py # Versioned emotion controllers (see below)
├── utils/ # Utility modules
│ ├── asr.py # FasterWhisper ASR engine with VAD
│ ├── test_actions.py # Test robot recorded moves
│ ├── test_edge_tts_voices.py # Edge-TTS voice discovery
│ ├── test_emotion_analysis.py # Emotion analysis testing
│ ├── test_audio.py # Audio playback testing
│ ├── test_ollama_connection.py # Ollama connectivity check
│ ├── latency_harness.py # Performance testing
│ └── simple_interact.py # Manual robot testing
├── models/ # Piper-TTS voice models (.onnx + .json)
├── docs/ # Archived version documentation
├── requirements.txt # Python dependencies
├── README.md # Main project documentation
├── EMO_README.md # Version comparison table
├── EMO_V6_README.md # v6 detailed documentation
├── EMO_V7_README.md # v7 ASR pipeline documentation
├── emo_v9_todo.md # Development todo list (Chinese)
├── install-rocm.md # AMD ROCm installation guide
└── FAQ.md # Frequently asked questions
| Version | Key Feature | Status |
|---|---|---|
| emo_v1.py | Baseline high-intensity emotion controller | Archived |
| emo_v2.py | RecordedMoves integration | Archived |
| emo_v3.py | Streaming-triggered actions | Archived |
| emo_v4.py | Offline TTS (espeak) + lip-sync | Archived |
| emo_v5.py | Edge-TTS integration | Archived |
| emo_v6.py | Continuous synchronized actions + cartoon voices | Stable |
| emo_v7.py | ASR → LLM → TTS pipeline (Edge-TTS) | Stable |
| emo_v7_vad.py | VAD-enhanced ASR variant | Archived |
| emo_v8.py | Piper-TTS offline version | Stable |
| emo_v9.py | Conversation history + performance timing | Development |
Current development focus: emo_v9.py with conversation history, VAD optimization, and performance statistics.
- OS: Ubuntu 24.04 (developed on AMD Ryzen™ AI Max+ 395)
- Python: 3.8+
- Hardware: CPU sufficient; AMD ROCm optional for GPU acceleration
sudo apt update
sudo apt install -y python3 python3-venv python3-pip espeak ffmpeg libsndfile1 portaudio19-devpython3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install "reachy-mini[mujoco]"# Install Ollama
curl -fsSL https://ollama.com/install.sh | sh
# Pull recommended model
ollama pull qwen3:0.6bDownload .onnx and .onnx.json files from:
Place in models/ directory.
# Terminal 1: Start Reachy Mini simulator
reachy-mini-daemon --sim
# Use this if GUI fails on Wayland (Ubuntu 24.04 default)
export PYGLFW_LIBRARY_VARIANT=x11# Text chat mode (emo_v9 - latest)
python emo_v9.py --model qwen3:0.6b --piper-model models/en-us-blizzard_lessac-medium.onnx
# ASR mode with VAD
python emo_v9.py --asr --model qwen3:0.6b --piper-model models/zh_CN-huayan-medium.onnx --gentle
# With conversation history disabled
python emo_v9.py --no-history
# Debug mode with timing statistics
python emo_v9.py --debug --asr| Flag | Description |
|---|---|
--asr |
Enable microphone ASR input |
--model |
Ollama model name (default: qwen3:0.6b) |
--piper-model |
Path to Piper .onnx voice model |
--piper-config |
Path to Piper .json config |
--gentle |
Enable gentle mode (subtle motions) |
--debug |
Enable debug output with timing stats |
--history-size N |
Conversation history rounds (default: 5) |
--no-history |
Disable conversation history |
--asr-model |
ASR model size: tiny/base/small/medium/large |
--vad-silence |
VAD silence threshold in seconds (default: 0.8) |
--vad-aggressive |
VAD aggressiveness 0-3 (default: 1) |
--no-vad |
Use fixed 4s recording instead of VAD |
Offline TTS wrapper around piper-tts library.
- Loads ONNX voice models
- Synthesizes speech to temporary WAV files
- Plays audio via sounddevice
ASR engine with VAD support.
transcribe_from_mic(duration)— Fixed-length recordingtranscribe_from_mic_vad(max_duration, silence_threshold)— VAD-based recording
Base emotion controller with:
- Emotion analysis from text
- Recorded moves library integration
- Lip-sync controller
- Combined action sequences (eye blink + body yaw + head + antennas)
Extended controller replacing Edge-TTS with Piper-TTS.
Manages conversation context for Ollama API.
- Configurable history size
- Automatic message formatting
Main application orchestrating:
- Ollama API communication (async)
- ASR/TTS coordination
- Robot animation control
- Use type hints for function signatures
- Use async/await for I/O-bound operations (HTTP, TTS)
- Use threading for CPU-bound operations (ASR inference)
- Prefix private methods with underscore:
_helper_method() - Use emoji indicators in user-facing output: ✅ ❌
⚠️ 🤖
try:
result = await async_operation()
except asyncio.TimeoutError:
print("⚠️ Operation timed out")
return None
except Exception as e:
if self.debug:
import traceback
traceback.print_exc()
return None- Incremental changes: Make small, testable modifications
- Version files: Create new
emo_v{N}.pyfor major changes - CLI flags: Add argparse arguments for configuration
- Documentation: Update relevant README files
python utils/test_actions.pypython utils/asr.py # Interactive testpython utils/test_ollama_connection.py# Test TTS only
python emo_v6.py --test-tts
# Test robot actions
python emo_v6.py --test-actions
# Test Edge-TTS voices
python utils/test_edge_tts_voices.pySee requirements.txt for full list:
requests>=2.31.0
numpy>=1.24.0
scipy>=1.10.0
edge-tts>=1.2.0
soundfile>=0.12.1
sounddevice>=0.4.8
aiohttp>=3.9.0
faster-whisper>=1.2.1
webrtcvad-wheels>=2.0.14
piper-tts>=1.4.0
- Ensure
libsndfile1andportaudio19-devare installed - Check audio devices:
aplay -l(Linux) - Verify
sounddeviceis installed in venv
- Ensure
reachy-mini-daemon --simis running - Check
PYGLFW_LIBRARY_VARIANT=x11for Wayland issues
- Verify Ollama is running:
curl http://localhost:11434/api/tags - Check model availability:
ollama list
- Increase silence threshold:
--vad-silence 1.5 - Reduce aggressiveness:
--vad-aggressive 1 - Disable VAD:
--no-vad
- Ollama API runs locally on
localhost:11434— no external exposure - Piper-TTS is fully offline — no cloud dependencies for speech
- ASR runs locally on CPU — no audio data leaves the machine
- Edge-TTS (emo_v5-emo_v7) requires internet — cloud-based Microsoft voices
- Project documentation uses English primarily
emo_v9_todo.mdcontains Chinese text (development notes)- Code comments and docstrings use English
- The robot supports multilingual TTS (English, Chinese, etc.)
- Reachy Mini SDK: https://docs.pollen-robotics.com/
- Ollama: https://ollama.com/
- Piper TTS: https://github.com/rhasspy/piper
- faster-whisper: https://github.com/SYSTRAN/faster-whisper