Before you start
This build runs Home Assistant, Ollama (Gemma 4 E2B), Whisper and Piper on one Pi 5 8GB. Expect a working typed assistant first, then voice once your speakerphone arrives.
Hardware: Pi 5 8GB, NVMe + HAT, official 27W supply, active cooler, a USB speakerphone (for the voice demo), and a light or smart plug to control.
Power warning: Use the official 27W Pi supply. On my 8GB build the voltage sagged to 4.59V under full inference load. Do not add the GeeekPi AI HAT+ (Hailo, 13 TOPS) to this build: its power draw crashed the Pi under load, and this stack does not use it. The GeeekPi P33 NVMe HAT with its PoE+ board also crashed the Pi during my testing, so I ran most tests from an SD card. The Pi now boots from the NVMe with throttled=0x0. If the Pi crashes during a reply, run vcgencmd get_throttled: 0x50005 means under-voltage happened.
What to expect: Google’s benchmark for E2B on a Pi 5 (16GB) shows about 8 tokens/sec and about 8 seconds to the first token. E4B is about 3 tokens/sec, too slow here. Your own numbers will differ, so measure them in Step 8.
My numbers (Pi 5 8GB): about 8 tokens/sec to generate, about 44 tokens/sec to process the prompt, and 15 to 17 seconds to load the model the first time. A spoken question gets an answer in about 10 seconds once the model is loaded and chat history is capped at 2 messages (Step 6).
Rough RAM budget (estimates, verify with free -h):
| Piece | Approx. RAM |
|---|---|
| Gemma 4 E2B via Ollama | 2-3 GB |
| Whisper (small-int8) | ~1 GB |
| Piper | a few hundred MB |
| Home Assistant (Docker) | ~1 GB |
| OS and overhead | ~1 GB |
Step 1: Flash Pi OS Lite to the NVMe and boot
- In Raspberry Pi Imager, choose Raspberry Pi OS Lite (64-bit) and write it to the NVMe (use a USB-to-NVMe adapter, or boot from an SD card and write to the NVMe from there).
- In the Imager’s settings, set a hostname, a username and password, enable SSH, and add your Wi-Fi if you are not using Ethernet.
- Install the NVMe in the HAT and mount the HAT on the Pi. Make sure the ribbon cable is fully seated at both ends.
- If it won’t boot from NVMe, remove any SD card, power on, and wait a couple of minutes. On recent Pi 5 firmware the Pi tries the SD card first and then the NVMe, so with no SD card it should boot from the NVMe. SSH in. If it does not boot from the NVMe, the boot order needs changing from a different boot: put Raspberry Pi OS on a spare SD card (or use Imager’s Misc utility images, Bootloader for Pi 5, NVMe/USB Boot), boot from it, run sudo raspi-config, go to Advanced Options, then Boot Order, and pick NVMe/USB boot. Shut down, remove the SD card, and boot again. If the Pi still does not see the drive, reseat the ribbon cable and check the HAT supports your SSD size.
- Update everything:
sudo apt update && sudo apt full-upgrade -y
sudo rpi-eeprom-update -a
sudo reboot
Step 2: Install Docker
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER
Log out and back in so the group change applies, then confirm it works:
docker run --rm hello-world
docker compose version
Step 3: Create the stack from the compose file
- Make a folder and put the docker-compose.yml in it:
mkdir ~/voice-stack && cd ~/voice-stack
nano docker-compose.yml # paste the file below, save with Ctrl+O, exit with Ctrl+X
services:
homeassistant:
image: ghcr.io/home-assistant/home-assistant:stable
container_name: homeassistant
network_mode: host # lets HA find devices on your network; web UI on port 8123
privileged: true
restart: unless-stopped
volumes:
- ./ha-config:/config
- /etc/localtime:/etc/localtime:ro
ollama:
image: ollama/ollama:latest
container_name: ollama
restart: unless-stopped
ports:
- "11434:11434"
environment:
- OLLAMA_KEEP_ALIVE=-1 # keep the model loaded so voice replies are not delayed by reloads
- OLLAMA_MAX_LOADED_MODELS=1 # protect memory on the 8GB board
- OLLAMA_NUM_PARALLEL=1
volumes:
- ./ollama:/root/.ollama
whisper:
image: rhasspy/wyoming-whisper:latest
container_name: whisper
restart: unless-stopped
ports:
- "10300:10300"
command: --model small-int8 --language en # other sizes: tiny-int8, base-int8
volumes:
- ./whisper:/data
piper:
image: rhasspy/wyoming-piper:latest
container_name: piper
restart: unless-stopped
ports:
- "10200:10200"
command: --voice en_US-lessac-medium
volumes:
- ./piper:/data
# After starting:
# 1. Pull the model: docker exec -it ollama ollama pull gemma4:e2b
# Check it: docker exec ollama ollama list
# 2. Home Assistant: http://<pi-ip>:8123
# 3. Settings > Devices & services > Add integration. Use the Pi's IP address, not localhost:
# - Ollama -> http://<pi-ip>:11434, then "Add conversation agent"
# - Wyoming Protocol -> <pi-ip> port 10300 (Whisper)
# - On the Wyoming card, "Add service" -> <pi-ip> port 10200 (Piper)
# 4. Ollama conversation agent options:
# Keep alive -1, Context window 8192, Max history messages 2, Thinking off,
# Device control checked, Home Assistant unchecked (it returns "Unauthorized")
# 5. Settings > Voice assistants: Whisper (speech-to-text), Ollama (conversation), Piper (text-to-speech)
# 6. After any change to the Ollama agent, restart the native services:
# sudo systemctl restart wyoming-openwakeword
# sudo systemctl restart wyoming-satellite
# 7. Watch memory while testing: free -h
- Start everything. The first run downloads the images, which takes a few minutes:
docker compose up -d
docker compose ps
- All four containers (homeassistant, ollama, whisper, piper) should show as running. Whisper and Piper download their voice models on first start, so watch them settle:
docker compose logs -f whisper piper
Press Ctrl+C to leave the logs. The containers keep running.
Step 4: Pull Gemma 4 E2B and test it
- The model’s name in Ollama is gemma4:e2b. The e2b part is the small version that fits on a Pi. Do not use e4b; it is too slow on a Pi.
- Pull it, then confirm what you have:
docker exec -it ollama ollama pull gemma4:e2b
docker exec ollama ollama list
- Run a test with timing stats. The –verbose flag prints tokens per second:
docker exec -it ollama ollama run gemma4:e2b --verbose "Say hello in one short sentence."
- While the model is loaded, check memory and write the numbers down for the video:
free -h
docker stats --no-stream
If RAM is nearly full at this point, stop and fix it (see Troubleshooting) before adding Home Assistant on top.
Step 5: Home Assistant onboarding and a test light
- On another computer, open http://<pi-ip>:8123 and create your account. Set your location and skip the optional analytics.
- You need something to control. A real smart plug or bulb is best for the video. For testing before it arrives, Home Assistant’s built-in Demo integration creates fake lights. Add this line to ~/voice-stack/ha-config/configuration.yaml, then restart:
demo:
cd ~/voice-stack && docker compose restart homeassistant
- Tell the assistant which devices it may touch. Go to Settings, Voice assistants, Expose and expose only the lights you want to control. Anything not exposed is invisible to the voice assistant, which is also a good safety setting to mention on camera.
Step 6: Connect Ollama, Whisper and Piper to Home Assistant
Home Assistant runs on the host network and the other containers publish their ports on the Pi, so every service is reachable at the Pi’s IP address. Use that IP for every host below (find it with hostname -I; the examples use <pi-ip>). Go to Settings, Devices & Services, Add Integration and add three entries:
| Integration | Settings |
|---|---|
| Ollama | URL http://<pi-ip>:11434, then add a conversation agent (see below) |
| Wyoming Protocol (Whisper) | Host <pi-ip>, port 10300 |
| Wyoming Protocol (Piper) | Host <pi-ip>, port 10200 |
Add the Wyoming services by hand. Auto-discovery did not find them on my build. On the Wyoming Protocol card, click Add service once for Whisper and once for Piper. A Wyoming Protocol card in the Configured list does not mean Whisper and Piper are added: the voice assistant dropdowns in Step 7 only list services you have added, so if faster-whisper or piper is missing there, this step was skipped.
If the setup screen says “Installation of apps is not supported on your system,” that is expected. Automatic Whisper and Piper installation only works on Home Assistant OS, and yours already run in Docker. Close the screen and add them by hand.
Set Home Assistant’s own address by hand. Go to Settings, System, Network, Local network, turn off Automatic, and enter http://<pi-ip>:8123. I had to set this manually on my build.
In the Ollama integration, click Add conversation agent and set: model gemma4:e2b, keep alive -1, context window 8192 (at 4096 Gemma described turning the light on but never did it; on my 8GB Pi about 1.5 GB of memory stayed available, so check free -h), max history messages 2 (at 20 messages the prompt took about 37 seconds to process and voice requests timed out), and thinking off. Check Device control and leave Home Assistant unchecked (see Step 8). A smaller context window uses less RAM, and a long keep-alive stops the model unloading between requests. Exact option names can change between Home Assistant releases, so go by what you see on screen.
Step 7: Build the voice assistant pipeline
- Go to Settings, Voice assistants, Add assistant.
- Name it, set the language to English, and choose: conversation agent = Ollama Conversation (the agent you added in Step 6), speech-to-text = faster-whisper, text-to-speech = piper with the voice en_US-lessac-medium. Leave the wake word off; the satellite handles it.
- On the conversation agent, turn on Prefer handling commands locally if you see it. Home Assistant then answers simple commands like “turn on the kitchen light” with its own built-in matching, instantly, and only sends the rest to Gemma.
- Test by typing first. Click the Assist icon in the top right of Home Assistant and type a request. Typing removes Whisper and the microphone from the equation, so you can judge Gemma on its own.
- Microphone caveat: browsers block microphone access on plain http:// pages that are not localhost. To talk to it from a browser you need HTTPS. The real voice demo will use the USB speakerphone through a Wyoming satellite instead. Before your first voice test, load the model so the first reply does not time out (loading takes 15 to 17 seconds on the Pi): docker exec ollama sh -c ‘ollama run gemma4:e2b “hi” > /dev/null; ollama ps’
Step 7b: Voice satellite for the EMEET M0 Plus. This adds a wake word service and a Wyoming satellite so the speakerphone listens for “OK Nabu” and speaks the replies. I ran it on a Pi 5 with the fixes below, and it works.
(1) Plug the M0 Plus into the Pi with its USB cable (not Bluetooth). Run arecord -L | grep plughw and find the line for the speakerphone. It looks like plughw:CARD=<name>,DEV=0, and the part after CARD= is your card name. On my M0 Plus the card name is Plus.
(2) Do not use the compose file for this part. The wake word and satellite are installed natively, using the commands in the Correction section below. YOURCARD appears only in the satellite command there, so replace it with your card name.
(3) Install and test the wake word and satellite using those commands.
(4) Add the satellite by hand. Auto-discovery failed every time for me. In Home Assistant, go to Settings, Devices & Services, and on the Wyoming Protocol card click Add service. Enter the Pi’s IP address (<pi-ip>) and port 10700. Then open the pi-speakerphone device and set its assistant to the one you built in Step 7.
(5) Test by saying “OK Nabu, turn on the kitchen light.” Use the exact name of a device you exposed (see Step 8).
What I verified on the M0 Plus: the wake word model is named okay_nabu (with “okay” spelled out, not ok_nabu). The default wake word threshold of 0.5 was too insensitive, so I run it with –threshold 0.3. The 16000 Hz microphone and 22050 Hz speaker settings below work.
CORRECTION: there is no official Docker image for the Wyoming satellite, so do not add satellite or openwakeword services to the compose file. The official install is native on the Pi. Run the commands in the code block below from your home directory, in order. Test in two SSH windows: Window 1 runs the wake word service. Wait for the line INFO:root:Ready before starting the satellite in Window 2. The model is named okay_nabu, and the satellite must use the same name. Window 2 runs the satellite, with YOURCARD replaced by the card name from arecord -l. Once both work, make them start at boot with the two systemd service files at the end of the code block. The ExecStart, ExecStartPre and Requires lines are from my working setup; the other lines follow the layout in the official Wyoming satellite tutorial. Replace hrw3 with your username and Plus with your card name. Enable both at the end with the systemctl commands shown.
# Install
sudo apt-get update
sudo apt-get install --no-install-recommends git python3-venv libopenblas-dev alsa-utils
git clone https://github.com/rhasspy/wyoming-openwakeword.git
cd wyoming-openwakeword && script/setup && cd ~
git clone https://github.com/rhasspy/wyoming-satellite.git
cd wyoming-satellite && script/setup && cd ~
# Window 1 (wake word)
cd ~/wyoming-openwakeword
script/run --uri 'tcp://127.0.0.1:10400' --preload-model 'okay_nabu' --threshold 0.3 --debug
# Window 2 (satellite)
cd ~/wyoming-satellite
script/run --name 'pi-speakerphone' --uri 'tcp://0.0.0.0:10700' --mic-command 'arecord -D plughw:CARD=YOURCARD,DEV=0 -r 16000 -c 1 -f S16_LE -t raw' --snd-command 'aplay -D plughw:CARD=YOURCARD,DEV=0 -r 22050 -c 1 -f S16_LE -t raw' --wake-uri 'tcp://127.0.0.1:10400' --wake-word-name 'okay_nabu' --debug
# /etc/systemd/system/wyoming-openwakeword.service
[Unit]
Description=Wyoming openWakeWord
[Service]
Type=simple
ExecStart=/home/hrw3/wyoming-openwakeword/script/run --uri 'tcp://127.0.0.1:10400' --preload-model 'okay_nabu' --threshold 0.3
WorkingDirectory=/home/hrw3/wyoming-openwakeword
Restart=always
RestartSec=1
[Install]
WantedBy=default.target
# /etc/systemd/system/wyoming-satellite.service
[Unit]
Description=Wyoming Satellite
Wants=network-online.target
After=network-online.target
Requires=wyoming-openwakeword.service
[Service]
Type=simple
ExecStartPre=/bin/sleep 5
ExecStart=/home/hrw3/wyoming-satellite/script/run --name 'pi-speakerphone' --uri 'tcp://0.0.0.0:10700' --mic-command 'arecord -D plughw:CARD=Plus,DEV=0 -r 16000 -c 1 -f S16_LE -t raw' --snd-command 'aplay -D plughw:CARD=Plus,DEV=0 -r 22050 -c 1 -f S16_LE -t raw' --wake-uri 'tcp://127.0.0.1:10400' --wake-word-name 'okay_nabu'
WorkingDirectory=/home/hrw3/wyoming-satellite
Restart=always
RestartSec=1
[Install]
WantedBy=default.target
# Enable both at boot
sudo systemctl daemon-reload
sudo systemctl enable --now wyoming-openwakeword.service wyoming-satellite.service
Step 8: The make-or-break test, device control
The conversation agent’s settings have Home Assistant and Device control checkboxes (Settings, Devices & Services, Ollama, then the conversation agent, Reconfigure). They appear to control whether Gemma can use Home Assistant’s device tools. On Home Assistant 2026.11.0, with both checked, a voice request came back with an error about preparing the Ollama API. With both unchecked, Gemma answered questions normally. The Home Assistant log shows “Error getting LLM API [‘homeassistant’] for ollama: Unauthorized”, so leave Home Assistant unchecked. With only Device control checked there was no error. After changing these settings the satellite stopped responding to the wake word until I restarted both services (sudo systemctl restart wyoming-openwakeword wyoming-satellite), so restart them after every change. Run these tests in the Assist box and record the results:
| Test | What to type | What it proves |
|---|---|---|
| Simple command | “Turn on the kitchen light” | Local matching is instant, with no LLM needed |
| Fuzzy command | “It’s too dark in here” | Whether Gemma can pick the right tool and device |
| Multi-device | “Turn off all the lights” | Whether it handles several entities |
| Question | “Why is the sky blue?” | Plain chat speed and quality |
| Ambiguous | “Make it brighter” | How it fails, which is good footage |
For each test, write down the seconds until the reply, and whether the light actually changed. While the model is working, check heat and throttling:
vcgencmd measure_temp
vcgencmd get_throttled
A throttled value of 0x0 means no throttling or undervoltage has occurred.
If device control fails: E2B may not call tools reliably. If so, the honest result is a hybrid: Home Assistant’s local matching runs the house, and Gemma answers questions. That is still a legitimate video. On my build, the fix was a larger context window (see below).
What I found on my build: a command that matches the name of an exposed device runs locally, with no Gemma involved. “Okay Nabu, turn off Studio lights” worked because Studio lights is an exposed entity. “Turn off a plug” matched no entity name, so it went to Gemma, which said it is a voice assistant and cannot do that. To make looser phrasing work, rename the entity or add an alias to it under Settings, Voice assistants, Expose.
Gemma result on my build: with Device control on, Gemma understood “it’s too dark in the studio” and replied that it was attempting to turn on the studio lights, but the lights did not change when the context window was 4096, even with only Studio lights exposed. After I raised the context window to 8192, the light turned on. Direct commands such as “turn off Studio lights” worked because local matching handled them. The context window was the fix. A direct tool-call test against Ollama, with no Home Assistant, worked on the first try, so the model and Ollama can do this. Home Assistant sends a much larger request (its base prompt, the exposed devices and its tool definitions), and 4096 tokens was not enough room. I tested with only Studio lights exposed. I have not tested how many devices fit at 8192, so add them back a few at a time and watch free -h.
More fixes from testing: if Gemma says it is turning a device on and nothing happens, set the context window to 8192 and expose only the devices you need. if faster-whisper or piper is missing from the assistant dropdowns, add them with Add service on the Wyoming Protocol card. If Ollama is missing from the conversation agent dropdown, use Add conversation agent on the Ollama integration. If the wake word does nothing, restart both services with sudo systemctl restart wyoming-openwakeword wyoming-satellite, and check that the model name is okay_nabu and the threshold is 0.3. If Piper fails to load its voice, delete the voice file in ~/voice-stack/piper/ (it needs sudo rm), restart Piper, and use en_US-lessac-medium; en_US-amy-low downloaded corrupted for me. If a voice reply is a short tone instead of speech, that is unresolved on Home Assistant 2026.11.0: Home Assistant logs show the pipeline finishing with no errors, restarting Piper sometimes fixes it for a while, and clearing the TTS cache did not.
Troubleshooting
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Containers restart or vanish | Out of memory | Run dmesg | grep -i kill; use Whisper tiny, shrink the Ollama context window, make sure only one model is loaded |
| Every reply starts slowly | Model unloading between requests | Confirm OLLAMA_KEEP_ALIVE=-1 is set in the compose file |
| Replies slow down mid-session | Thermal throttling or weak power | Check vcgencmd get_throttled, the cooler, and the 27W supply |
| Ollama integration cannot connect | Wrong URL or container down | Use http://<pi-ip>:11434; check docker compose ps |
| Wyoming connection refused | Whisper or Piper not running | Check docker compose logs whisper piper |
| Gemma ignores device commands | Context window too small, Device control off, or no tool support | Set the context window to 8192, expose only the devices you need, check Device control, restart the two satellite services, and preload the model |
| Browser mic does not work | Page served over plain http | Use typed Assist, or the speakerphone satellite |

