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
Conversation
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>
There was a problem hiding this comment.
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.txtin the backend Docker image (bringing in WhisperLiveKit + faster-whisper). - Switch WebSocket STT gating from
WHISPER_ENABLEDto runtime_stt_available(reflects actual import/load success). - Update Docker Compose + env/docs defaults around
OLLAMA_URL, and enable Whisper inconfig.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 |
| | `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 | |
| async def ws_mermaid(websocket: WebSocket): | ||
| if WHISPER_ENABLED: | ||
| if _stt_available: | ||
| from whisperlivekit import AudioProcessor |
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
requirements.stt.txt(whisperlivekit + faster-whisper) so_stt_available=Trueat runtimewhisper.enabled=true— deps now in image; graceful no-op if import failsWhy
Docker image only installed
requirements.txt, leaving WhisperLiveKit missing.stt_enabledwas alwaysfalse— voice button permanently disabled on the website.Test plan
GET /v1/configreturnsstt_enabled: true🤖 Generated with Claude Code