- Verwaltungs-API unter /omega/api mit Sitzungen (nicht API-Keys); alle Abläufe der Kommandozeile liegen jetzt in einer gemeinsamen Dienstschicht (service.rs) mit Fehlerarten für 400/403/404 - Dashboards: Proben der Auslastung je Rechner, systemweite Zähler je Stunde (öffentlich, ohne Personenbezug), persönliches Dashboard je Rolle - Modelllisten und /api/show zeigen nur, was der Key gerade nutzen darf (Kontingent, Modellzeitfenster, exklusive Nutzung); Super-Keys alles - Engines: empfohlene Werte je Rechner (omega-proxy engines), Prüfung von llama-server über /props, Korrektur befristet geladener Ollama-Modelle, Ereignisse bei eigenmächtigem Entladen - tests/multispark/api_test.py Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
41 lines
1.7 KiB
Bash
Executable File
41 lines
1.7 KiB
Bash
Executable File
#!/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.
|
|
set -e
|
|
cd "$(dirname "$0")"
|
|
B=../../target/debug
|
|
mkdir -p run/logs1 run/logs2 run/gguf
|
|
rm -f run/test.db* run/pids
|
|
|
|
# llama-server bekommt dieselben GGUF-Dateien wie Ollama
|
|
python3 -I - <<EOF
|
|
import json, os
|
|
home = os.path.expanduser("~/.ollama/models")
|
|
for name, out in [("smollm2/135m", "smollm2-135m"), ("qwen3/0.6b", "qwen3-0.6b")]:
|
|
man = json.load(open(f"{home}/manifests/registry.ollama.ai/library/{name}"))
|
|
digest = [l["digest"] for l in man["layers"] if l["mediaType"].endswith("model")][0].replace(":", "-")
|
|
dst = f"run/gguf/{out}.gguf"
|
|
if os.path.lexists(dst):
|
|
os.remove(dst)
|
|
os.symlink(f"{home}/blobs/{digest}", dst)
|
|
EOF
|
|
|
|
for i in 1 2 3; do
|
|
# spark3 absichtlich ohne OLLAMA_KEEP_ALIVE: der Proxy soll das erkennen und korrigieren
|
|
if [ $i = 3 ]; then KEEP=""; else KEEP="-1"; fi
|
|
OLLAMA_HOST=127.0.0.1:1144$i OLLAMA_KEEP_ALIVE=$KEEP OLLAMA_MAX_LOADED_MODELS=4 nohup ollama serve > 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
|
|
sleep 3
|
|
$B/omega-proxy -c proxy.toml --as admin key create test | awk '{print $NF}' > run/key.txt
|
|
$B/omega-proxy -c proxy.toml serve > run/proxy.log 2>&1 &
|
|
echo "proxy $!" >> run/pids
|
|
sleep 2
|
|
echo "gestartet: $(tr '\n' ' ' < run/pids)"
|