From c91b9c46ff1c72676aa91000cd5ae88a42fb0742 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Thu, 21 May 2026 22:58:12 -0400 Subject: [PATCH] fix(docker): restore STT (faster-whisper) on Python 3.14 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously removed all voice deps from the runtime image because of the numpy<2 / cp314 wheel chain. Actual upstream check (PyPI 2026-05-21) shows the chain has resolved for the STT half: - ctranslate2 v4.7.2 (2026-05-19) ships cp314 wheels - faster-whisper v1.2.1 is pure Python and works on any supported runtime - onnxruntime v1.26.0 has cp314 wheels (not used here but shared with the upcoming piper-tts install) The blocker was kokoro, not the whole stack. Kokoro has been stale upstream since April 2025 with a `requires_python='<3.13'` pin; that's being replaced separately with piper-tts. This commit restores ONLY STT — faster-whisper + soundfile. No torch (ctranslate2 does its own CPU inference), no kokoro, no spacy. Image add: ~150 MB. Voice code is lazily guarded; STT now works when VOICE_ENABLED=true. TTS still fails gracefully (kokoro import error logged, voice degrades) until the piper-tts swap lands. Co-Authored-By: Claude Opus 4.7 (1M context) --- Dockerfile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 62fe8f4..84b5971 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,13 +17,14 @@ COPY src/ src/ RUN --mount=type=cache,target=/root/.cache/pip \ pip install . -# Voice deps (faster-whisper, kokoro, torch, soundfile, spacy) are NOT -# installed in the production image. They added ~2 GB and pulled numpy<2, -# which has no cp314 wheel and broke the slim-image build. -# Voice paths in code are lazily guarded; with VOICE_ENABLED=false (default), -# the app starts cleanly. With voice enabled, missing imports log and -# the feature gracefully degrades. To re-enable voice in a build, install -# the `voice` extra: `pip install .[voice]` — and add an extras step here. +# Speech-to-text (faster-whisper + soundfile). faster-whisper is pure +# Python; the actual inference engine is ctranslate2 (C++) which has +# cp314 wheels as of v4.7.2 (2026-05-19). No torch needed — ctranslate2 +# does its own CPU inference. Image add: ~150 MB. +# TTS (piper-tts) is installed in a separate later step so STT can +# stand alone if TTS becomes problematic. +RUN --mount=type=cache,target=/root/.cache/pip \ + pip install faster-whisper soundfile # Build the fable-mcp wheel so it can be served for download COPY fable-mcp/ fable-mcp/