Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fa1839d
Add initial GPU support
edurenye Aug 24, 2023
cbd0720
Add support for both GPU and NONGPU Dockerfiles
edurenye Oct 6, 2023
4c459ab
Add docker compose and instructions
edurenye Oct 6, 2023
f263f9f
Make whisper use cuda
edurenye Oct 27, 2023
45371b5
Update Dockerfiles and add Vosk
edurenye Dec 18, 2023
f7be668
Create __main__.py
baudneo Dec 26, 2023
66f46e5
Create process.py
baudneo Dec 26, 2023
3c1c491
Update docker-compose.gpu.yml
baudneo Dec 26, 2023
177bac4
Remove volumes, they can be added by extended docker compose files
edurenye Jan 31, 2024
4eb1b22
Fixes from rebases
edurenye Feb 28, 2024
0b10b34
Fixes from rebases
edurenye Mar 11, 2024
d7493da
Fixes from rebases
edurenye Mar 12, 2024
559a75b
Use YAML anchores, all commented services, and add whisper-cpp
edurenye Mar 12, 2024
3af9c6f
Simplify everything using BASE image args
edurenye Mar 12, 2024
2f199f1
Simplify everything using BASE image args
edurenye Mar 12, 2024
0dca0f2
Add default values and use env for runtime
edurenye Mar 13, 2024
218e46e
Go back to two files for piper and updated piper gpu
edurenye Mar 14, 2024
ccd4ef4
Add microwakeword option
edurenye Nov 12, 2024
dd05208
chore: Add rhasspy-speech option
edurenye Jan 8, 2025
4219109
chore: Update images and whisper version
edurenye Jan 8, 2025
248ba46
Go back to openwakeword 1.8.2
edurenye Feb 26, 2025
e85cb95
Fix errors and warnings
edurenye Feb 26, 2025
efcfb5d
Remove runtime nvidia
edurenye Aug 5, 2025
0c886e2
Fixes from the last rebase, and add speech-to-phrase
edurenye Sep 23, 2025
a8f07f2
Update CUDA image to Ubuntu 24.04
edurenye Sep 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,78 @@ Visit http://localhost:5000 to explore the API.
docker run -it -p 10400:10400 rhasspy/wyoming-openwakeword --preload-model 'ok_nabu'
```


## Run snowboy

``` sh
docker run -it -p 10400:10400 rhasspy/wyoming-snowboy
```


## Run microWakeWord

``` sh
docker run -it -p 10400:10400 rhasspy/wyoming-microwakeword
```


## Run rhasspy-speech

``` sh
docker run -it -p 10300:10300 -v /path/to/download/models:/models -v /path/to/train:/train rhasspy/wyoming-rhasspy-speech
```


## Run speech-to-phrase

``` sh
docker run -it -p 10300:10300 -v /path/to/download/models:/models -v /path/to/train:/train rhasspy/wyoming-speech-to-phrase --hass-websocket-uri 'ws://homeassistant.local:8123/api/websocket' --hass-token '<LONG_LIVED_ACCESS_TOKEN>' --retrain-on-start
```


## To run in standalone server

### Run without GPU

Build openwakeword, piper and whisper without GPU with:

``` sh
docker compose -f docker-compose.base.yml build --no-cache
```

Run it with:

``` sh
docker compose -f docker-compose.base.yml up -d
```

Take it down with:

``` sh
docker compose down
```

### Run with GPU

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we reference documentation on how to setup docker for gpu? (I can of course add it in a seperate pr)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, good idea!


Build openwakeword, piper and whisper with GPU with:

``` sh
docker compose -f docker-compose.gpu.yml build --no-cache
```

Run it with:

``` sh
docker compose -f docker-compose.gpu.yml up -d
```

Take it down with:

``` sh
docker compose down
```

### Extend it

You can extend those files adding your own languages.
More on docker compose extend in the [official documentation](https://docs.docker.com/compose/multiple-compose-files/extends/).
79 changes: 79 additions & 0 deletions docker-compose.base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
### YAML Anchors ###
x-common: &common
restart: unless-stopped

####
services:
wyoming-piper:
build:
context: ./piper/
ports:
- "10200:10200"
command: [ "--voice", "en_US-lessac-medium" ]
<<: [ *common ]

wyoming-whisper:
build:
context: ./whisper/
ports:
- "10300:10300"
command: [ "--model", "tiny-int8", "--language", "en" ]
<<: [ *common ]

# wyoming-whispercpp:
# build:
# context: ./whisper-cpp/
# ports:
# - "10300:10300"
# command: [ "--model", "tiny-int8", "--language", "en" ]
# <<: [ *common ]

wyoming-openwakeword:
build:
context: ./openwakeword/
ports:
- "10400:10400"
command: [ "--preload-model", "ok_nabu" ]
<<: [ *common ]

# wyoming-porcupine:
# build:
# context: ./porcupine1/
# ports:
# - "10400:10400"
# <<: [ *common ]

# wyoming-snowboy:
# build:
# context: ./snowboy/
# ports:
# - "10400:10400"
# <<: [ *common ]

# speech-to-phrase:
# build:
# context: ./speech-to-phrase/
# ports:
# - "10300:10300"
# <<: [ *common ]

# wyoming-vosk:
# build:
# context: ./vosk/
# ports:
# - "10400:10400"
# <<: [ *common ]

# wyoming-microwakeword:
# build:
# context: ./microwakeword/
# ports:
# - "10400:10400"
# <<: [ *common ]

# wyoming-rhasspy-speech:
# build:
# context: ./rhasspy-speech/
# ports:
# - "10300:10300"
# <<: [ *common ]
84 changes: 84 additions & 0 deletions docker-compose.gpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
### YAML Anchors ###
x-gpu: &gpu
build:
args:
- BASE=nvidia/cuda:12.8.1-cudnn-runtime-ubuntu24.04
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: ["compute", "utility", "graphics"]

####
services:
wyoming-piper:
extends:
file: docker-compose.base.yml
service: wyoming-piper
<<: [ *gpu ]
build:
dockerfile: GPU.Dockerfile
args:
- EXTRA_DEPENDENCIES=onnxruntime-gpu
- RUN_SCRIPT=run-gpu.sh
volumes:
- ./piper/__main__.py:/opt/venv/lib/python3.11/site-packages/wyoming_piper/__main__.py
- ./piper/process.py:/opt/venv/lib/python3.11/site-packages/wyoming_piper/process.py

wyoming-whisper:
extends:
file: docker-compose.base.yml
service: wyoming-whisper
<<: [ *gpu ]
command: [ "--model", "tiny-int8", "--language", "en", "--device", "cuda" ]

# wyoming-whispercpp:
# extends:
# file: docker-compose.base.yml
# service: wyoming-whispercpp
# <<: [ *gpu ]
# command: [ "--model", "tiny-int8", "--language", "en", "--device", "cuda" ]

wyoming-openwakeword:
extends:
file: docker-compose.base.yml
service: wyoming-openwakeword
<<: [ *gpu ]

# wyoming-porcupine:
# extends:
# file: docker-compose.base.yml
# service: wyoming-porcupine
# <<: [ *gpu ]

# wyoming-snowboy:
# extends:
# file: docker-compose.base.yml
# service: wyoming-snowboy
# <<: [ *gpu ]

# speech-to-phrase:
# extends:
# file: docker-compose.base.yml
# service: speech-to-phrase
# <<: [ *gpu ]

# wyoming-vosk:
# extends:
# file: docker-compose.base.yml
# service: wyoming-vosk
# <<: [ *gpu ]

# wyoming-microwakeword:
# extends:
# file: docker-compose.base.yml
# service: wyoming-microwakeword
# <<: [ *gpu ]

# wyoming-rhasspy-speech:
# extends:
# file: docker-compose.base.yml
# service: wyoming-rhasspy-speech
# <<: [ *gpu ]
4 changes: 3 additions & 1 deletion microwakeword/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM debian:bookworm-slim
ARG BASE=debian:bookworm-slim
FROM $BASE

ARG TARGETARCH
ARG TARGETVARIANT

Expand Down
4 changes: 3 additions & 1 deletion openwakeword/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM debian:bookworm-slim
ARG BASE=debian:bookworm-slim
FROM $BASE

ARG TARGETARCH
ARG TARGETVARIANT

Expand Down
4 changes: 3 additions & 1 deletion piper/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM debian:bookworm-slim
ARG BASE=debian:bookworm-slim
FROM $BASE

ARG TARGETARCH
ARG TARGETVARIANT

Expand Down
51 changes: 51 additions & 0 deletions piper/GPU.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
ARG BASE=debian:bookworm-slim
FROM $BASE

ARG RUN_SCRIPT='run.sh'

ARG TARGETARCH
ARG TARGETVARIANT

# Install Piper
WORKDIR /usr/src
ARG WYOMING_PIPER_VERSION='1.6.3'
ARG WYOMING_VERSION='1.7.2'
ARG BINARY_PIPER_VERSION='1.2.0'
ENV PIP_BREAK_SYSTEM_PACKAGES=1

RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
python3 \
python3-pip \
python3-dev \
build-essential \
\
&& pip3 install --no-cache-dir -U \
setuptools \
wheel \
&& pip3 install --no-cache-dir \
"wyoming-piper @ https://github.com/rhasspy/wyoming-piper/archive/refs/tags/v${WYOMING_PIPER_VERSION}.tar.gz" \
\
&& pip3 install --no-cache-dir \
"wyoming[http] @ https://github.com/OHF-voice/wyoming/archive/refs/tags/${WYOMING_VERSION}.tar.gz" \
\
&& curl -L -s \
"https://github.com/rhasspy/piper/releases/download/v${BINARY_PIPER_VERSION}/piper_${TARGETARCH}${TARGETVARIANT}.tar.gz" \
| tar -zxvf - -C /usr/share \
\
&& apt-get remove -y --purge \
python3-dev \
build-essential \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /
COPY $RUN_SCRIPT ./
ENV RUN_SCRIPT_ENV="/${RUN_SCRIPT}"

EXPOSE 10200
EXPOSE 5000

ENTRYPOINT ["bash", "-c", "exec $RUN_SCRIPT_ENV \"${@}\"", "--"]
Loading