Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-train/blob/main/tests/omegallm/serve-allen.sh # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers 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. 4 set -u 5 S=/dev/shm/hive/OwnModelCoord 6 OUT=${OUT:-$S/ac} 7 OLLM=${OLLM:-$S/final-aarch64/ollm} 8 CK=${CK:-/tmp/gk/r10/run/ck60000.bin} 9 MERGES=${MERGES:-$HOME/handoffs/omega-llm-`20261101`/v1-data/merges4096.bin} 10 WARM=${WARM:-0} 11 mkdir -p "$OUT" 12 for p in 18292 18293; do 13 if [ -n "$(ss -Hltn "sport = :$p")" ]; then echo "PORT_BUSY $p"; exit 3; fi 14 done 15 printf 'You are Allen.\n' > "$OUT/system.txt" 16 BW="bwrap --dev-bind / / --dev /dev --bind /dev/shm /dev/shm --proc /proc --" 17 taskset -c 8-9 nice -n 10 $BW "$OLLM" serve 18292 "$CK" "$MERGES" > "$OUT/ollm.log" 2>&1 & 18 L1=$! 19 i=0; while [ $i -lt 100 ] && ! grep -q '^PORT 18292' "$OUT/ollm.log"; do sleep 0.2; i=$((i+1)); done 20 taskset -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 & 26 L2=$! 27 i=0; while [ $i -lt 100 ] && ! grep -q 'allen-chat listening' "$OUT/allen.log"; do sleep 0.2; i=$((i+1)); done 28 sleep "${SETTLE:-1}" 29 for 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=$?" 34 done > "$OUT/chat.txt" 2>&1 35 sleep 1 36 P1=$(ss -Hltnp 'sport = :18292' | sed -n 's/.*pid=\([0-9]*\).*/\1/p' | head -1) 37 P2=$(ss -Hltnp 'sport = :18293' | sed -n 's/.*pid=\([0-9]*\).*/\1/p' | head -1) 38 echo "launchers $L1 $L2 servers ${P1:-none} ${P2:-none}" > "$OUT/pids.txt" 39 for p in $P1 $P2 $L1 $L2; do kill "$p" 2>/dev/null; done 40 wait 2>/dev/null 41 sleep 1 42 echo "after: $(ss -Hltn 'sport = :18292' | wc -l) $(ss -Hltn 'sport = :18293' | wc -l)" >> "$OUT/pids.txt" 43 cat "$OUT/chat.txt"; echo "--- ollm.log"; cat "$OUT/ollm.log"; echo "--- allen.log"; cat "$OUT/allen.log"; cat "$OUT/pids.txt"