atlas-iac/dockerfiles/Dockerfile.hermes-jetson-tts
Hermes Agent e0f1a4504c fix(hermes-voice): switch Atlas Piper TTS to hfc_female, bake amy as alternate
Brad's 2026-08-20 decision: default the private Hermes chat TTS voice to a
warmer, pleasant feminine voice (en_US-hfc_female-medium) instead of Lessac.
en_US-amy-medium is baked into the same image as a selectable alternate so
the choice can be revisited without another Jenkins build. Lessac models are
kept (not deleted) since the task didn't require reclaiming image size; the
image grows by ~120.6 MiB (2 medium voices, onnx+json, from the pinned
rhasspy/piper-voices revision already used for lessac).

The Piper server only reads HERMES_TTS_VOICE at process start; the "voice"
field in the WebUI's request body is not consulted by the server
(dockerfiles/hermes-jetson-tts-server.py:59-72). That WebUI string is aligned
here for honesty, but the env var remains the effective control -- align
image digest and env var rollout order (see PR description).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-20 17:28:55 +00:00

58 lines
4.5 KiB
Docker

# syntax=docker/dockerfile:1
# dockerfiles/Dockerfile.hermes-jetson-tts
FROM python:3.11-slim-bookworm@sha256:d29f48a31a8b408ed19272ca1e7b10ebae13b240a27e862d3d4217c528e2e0c3
RUN python -m pip install --no-cache-dir piper-tts==1.5.0
# Pin the voice data in the image so synthesis has no runtime dependency on
# Hugging Face or mutable model metadata.
ADD --checksum=sha256:4cabf7c3a638017137f34a1516522032d4fe3f38228a843cc9b764ddcbcd9e09 --chmod=0444 \
https://huggingface.co/rhasspy/piper-voices/resolve/ea046e8458f6acd997706d6e6066a022b42f6fb1/en/en_US/lessac/high/en_US-lessac-high.onnx?download=true \
/opt/models/piper/en_US-lessac-high.onnx
ADD --checksum=sha256:db42b97d9859f257bc1561b8ed980e7fb2398402050a74ddd6cbec931a92412f --chmod=0444 \
https://huggingface.co/rhasspy/piper-voices/resolve/ea046e8458f6acd997706d6e6066a022b42f6fb1/en/en_US/lessac/high/en_US-lessac-high.onnx.json?download=true \
/opt/models/piper/en_US-lessac-high.onnx.json
ADD --checksum=sha256:5efe09e69902187827af646e1a6e9d269dee769f9877d17b16b1b46eeaaf019f --chmod=0444 \
https://huggingface.co/rhasspy/piper-voices/resolve/ea046e8458f6acd997706d6e6066a022b42f6fb1/en/en_US/lessac/medium/en_US-lessac-medium.onnx?download=true \
/opt/models/piper/en_US-lessac-medium.onnx
ADD --checksum=sha256:efe19c417bed055f2d69908248c6ba650fa135bc868b0e6abb3da181dab690a0 --chmod=0444 \
https://huggingface.co/rhasspy/piper-voices/resolve/ea046e8458f6acd997706d6e6066a022b42f6fb1/en/en_US/lessac/medium/en_US-lessac-medium.onnx.json?download=true \
/opt/models/piper/en_US-lessac-medium.onnx.json
ADD --checksum=sha256:f7d01dde371555732c4c314111ac79672b1a5ce2fc19266ab42178fd8df7f375 --chmod=0444 \
https://huggingface.co/rhasspy/piper-voices/resolve/ea046e8458f6acd997706d6e6066a022b42f6fb1/en/en_US/lessac/low/en_US-lessac-low.onnx?download=true \
/opt/models/piper/en_US-lessac-low.onnx
ADD --checksum=sha256:45754dfdebb3b8661c3fc564713772deec6e064feeb5b4e9594857dc7305193a --chmod=0444 \
https://huggingface.co/rhasspy/piper-voices/resolve/ea046e8458f6acd997706d6e6066a022b42f6fb1/en/en_US/lessac/low/en_US-lessac-low.onnx.json?download=true \
/opt/models/piper/en_US-lessac-low.onnx.json
ADD --checksum=sha256:914c473788fc1fa8b63ace1cdcdb44588f4ae523d3ab37df1536616835a140b7 --chmod=0444 \
https://huggingface.co/rhasspy/piper-voices/resolve/ea046e8458f6acd997706d6e6066a022b42f6fb1/en/en_US/hfc_female/medium/en_US-hfc_female-medium.onnx?download=true \
/opt/models/piper/en_US-hfc_female-medium.onnx
ADD --checksum=sha256:03f1fa0622b80463283592d97aca9f6e89aec345a5c56b7257723e0093c58b6c --chmod=0444 \
https://huggingface.co/rhasspy/piper-voices/resolve/ea046e8458f6acd997706d6e6066a022b42f6fb1/en/en_US/hfc_female/medium/en_US-hfc_female-medium.onnx.json?download=true \
/opt/models/piper/en_US-hfc_female-medium.onnx.json
ADD --checksum=sha256:b3a6e47b57b8c7fbe6a0ce2518161a50f59a9cdd8a50835c02cb02bdd6206c18 --chmod=0444 \
https://huggingface.co/rhasspy/piper-voices/resolve/ea046e8458f6acd997706d6e6066a022b42f6fb1/en/en_US/amy/medium/en_US-amy-medium.onnx?download=true \
/opt/models/piper/en_US-amy-medium.onnx
ADD --checksum=sha256:95a23eb4d42909d38df73bb9ac7f45f597dbfcde2d1bf9526fdeaf5466977d77 --chmod=0444 \
https://huggingface.co/rhasspy/piper-voices/resolve/ea046e8458f6acd997706d6e6066a022b42f6fb1/en/en_US/amy/medium/en_US-amy-medium.onnx.json?download=true \
/opt/models/piper/en_US-amy-medium.onnx.json
RUN chmod 0555 /opt/models /opt/models/piper
COPY dockerfiles/hermes-jetson-tts-server.py /opt/atlas/hermes-jetson-tts-server.py
RUN chmod 0555 /opt/atlas/hermes-jetson-tts-server.py
# Load the actual pinned voice during the ARM64 build. This catches package or
# model-format drift before the image can reach Flux.
RUN python -c "import stat; from pathlib import Path; from piper import PiperVoice; p=Path('/opt/models/piper'); models=[p/'en_US-lessac-high.onnx',p/'en_US-lessac-medium.onnx',p/'en_US-lessac-low.onnx',p/'en_US-hfc_female-medium.onnx',p/'en_US-amy-medium.onnx']; assert stat.S_IMODE(p.stat().st_mode)==0o555; assert all(stat.S_IMODE(model.stat().st_mode)==0o444 for model in models); voices=[PiperVoice.load(model,Path(str(model)+'.json'),use_cuda=False,download_dir=p) for model in models]; assert all(voice.config.sample_rate>0 for voice in voices)"
ENV HERMES_TTS_HOST=0.0.0.0 \
HERMES_TTS_PORT=9001 \
HERMES_TTS_VOICE=en_US-hfc_female-medium \
HERMES_TTS_CACHE=/opt/models/piper \
OMP_NUM_THREADS=2 \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
EXPOSE 9001
ENTRYPOINT ["python", "/opt/atlas/hermes-jetson-tts-server.py"]