aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / scripts / own30b-serve-restart.sh
| 1 | #!/usr/bin/env bash |
| 2 | # SPDX-License-Identifier: Apache-2.0 |
| 3 | # Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | # (Re)start the OWN-30B Omega server in the background (OWN-30B cut 8; default binary: the cut 10 build with the device router and bf16 lm_head GEMV, |
| 18 | # on top of the fused one-launch attention and batched prefill). |
| 19 | # scripts/own30b-serve-restart.sh [binary] |
| 20 | # Stops the previous server only if /tmp/own30b-serve.pid names a live aien-serve-http, |
| 21 | # then starts a fresh one detached: log /tmp/own30b-serve.log, PID /tmp/own30b-serve.pid. |
| 22 | # The server loads FP8-all weights (about 18 s, 30.5 GB resident), serves 127.0.0.1:18091, |
| 23 | # and takes /tmp/aien-gb10.lock only while loading and around each generation. |
| 24 | set -euo pipefail |
| 25 | BIN=${1:-/tmp/own30b-f/target-router/release/aien-serve-http} |
| 26 | MODEL=${OWN30B_MODEL_DIR:-$HOME/models/qwen3-30b-a3b-instruct-2507-fp8} |
| 27 | PIDF=/tmp/own30b-serve.pid LOG=/tmp/own30b-serve.log |
| 28 | : "${AIEN_SERVE_HTTP_BEARER_TOKEN:?AIEN_SERVE_HTTP_BEARER_TOKEN required before restart}" |
| 29 | if [ -f "$PIDF" ]; then |
| 30 | old=$(cat "$PIDF") |
| 31 | if [ -n "$old" ] && [ "$(ps -o comm= -p "$old" 2>/dev/null || true)" = aien-serve-http ]; then |
| 32 | kill "$old" |
| 33 | for _ in $(seq 1 100); do kill -0 "$old" 2>/dev/null || break; sleep 0.1; done |
| 34 | fi |
| 35 | fi |
| 36 | # sh writes its own PID then exec's the server, so the file is right whether or not setsid forks. |
| 37 | setsid sh -c "echo \$\$ > $PIDF; exec '$BIN' --engine omega --model-dir '$MODEL' --port 18091" > "$LOG" 2>&1 < /dev/null & |
| 38 | for _ in $(seq 1 120); do |
| 39 | grep -q "serving\|load failed\|error" "$LOG" 2>/dev/null && break |
| 40 | sleep 1 |
| 41 | done |
| 42 | tail -2 "$LOG" |
| 43 | echo "pid $(cat $PIDF) ($(ps -o comm= -p "$(cat $PIDF)" 2>/dev/null || echo not-running))" |