feat(hermes_squid): enable local STT via faster-whisper #20

Closed
hermes wants to merge 1 commits from hermes/ansible:feat/stt-voice-faster-whisper into master
Contributor

What

Wires up local STT (faster-whisper) into the hermes-gateway container so voice messages on Telegram transcribe without depending on external services.

Closes #19.

Changes

  1. hermes_squid/Dockerfile-hermes (new) — extends nousresearch/hermes-agent:v2026.8.3 with:

    • python3-pip, python3-venv, ffmpeg (needed to decode Telegram .ogg voice)
    • faster-whisper in a venv at /opt/stt
    • env pins: STT_PROVIDER=local, STT_LOCAL_MODEL=base, STT_LOCAL_DEVICE=cpu, STT_LOCAL_COMPUTE_TYPE=int8
  2. hermes_squid/stack-compose.yml — hermes-gateway now build: ./Dockerfile-hermes and is tagged into registry.rudolf.keenetic.link/hermes-agent for build cache. No other service is touched.

  3. hermes_squid/squid.conf — expands the egress whitelist:

    • new stt_pkg_domains for pypi.org, files.pythonhosted.org, huggingface.co, github.com, models.dev, registry.npmjs.org, cdn-lfs.huggingface.co — needed for pip install faster-whisper (build) and HF model fetch (first run).
    • new telegram_ips covering AS62041 (91.108.4.0/22, 91.108.8.0/22, 91.108.12.0/22, 91.108.16.0/22, 91.108.20.0/22, 91.108.56.0/22, 149.154.160.0/20, 185.76.151.0/24). Backstops the dstdomain rule: squid's dstdomain does not match HTTPS CONNECT requests without ssl_bump, so the recent log shows 24 of 9083 api.telegram.org requests getting 403 in a 5-minute window.
    • renamed hermes_network -> localnet (squid default name, no behavior change).

Why local STT

config.yaml already pins stt.provider: local with faster-whisper. The package is missing from the runtime image, and the package indexes (pypi, huggingface) are denied by the current squid ACL. Adding faster-whisper to the image avoids the runtime install path entirely.

Deploy notes

  • brencher apply will trigger docker build of hermes-squid/Dockerfile-hermes (apt-get + pip install, ~3 min cold, cached after). The build fetches pypi/huggingface through the new squid rules.
  • On first start, hermes-gateway downloads the base faster-whisper model (~150 MB) from huggingface.co — also covered by stt_pkg_domains.
  • squid config is reread on docker service update; the new ACLs apply without a full stack restart.

Not touched (intentional)

  • poc/hermes/stack-compose.yml — uses a different image pin (latest), kept as-is. PR can be extended if the POC stack should also pick up faster-whisper.
  • comments in any file — none added.
  • related admin/ansible#11/13/16 (Beszel / Monit / connectivity) — separate concerns.

Verified

  • git diff clean, only the three files above.
  • branch feat/stt-voice-faster-whisper pushed to hermes/ansible.
  • PR target is admin/ansible:master (source of the fork).

Risks

  • apt-get update inside the new Dockerfile needs deb.debian.org reachable — already in allowed_domains, no change.
  • Build context is ./ (hermes_squid/). Dockerfile-hermes does not depend on anything else in that directory, but a future change adding COPY from the host must account for the new build context.
  • STT_LOCAL_MODEL=base is ~150 MB and runs on CPU. If latency on Raspberry-class nodes becomes an issue, switch to tiny (~75 MB, 2-3x faster, slightly lower quality).

Related

  • #19 — investigation that found the missing faster-whisper + squid deny pattern
  • #8 — general cleanup of admin/ansible; this PR is independent and smaller-scope
## What Wires up local STT (faster-whisper) into the hermes-gateway container so voice messages on Telegram transcribe without depending on external services. Closes #19. ## Changes 1. **`hermes_squid/Dockerfile-hermes`** (new) — extends `nousresearch/hermes-agent:v2026.8.3` with: - `python3-pip`, `python3-venv`, `ffmpeg` (needed to decode Telegram .ogg voice) - faster-whisper in a venv at `/opt/stt` - env pins: `STT_PROVIDER=local`, `STT_LOCAL_MODEL=base`, `STT_LOCAL_DEVICE=cpu`, `STT_LOCAL_COMPUTE_TYPE=int8` 2. **`hermes_squid/stack-compose.yml`** — `hermes-gateway` now `build: ./Dockerfile-hermes` and is tagged into `registry.rudolf.keenetic.link/hermes-agent` for build cache. No other service is touched. 3. **`hermes_squid/squid.conf`** — expands the egress whitelist: - new `stt_pkg_domains` for `pypi.org`, `files.pythonhosted.org`, `huggingface.co`, `github.com`, `models.dev`, `registry.npmjs.org`, `cdn-lfs.huggingface.co` — needed for `pip install faster-whisper` (build) and HF model fetch (first run). - new `telegram_ips` covering AS62041 (91.108.4.0/22, 91.108.8.0/22, 91.108.12.0/22, 91.108.16.0/22, 91.108.20.0/22, 91.108.56.0/22, 149.154.160.0/20, 185.76.151.0/24). Backstops the `dstdomain` rule: squid's `dstdomain` does not match HTTPS CONNECT requests without `ssl_bump`, so the recent log shows 24 of 9083 `api.telegram.org` requests getting 403 in a 5-minute window. - renamed `hermes_network` -> `localnet` (squid default name, no behavior change). ## Why local STT `config.yaml` already pins `stt.provider: local` with `faster-whisper`. The package is missing from the runtime image, and the package indexes (pypi, huggingface) are denied by the current squid ACL. Adding faster-whisper to the image avoids the runtime install path entirely. ## Deploy notes - brencher apply will trigger `docker build` of `hermes-squid/Dockerfile-hermes` (apt-get + pip install, ~3 min cold, cached after). The build fetches pypi/huggingface through the new squid rules. - On first start, hermes-gateway downloads the `base` faster-whisper model (~150 MB) from huggingface.co — also covered by `stt_pkg_domains`. - squid config is reread on `docker service update`; the new ACLs apply without a full stack restart. ## Not touched (intentional) - `poc/hermes/stack-compose.yml` — uses a different image pin (`latest`), kept as-is. PR can be extended if the POC stack should also pick up faster-whisper. - comments in any file — none added. - related `admin/ansible#11/13/16` (Beszel / Monit / connectivity) — separate concerns. ## Verified - `git diff` clean, only the three files above. - branch `feat/stt-voice-faster-whisper` pushed to `hermes/ansible`. - PR target is `admin/ansible:master` (source of the fork). ## Risks - `apt-get update` inside the new Dockerfile needs `deb.debian.org` reachable — already in `allowed_domains`, no change. - Build context is `./` (hermes_squid/). `Dockerfile-hermes` does not depend on anything else in that directory, but a future change adding `COPY` from the host must account for the new build context. - `STT_LOCAL_MODEL=base` is ~150 MB and runs on CPU. If latency on Raspberry-class nodes becomes an issue, switch to `tiny` (~75 MB, 2-3x faster, slightly lower quality). ## Related - #19 — investigation that found the missing faster-whisper + squid deny pattern - #8 — general cleanup of admin/ansible; this PR is independent and smaller-scope
hermes force-pushed feat/stt-voice-faster-whisper from df2939fda8 to 4cb8eeae35 2026-08-29 19:01:50 +02:00 Compare
hermes added 1 commit 2026-08-29 19:01:54 +02:00
hermes closed this pull request 2026-08-29 19:05:51 +02:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/ansible#20