ai-stack: vendor the local-ai full AI stack as a new service

Vendor the functional source of github.com/outis1one/local-ai into
./ai-stack (22 files) and add services/ai-stack.sh, which copies the
source to ~/docker/ai-stack and hands off to the app's VRAM-aware
installer (local-ai-setup.sh). The stack bundles Ollama, Open WebUI,
RAG + MCP servers, ChromaDB, SearXNG, Kiwix, Gitea, InvokeAI, ComfyUI
and Portainer.

Cloud LLM providers (Groq/DeepInfra/OpenAI/OpenRouter) are optionally
wired into Open WebUI via the plural OPENAI_API_BASE_URLS list, with the
local RAG connection kept as the first entry so RAG keeps working. Open
WebUI ships built-in auth, so Caddy is configured without Authelia.

Excludes the upstream's two bundled copies of this very project
(ubuntu-post-install.sh, ubuntu-post-install-main.zip) — stale and
circular. Coexists with the existing ai-gpu service.

Also fix the install-function names for ai-gpu and ai-stack: the
dispatcher calls install_<raw-name>, so the function must be
install_ai-gpu / install_ai-stack (hyphen), matching the working
mail-archiver / wg-easy services. ai-gpu was previously uninstallable.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nb2vJ8W7bHKx1JXVvpCraH
This commit is contained in:
Claude
2026-06-26 12:41:44 +00:00
parent 084922afaa
commit c6576178b4
25 changed files with 7524 additions and 3 deletions
+33
View File
@@ -0,0 +1,33 @@
#!/bin/bash
# Install all local-ai systemd user units and enable timers
set -e
UNIT_DIR="$HOME/.config/systemd/user"
SRC="$(cd "$(dirname "$0")" && pwd)"
mkdir -p "$UNIT_DIR"
for unit in "$SRC"/*.service "$SRC"/*.timer; do
name=$(basename "$unit")
ln -sf "$unit" "$UNIT_DIR/$name"
echo "Linked $name"
done
systemctl --user daemon-reload
for timer in "$SRC"/*.timer; do
name=$(basename "$timer")
systemctl --user enable --now "$name"
echo "Enabled $name"
done
echo ""
systemctl --user list-timers kiwix-update.timer ollama-update.timer
echo ""
echo "Run manually:"
echo " systemctl --user start kiwix-update.service"
echo " systemctl --user start ollama-update.service"
echo ""
echo "Logs:"
echo " journalctl --user -u kiwix-update.service -f"
echo " journalctl --user -u ollama-update.service -f"
+10
View File
@@ -0,0 +1,10 @@
[Unit]
Description=Kiwix ZIM auto-updater
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/bin/bash %h/local-ai/kiwix_update.sh
StandardOutput=journal
StandardError=journal
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=Monthly Kiwix ZIM update check
Requires=kiwix-update.service
[Timer]
OnCalendar=monthly
RandomizedDelaySec=1h
Persistent=true
[Install]
WantedBy=timers.target
+10
View File
@@ -0,0 +1,10 @@
[Unit]
Description=Ollama model auto-updater
After=network-online.target
Wants=network-online.target
[Service]
Type=oneshot
ExecStart=/bin/bash %h/local-ai/ollama_update.sh
StandardOutput=journal
StandardError=journal
+11
View File
@@ -0,0 +1,11 @@
[Unit]
Description=Monthly Ollama model update check
Requires=ollama-update.service
[Timer]
OnCalendar=monthly
RandomizedDelaySec=2h
Persistent=true
[Install]
WantedBy=timers.target