A lightweight French voice assistant using local AI models: speech-to-text (Whisper), language understanding (Ollama), and text-to-speech (Piper). Responses stream and play sentence-by-sentence.
- π€ Voice input via browser microphone (requires HTTPS)
- π Text-to-speech with Piper (streams sentence by sentence)
- π§ Local LLM via Ollama (llama3.1, gemma3, etc.)
- π― 100% local - no cloud dependencies
- π³ Docker support for easy deployment
All processing happens on a single server. Clients only need a web browser.
βββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββββββ
β Browser β ββββ β Server (e.g. 192.168.1.212) β
β (any device)β β βββββββββββ βββββββββββ βββββββββββββββββ β
β β HTTPSβ β TalkPi ββββ Whisper ββββ Ollama + LLM β β
β β β β (Flask) β β (STT) β β (llama3.1) β β
β β β βββββββββββ βββββββββββ βββββββββββββββββ β
β β β β β
β β β βββββββββββ β
β β β β Piper β β
β β β β (TTS) β β
β β β βββββββββββ β
βββββββββββββββ βββββββββββββββββββββββββββββββββββββββββββββββββ
TalkPi on one machine, Ollama on another.
βββββββββββββββ ββββββββββββββββββββββββ βββββββββββββββββββ
β Browser β ββββ β TalkPi Server β ββββ β Ollama Server β
β β β - Whisper (STT) β β - LLM β
β β β - Piper (TTS) β β β
βββββββββββββββ ββββββββββββββββββββββββ βββββββββββββββββββ
Deploy everything on a powerful server with GPU/good CPU:
git clone https://github.com/val--/talkpi.git
cd talkpicat > env.server << 'EOF'
# Ollama Configuration (adjust URL if Ollama is on another machine)
OLLAMA_URL=http://host.docker.internal:11434/api/chat
OLLAMA_MODEL=llama3.1:latest
# HTTPS Configuration (required for microphone access)
USE_HTTPS=true
PORT=5000
SSL_CERT=/app/certs/cert.pem
SSL_KEY=/app/certs/key.pem
# System Prompt (Persona)
SYSTEM_PROMPT=Tu es Michk.IA, un assistant IA incarnΓ© par un chat blanc aux yeux verts. Tu es intelligent, curieux et un peu mystΓ©rieux. Tu rΓ©ponds de maniΓ¨re concise mais utile. Tu peux Γͺtre espiΓ¨gle parfois, comme un vrai chat. Tu parles franΓ§ais.
# Piper TTS
PIPER_BIN=/opt/piper/piper
PIPER_MODEL=/opt/piper/models/fr_FR-siwis-medium.onnx
PIPER_CONFIG=/opt/piper/models/fr_FR-siwis-medium.onnx.json
# Whisper STT
WHISPER_BIN=/usr/local/bin/whisper-cli
WHISPER_MODEL=/opt/whisper/models/ggml-tiny.bin
WHISPER_LANGUAGE=fr
# Audio
AUDIO_FORMAT=S16_LE
AUDIO_RATE=16000
AUDIO_CHANNELS=1
DEFAULT_RECORD_DURATION=6
EOF# If Ollama is on the same machine
ollama serve &
ollama pull llama3.1:latestSimple option (recommended):
make upOr manually:
docker compose -f docker-compose.server.yml up -d --buildhttps://YOUR_SERVER_IP:5001
The project includes a Makefile to simplify Docker commands:
make help # Show all available commands
make up # Start the server (build + up)
make down # Stop the server
make restart # Restart the server
make logs # Show logs in real-time
make build # Rebuild the Docker image
make status # Show container status
make clean # Stop and remove containersFor local development (port 5001):
make local-up # Start in local mode
make local-down # Stop local mode
make local-logs # Local mode logspip install -r requirements.txtcp env.server .env
# Edit .env with your local pathsollama serve
ollama pull llama3.1:latestpython server.py- HTTP (no mic):
http://localhost:5000 - HTTPS (with mic): Generate certs first with
./generate-certs.sh, setUSE_HTTPS=true
If your Ollama instance runs on a different machine:
# In env.server or .env
OLLAMA_URL=http://192.168.1.212:11434/api/chat
OLLAMA_MODEL=llama3.1:latestMake sure Ollama is configured to accept remote connections:
# On the Ollama server, set this before starting:
OLLAMA_HOST=0.0.0.0 ollama serveOr add to systemd service (/etc/systemd/system/ollama.service):
Environment="OLLAMA_HOST=0.0.0.0"Modern browsers require HTTPS for microphone access (except localhost). TalkPi includes:
- Self-signed certificates generated automatically in Docker
- Manual generation:
./generate-certs.sh
First time accessing the app, you'll see a security warning. This is normal for self-signed certificates:
- Click "Advanced" or "Show Details"
- Click "Proceed to [IP]" or "Accept the Risk"
google-chrome --unsafely-treat-insecure-origin-as-secure="http://192.168.1.212:5001"| Action | Description |
|---|---|
| Type + Enter | Send text message to AI |
| Click "Parler" | Record voice (7 seconds) |
| Click during recording | Stop early |
| "Effacer" | Clear conversation |
| "Historique" | Load server-side history |
| Variable | Description | Default |
|---|---|---|
OLLAMA_URL |
Ollama API endpoint | http://127.0.0.1:11434/api/chat |
OLLAMA_MODEL |
Model to use | gemma3:1b |
USE_HTTPS |
Enable HTTPS | false |
PORT |
Server port | 5000 |
SSL_CERT |
Path to SSL certificate | /app/certs/cert.pem |
SSL_KEY |
Path to SSL private key | /app/certs/key.pem |
SYSTEM_PROMPT |
AI persona/instructions | Michk.IA prompt |
PIPER_BIN |
Piper TTS binary | /opt/piper/piper |
PIPER_MODEL |
Piper voice model | French siwis-medium |
WHISPER_BIN |
Whisper binary | /usr/local/bin/whisper-cli |
WHISPER_MODEL |
Whisper model file | ggml-tiny.bin |
WHISPER_LANGUAGE |
Transcription language | fr |
| File | Purpose |
|---|---|
Makefile |
Simplified commands (use make up instead of docker compose) |
docker-compose.yml |
Basic setup (includes local Ollama) |
docker-compose.server.yml |
Server deployment (external Ollama) |
env.docker |
Config for docker-compose.yml |
env.server |
Config for server deployment |
- Use HTTPS (
https://...) not HTTP - Or launch Chrome with the
--unsafely-treat-insecure-origin-as-secureflag
# Check if port is open (5001 for server deployment, 5000 for local)
sudo ufw allow 5001/tcp
# Check Docker is exposing the port
docker ps# Test Ollama directly
curl http://YOUR_OLLAMA_IP:11434/api/tags
# Make sure Ollama accepts remote connections
OLLAMA_HOST=0.0.0.0 ollama serve- Check browser allows autoplay
- Check console for audio errors (F12 β Console)
# Add user to docker group
sudo usermod -aG docker $USER
# Log out and back in, or:
newgrp docker- Server: Docker, or Python 3.10+ with ffmpeg
- Client: Modern browser (Chrome, Firefox, Edge)
- Ollama: Running instance with a model pulled
MIT
