Running piper and whisper for Home Assistant on Proxmox (LXC-based)

Piper and Whisper are Home Assistant add-ons needed for creating voice assistant pipelines. Piper is a local text-to-speech engine (TTS), and Whisper is a speech-to-text engine (STT). By using these, we can get rid of cloud services such as Google or OpenAI.

If you have installed Home Assistant on Proxmox using the LXC version, not the Virtual Machine (Home Assistant OS) version, than you cannot install these add-ons through the Home Assistant frontend. Instead, you need to manually install the Docker containers.

First, make sure you have followed my guide on how to install Docker containers on Proxmox. Then, continue here.

Let’s start

Go to your docker host LXC container in Proxmox, and start a shell, or SSH into the container.

There are two ways to go about starting the containers. First, you could define a docker compose file with both services inside. Second, you can execute each docker run command on its own, since the containers don’t need special configuration. We will go with the second option.

Starting Piper

Make sure to use the appropriate volume mount and voice model when you run the command! You can find the available models here. In my case, I will use “de_DE-kerstin-low”.

mkdir /root/piper-data
docker run -it -p 10200:10200 \
  -v /root/piper-data:/data \
  rhasspy/wyoming-piper \
  --voice de_DE-kerstin-low

This will pull and run the image in interactive mode. Once you are sure that it works, stop it using Ctrl+C and execute the same command with “-d” option instead of “-it”. This will start the container in detached mode.

Starting whisper

Here, Home Assistant explains that they recommend to use the fork called faster-whisper. The rhasspy/wyoming-whisper image we will be using already uses that fork. That’s great. (For those who are interested, here is the Dockerfile).

In my case, the “tiny” model performed really bad with the German language. I also tried “small”, but it was not better. In the end, I stayed with “medium”. But in that case, make sure that your system has enough resources (CPU and RAM).

This is the run command. Make sure to change the parameters as needed (e.g. port, path, model, language etc).

mkdir /root/whisper-data
docker run -it -p 10300:10300 \
  -v /root/whisper-data:/data \
  rhasspy/wyoming-whisper \
  --model medium-int8 --language de

(Optional) Starting openWakeWord

Having wake word detection is super useful, so I decided to also add this container:

docker run -it -p 10400:10400 \
  rhasspy/wyoming-openwakeword \
  --preload-model 'ok_nabu'

Additional info

Here are the commands to run both containers in detached mode, and make sure they start when docker starts:

# Piper
docker run -d -p 10200:10200 \
  -v /root/piper-data:/data \
  --restart unless-stopped \
  rhasspy/wyoming-piper \
  --voice de_DE-kerstin-low

# Whisper
docker run -d -p 10300:10300 \
  -v /root/whisper-data:/data \
  --restart unless-stopped \
  rhasspy/wyoming-whisper \
  --model small-int8 --language de

# openWakeWord
docker run -d -p 10400:10400 \
  --restart unless-stopped \
  rhasspy/wyoming-openwakeword \
  --preload-model 'ok_nabu'

Adding them to Home Assistant

Depending on your network configuration, the services might not be discovered automatically. In that case, just go to your Home Assistant settings, go to “Devices & Services” and add a new “Wyoming” integration (Wyoming is the protocol that Piper and Whisper use). Insert the IP address and corresponding port and it should work.

In the properties of the Wyoming integration, it should look like this:

Now you can proceed with setting up your assist pipeline! Great!

(Details on setting up the wake word in Home Assistant can be found here)

References

Leave a Reply