linux-zero/scripts/setup-agents.sh
Cem Varli aad0d13be7 Rebranding zu Linux Zero, Kato als Haupt-Agent der AGI-Station
- Projektname: Linux Zero (LX0), Chat-Komponente heisst jetzt AGI-Station
- Neuer Haupt-Agent Kato (Cato der Aeltere) als Default-Modell in Open WebUI
- scripts/set-main-agent.sh: Haupt-Agent per Befehl wechselbar (MAIN_AGENT in .env)
- ENABLE_PERSISTENT_CONFIG=False: Konfiguration deterministisch aus .env
- Alle Pfade, Shortcuts, Logs, Theme und README umbenannt (lx0-*, ~/.linux-zero)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-10 17:42:50 +02:00

46 lines
1.6 KiB
Bash
Executable file

#!/usr/bin/env bash
# Lädt das Standardmodell und erstellt Kato & die Berater (Ollama) sowie Beispiel-Workflows (n8n).
set -euo pipefail
log() { printf '\033[1;33m[LX0]\033[0m %s\n' "$*"; }
warn() { printf '\033[1;33m[HINWEIS]\033[0m %s\n' "$*"; }
fail() { printf '\033[1;31m[FEHLER]\033[0m %s\n' "$*"; exit 1; }
# shellcheck disable=SC1091
. ./.env
model="${DEFAULT_MODEL:-gemma3:4b}"
dc() { sudo docker compose "$@"; }
log "Warte auf Ollama ..."
ready=0
for _ in $(seq 1 60); do
if dc exec -T ollama ollama list >/dev/null 2>&1; then ready=1; break; fi
sleep 2
done
[ "$ready" = "1" ] || fail "Ollama wurde nicht rechtzeitig bereit — 'sudo docker compose logs ollama' zeigt Details."
log "Lade Sprachmodell $model (beim ersten Mal dauert das einige Minuten) ..."
dc exec -T ollama ollama pull "$model"
for mf in agents/modelfiles/*.Modelfile; do
[ -e "$mf" ] || continue
name="$(basename "$mf" .Modelfile | tr '[:upper:]' '[:lower:]')"
log "Erstelle Agent: $name"
tmp="$(mktemp)"
sed "s|{{MODEL}}|$model|g" "$mf" > "$tmp"
dc cp "$tmp" ollama:/tmp/lx0.Modelfile
dc exec -T ollama ollama create "$name" -f /tmp/lx0.Modelfile
rm -f "$tmp"
done
for wf in agents/n8n/*.json; do
[ -e "$wf" ] || continue
if dc exec -T n8n n8n import:workflow --input="/workflows/$(basename "$wf")" >/dev/null 2>&1; then
log "n8n-Workflow importiert: $(basename "$wf")"
else
warn "n8n-Workflow $(basename "$wf") konnte nicht automatisch importiert werden — in n8n unter 'Import from File' nachholbar."
fi
done
log "Agenten bereit: kato (Haupt-Agent), seneca, cicero, marcus"