From 3babac58699110dcf385cf23c5b24470f404e9f4 Mon Sep 17 00:00:00 2001 From: jaewilson07 Date: Fri, 24 Apr 2026 08:31:44 -0600 Subject: [PATCH] refactor(voice-to-mermaid): remove vtm-ollama sidecar, default to qwen3:8b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consolidates on Windows-native Ollama via host.docker.internal:11434: - Remove vtm-ollama sidecar container + ollama-data volume (was vestigial — api was already pointing at host.docker.internal by default) - Update default_model from gemma4:31b (did not exist) to qwen3:8b - Update model_filter to match models actually installed on Windows Ollama Part of the 2026-04-24 reproducible-infra consolidation — full context at simpleDiscordBot/.agents/plans/2026-04-24_reproducible-infra-consolidation/ Co-Authored-By: Claude Opus 4.7 (1M context) --- voice-to-mermaid/backend/config.yaml | 17 +++++--- voice-to-mermaid/backend/docker-compose.yml | 43 ++++++++++----------- 2 files changed, 33 insertions(+), 27 deletions(-) diff --git a/voice-to-mermaid/backend/config.yaml b/voice-to-mermaid/backend/config.yaml index 936fb6d..e58a2fb 100644 --- a/voice-to-mermaid/backend/config.yaml +++ b/voice-to-mermaid/backend/config.yaml @@ -4,15 +4,22 @@ # Secrets (OLLAMA_URL, OPENAI_API_KEY, etc.) stay in .env / Infisical. ollama: + # Default model for first-diagram generation. qwen3:8b is chosen for: + # - Fast first-token latency (important for "type and see diagram" UX) + # - Good instruction-following on mermaid grammar + # - Fits in 8-12 GB VRAM (cold-load ~5s, then streams) + # Swap to a 32B class model (qwen2.5-coder:32b, qwen3.5:27b) for complex + # multi-node diagrams at the cost of ~20s cold-load latency. default_model: "qwen3:8b" - # Models shown in the UI picker — exact names or prefixes (e.g. "qwen2.5:"). - # Leave empty to show all installed models. + # Models shown in the UI picker. Must exist in Windows Ollama + # (C:\Users\jaewi\.ollama is not used — see OLLAMA_MODELS=D:\ollama\models). + # Update as needed with: ollama pull (run in Windows PowerShell) model_filter: + - "qwen3:8b" - "qwen2.5:14b" + - "qwen2.5-coder:32b" - "qwen3.5:27b" - - "qwen3:8b" - - "qwen3:14b" - - "llama3.2:3b" + - "gemma3:12b" openai: model: "gpt-4o-mini" diff --git a/voice-to-mermaid/backend/docker-compose.yml b/voice-to-mermaid/backend/docker-compose.yml index d1601d7..7fe68da 100644 --- a/voice-to-mermaid/backend/docker-compose.yml +++ b/voice-to-mermaid/backend/docker-compose.yml @@ -1,21 +1,18 @@ -services: - ollama: - image: ollama/ollama:latest - container_name: vtm-ollama - restart: unless-stopped - ports: - - "11434:11434" - volumes: - - ollama-data:/root/.ollama - # GPU support — remove 'deploy' block if no GPU available - deploy: - resources: - reservations: - devices: - - driver: nvidia - count: 1 - capabilities: [gpu] +# Voice-to-Mermaid — LOCAL MACHINE ONLY (requires GPU) +# ⚠️ GPU GUARD: This compose file requires NVIDIA GPU hardware. +# ⚠️ DO NOT deploy to the VPS (187.77.216.108) — it has no GPU. +# ⚠️ See infrastructure/local/README.md for local machine service registry. +# +# Architecture (as of 2026-04-24): +# vtm-api → http://host.docker.internal:11434 → Windows-native Ollama +# +# The previous `vtm-ollama` sidecar + `ollama-data` volume were removed — +# they duplicated the Windows Ollama instance (ran empty, wasted resources). +# See .agents/runbooks/troubleshoot-ollama/SKILL.md for the single-instance +# architecture rules. +# +services: api: build: . container_name: vtm-api @@ -24,14 +21,16 @@ services: - "${PORT:-7625}:7625" env_file: .env environment: - # 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} + # Windows-native Ollama via Docker Desktop gateway. + OLLAMA_URL: ${OLLAMA_URL:-http://host.docker.internal:11434} extra_hosts: - "host.docker.internal:host-gateway" volumes: - ./prompts:/app/prompts # mount prompts so edits don't need rebuild - ./config.yaml:/app/config.yaml # mount config so edits don't need rebuild + networks: + - local-ai -volumes: - ollama-data: +networks: + local-ai: + name: local-ai