Skip to content
This repository was archived by the owner on Apr 24, 2026. It is now read-only.

fix(vtm): install STT deps in Docker image, enable whisper#7

Merged
jaewilson07 merged 13 commits into
mainfrom
fix/vtm-stt-dockerfile
Apr 21, 2026
Merged

fix(vtm): install STT deps in Docker image, enable whisper#7
jaewilson07 merged 13 commits into
mainfrom
fix/vtm-stt-dockerfile

Conversation

@jaewilson07

Copy link
Copy Markdown
Owner

Summary

  • Dockerfile: install requirements.stt.txt (whisperlivekit + faster-whisper) so _stt_available=True at runtime
  • config.yaml: whisper.enabled=true — deps now in image; graceful no-op if import fails

Why

Docker image only installed requirements.txt, leaving WhisperLiveKit missing. stt_enabled was always false — voice button permanently disabled on the website.

Test plan

  • Rebuild image → WhisperLiveKit loads at startup
  • GET /v1/config returns stt_enabled: true
  • Voice button enabled on website after signing in

🤖 Generated with Claude Code

jaewilson07 and others added 11 commits April 19, 2026 23:04
Ensures containers recover automatically after crashes or Docker
restarts, supporting Docker Desktop auto-start on Windows login.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
whisper.enabled/model/language/device, ollama.default_model, openai.model,
and paths now live in config.yaml (volume-mounted, editable without rebuild).
.env reduced to secrets only (OLLAMA_URL). Env var overrides still work.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ck, WHISPER_DEVICE wired, default enabled=false
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nabled in /v1/config

Address Copilot review on PR #5:
- Add _config_section() helper to guard against non-dict config sections
- Replace bare _cfg.get("x", {}).get() chains with per-section dicts
- Introduce _stt_available flag (False until WhisperLiveKit loads); stt_enabled in
  /v1/config now reflects actual runtime state instead of config intent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…d _stt_available flag

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…an up .env.example and README

- config.yaml: add comment explaining whisper.enabled=true is safe (graceful failure via _stt_available)
- .env.example: remove OLLAMA_MODEL, WHISPER_MODEL/DEVICE, MERMAID_PROMPT_PATH (moved to config.yaml)
- README: split env table into config.yaml section and .env secrets-only section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ama via host-gateway

- ws_mermaid: replace WHISPER_ENABLED guards with _stt_available so WS works
  when whisper config is enabled but import failed (Docker without STT deps)
- docker-compose: remove hard-coded OLLAMA_URL override; add extra_hosts for
  host.docker.internal so .env can point at host Ollama

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…bled default

- docker-compose: restore OLLAMA_URL default (http://ollama:11434) via
  ${OLLAMA_URL:-http://ollama:11434} so docker-compose up works out of the box;
  .env still overrides it (host.docker.internal:11434 for host Ollama)
- .env.example: use http://ollama:11434 as default with host Ollama commented variant
- config.yaml: revert whisper.enabled to false (safe default; README already said false)
- README: align whisper.enabled description and OLLAMA_URL default with actual shipped values

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Dockerfile: install requirements.stt.txt (whisperlivekit + faster-whisper)
  so _stt_available=True at runtime and /v1/config returns stt_enabled: true
config.yaml: whisper.enabled=true — deps now in image; graceful no-op if import fails

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 21, 2026 19:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Enables speech-to-text (WhisperLiveKit) in the voice-to-mermaid backend Docker deployment so the UI can surface voice input when STT deps are present and successfully loaded.

Changes:

  • Install requirements.stt.txt in the backend Docker image (bringing in WhisperLiveKit + faster-whisper).
  • Switch WebSocket STT gating from WHISPER_ENABLED to runtime _stt_available (reflects actual import/load success).
  • Update Docker Compose + env/docs defaults around OLLAMA_URL, and enable Whisper in config.yaml.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
voice-to-mermaid/backend/main.py Uses _stt_available to decide whether to enable STT behavior in the WS pipeline.
voice-to-mermaid/backend/docker-compose.yml Adjusts OLLAMA_URL defaults and adds host.docker.internal mapping; removes depends_on.
voice-to-mermaid/backend/config.yaml Enables Whisper by default and updates related comments.
voice-to-mermaid/backend/Dockerfile Installs requirements.stt.txt during image build.
voice-to-mermaid/backend/.env.example Updates suggested OLLAMA_URL for Docker Compose usage.
voice-to-mermaid/README.md Updates configuration/environment variable documentation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 26 to +31
environment:
- OLLAMA_URL=http://ollama:11434
depends_on:
- ollama
# Default to the bundled ollama service; override in .env to use a
# host-resident Ollama (http://host.docker.internal:11434) instead.
OLLAMA_URL: ${OLLAMA_URL:-http://ollama:11434}
extra_hosts:
- "host.docker.internal:host-gateway"
Comment on lines +21 to 23
# Enabled: requirements.stt.txt is now installed in the Dockerfile.
# If import fails, _stt_available stays False and /v1/config returns stt_enabled: false — no crash.
enabled: true
Comment thread voice-to-mermaid/README.md Outdated
| `ollama.model_filter` | _(list)_ | Model name prefixes shown in the UI picker |
| `openai.model` | `gpt-4o-mini` | OpenAI-compatible model name |
| `whisper.enabled` | `false` | Set `true` after installing `requirements.stt.txt` |
| `whisper.enabled` | `false` | Set `true` after installing `requirements.stt.txt`; graceful no-op if import fails |
Comment thread voice-to-mermaid/backend/main.py Outdated
async def ws_mermaid(websocket: WebSocket):
if WHISPER_ENABLED:
if _stt_available:
from whisperlivekit import AudioProcessor
jaewilson07 and others added 2 commits April 21, 2026 13:47
- Move AudioProcessor import next to instantiation site (not function top)
- Don't cache empty Ollama model list — retry on next request if Ollama unreachable at startup
- Update README whisper.enabled default to true (matches config.yaml and Dockerfile)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Keep HEAD for all conflicts: whisper.enabled=true, AudioProcessor import
moved to usage site, README default updated to true.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jaewilson07
jaewilson07 merged commit 99d23ec into main Apr 21, 2026
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants