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 / tools / omegallm-ui / start-aienux.command

64 lines · 2802 bytes Raw Blame History
1#!/bin/zsh
2set -eu
3export PATH=/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin
4root="$HOME/Applications/Omega/Aienux"
5runtime="$HOME/workspace/aien-train-macbook/local-mac"
6qwen="$HOME/workspace/ggml-omega-macbook"
7uid=$(id -u)
8running=0
9if [[ -f "$root/qemu.pid" ]]; then
10 pid=$(cat "$root/qemu.pid")
11 command=$(ps -p "$pid" -o command= 2>/dev/null || true)
12 if [[ "$command" == *qemu-system-x86_64* && "$command" == *"$root/model.img"* ]]; then running=1; fi
13fi
14if (( ! running )); then
15 (cd "$root" && shasum -a 256 -c SHA256SUMS)
16 : > "$root/boot.log"
17 vm_label=dev.aien.omega-aienux-vm
18 if ! launchctl print "gui/$uid/$vm_label" >/dev/null 2>&1; then
19 launchctl bootstrap "gui/$uid" "$HOME/Library/LaunchAgents/$vm_label.plist"
20 fi
21 launchctl kickstart "gui/$uid/$vm_label"
22 vm_pid=$(launchctl print "gui/$uid/$vm_label" | awk '/pid =/{print $3; exit}')
23 [[ -n "$vm_pid" ]] || { print 'Aienux VM did not start.'; exit 1; }
24 print "$vm_pid" > "$root/qemu.pid"
25 sleep 1
26 nohup /usr/bin/nc -d -U "$root/serial.sock" >> "$root/boot.log" 2>&1 < /dev/null &
27 reader=$!
28 disown
29 print 'Aienux is loading Astra’s model. This uses emulation and can take several minutes.'
30 ready=0
31 for attempt in {1..600}; do
32 if grep -q '^LMREADY' "$root/boot.log"; then ready=1; break; fi
33 if ! kill -0 "$vm_pid" 2>/dev/null; then break; fi
34 sleep 1
35 done
36 kill "$reader" 2>/dev/null || true
37 if (( ! ready )); then
38 kill "$vm_pid" 2>/dev/null || true
39 print 'Aienux did not load. The boot log is in Applications/Omega/Aienux.'
40 exit 1
41 fi
42 # The model is ready; avoid firmware polling consuming a core while the browser opens.
43 print 'stop' | /usr/bin/nc -U -w 1 "$root/monitor.sock" >/dev/null || true
44fi
45if ! curl -fsS http://127.0.0.1:8097/health >/dev/null; then
46 (cd "$qwen" && export GGML_BACKEND_PATH="$qwen/build-mac/prepared/libggml-omega.dylib" OMEGA_GGML_DEVICES=host && exec nohup "$qwen/build-mac/runtime/llama-b11913/llama-server" -m build-mac/qwen.gguf --device Omega -ngl 0 -fa off -c 2048 -b 64 -ub 64 -t 2 --parallel 1 --host 127.0.0.1 --port 8097 --fit off) >"$runtime/qwen-ui.log" 2>&1 </dev/null &
47 disown
48fi
49label=dev.aien.omega-aienux-ui
50if ! launchctl print "gui/$uid/$label" >/dev/null 2>&1; then
51 launchctl bootstrap "gui/$uid" "$HOME/Library/LaunchAgents/$label.plist"
52fi
53launchctl kickstart "gui/$uid/$label"
54for attempt in {1..30}; do
55 if curl -fsS http://127.0.0.1:8099/props >/dev/null; then
56 open http://127.0.0.1:8099
57 print 'Choose Omega-Astra-Aienux. Enter one short story beginning. Each reply is limited to eight tokens.'
58 print 'This experimental firmware path is slow. After pressing Stop, reopen this launcher to restart Aienux.'
59 exit 0
60 fi
61 sleep 1
62done
63print 'The Aienux browser adapter did not start.'
64exit 1