interplane.Get Omega
Read in your language

aien-train

AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.

Brought by drakestapleton

branch main Branches Tags History

aien-train / tests / omegallm / serve-allen.sh

43 lines · 2309 bytes Raw Blame History
1#!/bin/sh
2# Throwaway allen-chat (read-only /opt/allen-chat code) pointed at ollm serve on a spare port.
3# ollm on 127.0.0.1:18292, allen-chat on 127.0.0.1:18293. Stops only the PIDs it started.
4set -u
5S=/dev/shm/hive/OwnModelCoord
6OUT=${OUT:-$S/ac}
7OLLM=${OLLM:-$S/final-aarch64/ollm}
8CK=${CK:-/tmp/gk/r10/run/ck60000.bin}
9MERGES=${MERGES:-$HOME/handoffs/omega-llm-20261101/v1-data/merges4096.bin}
10WARM=${WARM:-0}
11mkdir -p "$OUT"
12for p in 18292 18293; do
13 if [ -n "$(ss -Hltn "sport = :$p")" ]; then echo "PORT_BUSY $p"; exit 3; fi
14done
15printf 'You are Allen.\n' > "$OUT/system.txt"
16BW="bwrap --dev-bind / / --dev /dev --bind /dev/shm /dev/shm --proc /proc --"
17taskset -c 8-9 nice -n 10 $BW "$OLLM" serve 18292 "$CK" "$MERGES" > "$OUT/ollm.log" 2>&1 &
18L1=$!
19i=0; while [ $i -lt 100 ] && ! grep -q '^PORT 18292' "$OUT/ollm.log"; do sleep 0.2; i=$((i+1)); done
20taskset -c 8-9 nice -n 10 $BW /usr/bin/python3 -I /opt/allen-chat/allen_chat.py \
21 --listen 127.0.0.1:18293 --upstream 127.0.0.1:18292 --system-prompt "$OUT/system.txt" \
22 --omc /opt/allen-chat/omc --irwasm /opt/allen-chat/irwasm --max-tokens 8 --temperature 0 \
23 --warm-every "$WARM" --regen-per-hour 0 --stats-every 3600 \
24 --open-user "Hi." --open-user-anon "Hello." --greeting-remember "Hi." --greeting-anon "Hello." \
25 > "$OUT/allen.log" 2>&1 &
26L2=$!
27i=0; while [ $i -lt 100 ] && ! grep -q 'allen-chat listening' "$OUT/allen.log"; do sleep 0.2; i=$((i+1)); done
28sleep "${SETTLE:-1}"
29for q in "What is Omega?" "Tell me a story."; do
30 echo "== POST /allen/api/chat: $q"
31 curl -sS -m 120 -H 'Content-Type: application/json' \
32 -d "{\"messages\":[{\"role\":\"user\",\"content\":\"$q\"}]}" http://127.0.0.1:18293/allen/api/chat
33 echo "== curl rc=$?"
34done > "$OUT/chat.txt" 2>&1
35sleep 1
36P1=$(ss -Hltnp 'sport = :18292' | sed -n 's/.*pid=\([0-9]*\).*/\1/p' | head -1)
37P2=$(ss -Hltnp 'sport = :18293' | sed -n 's/.*pid=\([0-9]*\).*/\1/p' | head -1)
38echo "launchers $L1 $L2 servers ${P1:-none} ${P2:-none}" > "$OUT/pids.txt"
39for p in $P1 $P2 $L1 $L2; do kill "$p" 2>/dev/null; done
40wait 2>/dev/null
41sleep 1
42echo "after: $(ss -Hltn 'sport = :18292' | wc -l) $(ss -Hltn 'sport = :18293' | wc -l)" >> "$OUT/pids.txt"
43cat "$OUT/chat.txt"; echo "--- ollm.log"; cat "$OUT/ollm.log"; echo "--- allen.log"; cat "$OUT/allen.log"; cat "$OUT/pids.txt"