How to manually install Piper

Hello,

I would try to install Piper on my self installed Home Assistant on a RPI4 (Raspian + venv + pip install), but I can’t found information about the process. The existing doc only talk about the installation of the HA OS addon.

Do you know any doc I missed ? I also installed Whisper using the provided Docker image (on another host for performance). May be it’s possible to use the docker image of the HA OS addon ?

Thanks !

2 Likes

Me too. I managed to install piper and openai-whisper pip modules, but those don’t show up in integrations. Something else needs to be done before that?

Add the Wyoming Protocol - Home Assistant integration because that is the glue for the addons.

Pro tip, if you go changing the Piper voices or some configuration in Piper or Whisper you have to restart the addon and then reload the relevant Wyoming integration before the Assist bit will detect the configuration change.

1 Like

I didn’t install piper and whisper but it would be nice if someone who manage to make this work on docker installation wrote guide on how to install this in docker.

1 Like

I finally found this docker image reference in the Chapter 2: Let’s talk blog post.

2 Likes

what about wyoming-piper and wyoming-faster-whisper

Well basically it’s simple to install whisper and piper.
I used this for piper and this for whisper.
Pull the container,change path to your path and run it. Rename containers to something like wyoming-piper and wyomin-whisper and add wyoming integration. For host I selected localhost and for port 10200 and 10300 and that was it.
Whisper and piper arre recognized in home assistant.

Can you Better explain how to select host ?
It would be possibile ti share the docker compose yaml ?

I didn’t select anything. I done exactly what i wrote:

  1. pull image
  2. change
    -v /path/to/local/data:/data
    to
    -v /opt/whisper-piper/data:/data
    and run the container.
    I just renamed container and add wyoming integration selecting localhost and port. And that was it.

Edit:
I created new voice assistant to check if everything is working properly. Tested on my mobile phone and everything is working. It does recognize speech.

A working docker-compose for reference

version: "3"
services:
## wyoming
  whisper:
    container_name: whisper
    image: rhasspy/wyoming-whisper
    command: --model base-int8 --language fr
    volumes:
      - ./whisper-data:/data
    environment:
      - TZ=Europe/Brussels
    restart: unless-stopped
    ports:
      - 10300:10300

  piper:
    container_name: piper
    image: rhasspy/wyoming-piper
    command: --voice fr-siwis-medium
    volumes:
      - ./piper-data:/data
    environment:
      - TZ=Europe/Brussels
    restart: unless-stopped
    ports:
      - 10200:10200
6 Likes

Hi,
I just tested your docker-compose and this is working, no problems at all. Thank you for posting this.
Do you maybe know how to add more languages to whisper container?

Are these docker images documented somewhere, e.g. how are they created?
I would prefer to install piper locally (and also whisper), without docker.

This is docker installation only. For addons installation check the docs.

Those, specifically, I don’t know, but you can check the addons Dockerfiles to reproduce out of docker.

Source code management is a bit messy atm, I must say. pip is used, but I can’t tell the source repository.

1 Like

You spin up more containers with your desired languages.

This is working setup of for both danish and english.

version: "4.0"

  wyoming-piper-en:
    image: rhasspy/wyoming-piper
    container_name: piper-en
    ports:
      - 10200:10200
    volumes:
      - ${DOCKERCONFDIR}/piper/english:/data
    command: --voice en-gb-southern_english_female-low

  wyoming-whisper-en:
    image: rhasspy/wyoming-whisper
    container_name: whisper-en
    ports:
      - 10300:10300
    volumes:
      - ${DOCKERCONFDIR}/whisper/english:/data
    command: --model tiny-int8 --language en

  wyoming-piper-da:
    image: rhasspy/wyoming-piper
    container_name: piper-da
    ports:
      - 10201:10200
    volumes:
      - ${DOCKERCONFDIR}/piper/danish:/data
    command: --voice da-nst_talesyntese-medium

  wyoming-whisper-da:
    image: rhasspy/wyoming-whisper
    container_name: whisper-da
    ports:
      - 10301:10300
    volumes:
      - ${DOCKERCONFDIR}/whisper/danish:/data
    command: --model tiny-int8 --language da
1 Like

I’m currently running HA on a RPI4, therefore I would like to keep the non-essential and CPU intensive tasks (frigate, tts, stt) on a separate host. It sounds like the Wyoming protocol will allow me to run piper and whisper on my Proxmox box so I don’t overload the Pi. Is there more documentation on this use case? Have others setup and tested this type of a configuration?

I tested configuration from @koying and this works with out any issue. I didn’t test configuration from @bjorn.sivertsen because I currently don’t have time do to it, but I will.
I don’t use pi because I think that you need a desktop comp for running ha and there is no need in for separate hosts if you are using docker. You can easily limit cpu and memory usage in docker like this

    shm_size: "64mb"
    mem_limit: "256m"
    mem_reservation: "256m"
    memswap_limit: "1024m"
    cpus: "1"
    cpuset: "2"

This is for my frigate config. My average cpu usage is about 23% running 22 containers on Intel(R) Core™ i3-4130 CPU @ 3.40GHz. For doc you can check around net, but this doesnt have a lot of impact on my system. Maybe around 0.5% to 1% of cpu usage.

this seems like a good place to post this…

I installed piper/whisper on a separate docker host and wanted to use the highest quality english model. it took 4 full CPU cores for abour 12 seconds before coming up with an answer to a short request.

I happened to have a beefy server avaiable, so I did some digging and found that you can passing this environment variable: OMP_NUM_THREADS=8 will allow the whisper process to use 8 cores instead of just 4.

I cant say it is twice as fast, but it is faster.

3 Likes

You mean “medium-int8”, right?
I also did similar tests, for French, and also hit some wall at 13/15s with various CPU.

yes, im using medium-int8. I’m at 12 cores now with beam-size 5, and i think i’m getting around 10 seconds. i might just throw an insane number of cores at it just to see what it does…

1 Like