Skip to content
This repository was archived by the owner on Apr 24, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion voice-to-mermaid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ It is volume-mounted in Docker, so changes take effect on restart without rebuil
| `ollama.default_model` | `qwen3:8b` | Ollama model for diagram generation |
| `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`; graceful no-op if import fails |
| `whisper.enabled` | `true` | STT enabled by default (deps installed in Docker image); graceful no-op if import fails |
| `whisper.model` | `medium.en` | Whisper model size |
| `whisper.device` | `auto` | `auto` / `cpu` / `cuda` |
| `paths.prompt` | `prompts/mermaid.txt` | Path to LLM prompt template |
Expand Down
4 changes: 2 additions & 2 deletions voice-to-mermaid/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ FROM python:3.12-slim
RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY requirements.txt requirements.stt.txt ./
RUN pip install --no-cache-dir -r requirements.stt.txt

COPY . .

Expand Down
4 changes: 2 additions & 2 deletions voice-to-mermaid/backend/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ openai:
model: "gpt-4o-mini"

whisper:
# Set true only after installing requirements.stt.txt (or adding it to Dockerfile).
# 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: false
enabled: true
Comment on lines +21 to 23
model: "medium.en"
language: "en"
device: "auto" # "auto", "cuda", "cpu" — maps to WhisperLiveKitConfig backend
Expand Down
6 changes: 2 additions & 4 deletions voice-to-mermaid/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ async def health():
@app.get("/v1/config")
async def config():
global _ollama_models_cache
if _ollama_models_cache is None:
if not _ollama_models_cache:
_ollama_models_cache = await _fetch_ollama_models()
return {
"ollama_url": OLLAMA_URL,
Expand All @@ -357,9 +357,6 @@ async def refresh_models():

@app.websocket("/ws/mermaid")
async def ws_mermaid(websocket: WebSocket):
if _stt_available:
from whisperlivekit import AudioProcessor

await websocket.accept()

llm_mode: str = "ollama"
Expand Down Expand Up @@ -456,6 +453,7 @@ async def _consume_results(results_generator, line_count_ref: list[int]) -> None
line_count_ref = [0]

if _stt_available:
from whisperlivekit import AudioProcessor
audio_processor = AudioProcessor(transcription_engine=_transcription_engine)
results_generator = await audio_processor.create_tasks()
results_task = asyncio.create_task(_consume_results(results_generator, line_count_ref))
Expand Down
Loading