#!/bin/bash # Startet drei simulierte Sparks (je eine Ollama-Instanz, dazu llama-server und Agenten) und den Proxy. # Voraussetzung: ollama und llama-server installiert, Modelle smollm2:135m und qwen3:0.6b in Ollama. # Mit --demo gelten für Aufzeichnungen realistische Fristen statt der kurzen für die Tests. set -e cd "$(dirname "$0")" B=../../target/debug mkdir -p run/logs1 run/logs2 run/gguf rm -f run/test.db* run/pids CONFIG=proxy.toml if [ "$1" = "--demo" ]; then sed -e 's/^max_duration_secs = .*/max_duration_secs = 86400/' -e 's/^ready_secs = .*/ready_secs = 3600/' proxy.toml > run/demo.toml CONFIG=run/demo.toml fi # llama-server bekommt dieselben GGUF-Dateien wie Ollama python3 -I - < run/ollama$i.log 2>&1 & echo "ollama$i $!" >> run/pids done llama-server --models-dir run/gguf --no-models-autoload --models-max 4 --port 8181 > run/llama.log 2>&1 & echo "llama $!" >> run/pids $B/omega-agent -c agent1.toml > run/agent1.log 2>&1 & echo "agent1 $!" >> run/pids $B/omega-agent -c agent2.toml > run/agent2.log 2>&1 & echo "agent2 $!" >> run/pids # Warten, bis die Engines antworten (höchstens 30 s), statt fest zu schlafen for url in http://127.0.0.1:11441/api/version http://127.0.0.1:11442/api/version http://127.0.0.1:11443/api/version http://127.0.0.1:8181/models; do for _ in $(seq 60); do curl -sf -o /dev/null "$url" && break; sleep 0.5; done done $B/omega-proxy -c proxy.toml --as admin key create test | awk '{print $NF}' > run/key.txt $B/omega-proxy -c $CONFIG serve > run/proxy.log 2>&1 & echo "proxy $!" >> run/pids sleep 2 echo "gestartet: $(tr '\n' ' ' < run/pids)"