From ac76ef5181f93e1e1cd98b6b5fc9d19964734faa Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 21 Aug 2026 03:09:07 +0000 Subject: [PATCH] ai-stack: offer an optional vision-capable Ollama model, including moondream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit None of local-ai-setup.sh's tier-selected models (CHAT_MODEL/CODE_MODEL/ EMBED_MODEL) can read an image — there was no way to get vision support out of this stack at all before now. Added a numbered pick-list to the generated pull-models.sh, right after the existing DeepSeek-R1 optional pull, matching that same read -rp pattern: 1) moondream ~1.7 GB by Moondream AI — tiny, built for CPU-only or weak/old-GPU hardware 2) llava:7b ~4.7 GB general-purpose vision 3) qwen2.5vl:7b ~6 GB stronger accuracy, more RAM/VRAM 4) llama3.2-vision:11b ~7.9 GB heaviest of the four moondream is the recommended default — sized for exactly the "6 vCPU, 8GB RAM, no GPU" case this was asked for, unlike the other three which assume real GPU/RAM headroom. Verified by actually running the heredoc that generates pull-models.sh (with EMBED_MODEL/CHAT_MODEL/CODE_MODEL stood in) and syntax-checking the resulting output script, not just the source — the outer heredoc is unquoted so $-escaping mistakes wouldn't show up as a bash -n failure on local-ai-setup.sh itself, only on what it generates. services/ai-stack.md gets a matching "Vision models" section (sizes, the manual pull command, and how to point an app's OPENAI_MODEL at one). laptop_full_setup.sh's separate, non-interactive pull-models.sh generator is untouched — it's not invoked anywhere in this repo's own install flow (only local-ai-setup.sh is, from install_ai-stack()), so it's out of scope here. --- services/ai-stack.md | 20 ++++++++++++++++++++ services/ai-stack.sh | 1 + vendor/ai-stack/local-ai-setup.sh | 21 +++++++++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/services/ai-stack.md b/services/ai-stack.md index 913d728..063b136 100644 --- a/services/ai-stack.md +++ b/services/ai-stack.md @@ -39,6 +39,26 @@ bash pull-models.sh # pull Ollama models (run once after first install) ``` Also a systemd unit: `sudo systemctl {start,stop,status} local-ai` +## Vision models (image understanding) +None of the tier-selected chat/code models above can read an image. `pull-models.sh` +offers one optional vision model at the end — pick it there, or pull one manually +any time: +```bash +docker exec ollama ollama pull moondream # or llava:7b / qwen2.5vl:7b / llama3.2-vision:11b +``` +| Model | Size | Notes | +|-------|------|-------| +| `moondream` | ~1.7 GB | By Moondream AI — tiny, built for CPU-only or weak/old-GPU hardware. Best default if you don't have a real GPU. | +| `llava:7b` | ~4.7 GB | General-purpose vision, moderate resources. | +| `qwen2.5vl:7b` | ~6 GB | Stronger accuracy, needs more RAM/VRAM. | +| `llama3.2-vision:11b` | ~7.9 GB | Meta's vision model — heaviest of these four. | + +Point any OpenAI-compatible app's vision/image-import feature (e.g. Mealie's +"import recipe from photo") at this stack's Ollama endpoint with the pulled +model as `OPENAI_MODEL` — see Open WebUI → Settings → Connections for the +exact local base URL, or `docker inspect ollama` for the container's address +on `caddy_net`/the compose network. + ## Cloud LLM providers (Open WebUI) Open WebUI uses an OpenAI-compatible connection list. The local RAG server is the first entry; any cloud providers added at install follow it. Two semicolon-separated diff --git a/services/ai-stack.sh b/services/ai-stack.sh index 5325b20..7c49bbd 100644 --- a/services/ai-stack.sh +++ b/services/ai-stack.sh @@ -34,6 +34,7 @@ install_ai-stack() { echo "[DRY-RUN] Would copy vendored source $SRC_DIR -> $AS_DIR" echo "[DRY-RUN] Would optionally collect cloud LLM provider keys (Groq/DeepInfra/OpenAI/OpenRouter)" echo "[DRY-RUN] Would run the app installer local-ai-setup.sh (Docker/NVIDIA toolkit, VRAM-aware models, generates compose/.env, starts stack, registers systemd 'local-ai')" + echo "[DRY-RUN] Would offer an optional vision-capable model to pull (moondream/llava/qwen2.5vl/llama3.2-vision) via the generated pull-models.sh" echo "[DRY-RUN] Would wire cloud providers into Open WebUI (OPENAI_API_BASE_URLS) preserving the local RAG connection" echo "[DRY-RUN] Would write gpu-mode.sh and optionally enable the GPU switcher (one small GPU shared by Ollama and InvokeAI/ComfyUI)" echo "[DRY-RUN] Would attach Open WebUI to caddy_net and configure Caddy (open-webui:8080, host port 3000)" diff --git a/vendor/ai-stack/local-ai-setup.sh b/vendor/ai-stack/local-ai-setup.sh index 5e6fc84..996867f 100755 --- a/vendor/ai-stack/local-ai-setup.sh +++ b/vendor/ai-stack/local-ai-setup.sh @@ -860,6 +860,27 @@ echo "Reasoning model (DeepSeek-R1 14B — optional)..." read -rp "Pull DeepSeek-R1:14b for planning/reasoning? [y/N]: " DR [[ "\${DR,,}" == "y" ]] && docker exec ollama ollama pull deepseek-r1:14b +echo "" +echo "Vision model (optional — image understanding: Mealie's \"import recipe from" +echo "photo\", attaching images in Open WebUI chat, etc.). None of the models" +echo "above can read an image; pick one of these if you need that:" +echo " 1) moondream ~1.7 GB Moondream AI — tiny, built for CPU-only/" +echo " weak or old GPU hardware. Recommended" +echo " default if you have no GPU or a low-VRAM one." +echo " 2) llava:7b ~4.7 GB General-purpose vision, moderate resources." +echo " 3) qwen2.5vl:7b ~6 GB Stronger accuracy, needs more RAM/VRAM." +echo " 4) llama3.2-vision:11b ~7.9 GB Meta's vision model — heaviest of these four." +read -rp "Pull a vision model? [1-4, blank to skip]: " VM +case "\$VM" in + 1) docker exec ollama ollama pull moondream ;; + 2) docker exec ollama ollama pull llava:7b ;; + 3) docker exec ollama ollama pull qwen2.5vl:7b ;; + 4) docker exec ollama ollama pull llama3.2-vision:11b ;; + "") : ;; + *) echo "Unrecognized choice '\$VM' — skipping. Pull manually later with:" + echo " docker exec ollama ollama pull " ;; +esac + echo "" && docker exec ollama ollama list PULLSH chmod +x "$BASE/pull-models.sh"