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 / evidence / qwen38-serve-fast-20261019 / decode_runs.sh
| 1 | #!/bin/bash |
| 2 | # decode_runs.sh <base-url> <server-log> <out-dir> <tag> <n>: n greedy 256-token decodes of the serve |
| 3 | # agent's short prompt (qwen38_serve_speed.sh SHORT), token ids kept, figures from the server's log line. |
| 4 | set -uo pipefail |
| 5 | URL=$1; LOG=$2; OUT=$3; TAG=$4; N=$5 |
| 6 | mkdir -p "$OUT" |
| 7 | SHORT='[{"role":"user","content":"Write a detailed essay about the history of lighthouses, from ancient times to today."}]' |
| 8 | for i in $(seq 1 "$N"); do |
| 9 | f="$OUT/$TAG-$i" |
| 10 | jq -n --argjson m "$SHORT" '{messages:$m, temperature:0, max_tokens:256, chat_template_kwargs:{enable_thinking:false}, aien_return_token_ids:true}' > "$f.req.json" |
| 11 | for try in $(seq 1 240); do |
| 12 | w=$(curl -s -m 1800 -o "$f.json" -w '%{time_total}' "$URL/v1/chat/completions" -H 'Content-Type: application/json' -d @"$f.req.json") |
| 13 | jq -e '.error | tostring | test("busy"; "i")' "$f.json" >/dev/null 2>&1 || break |
| 14 | sleep 1 |
| 15 | done |
| 16 | id=$(jq -r '.id' "$f.json") |
| 17 | line=$(grep -B1 "$id:" "$LOG" | grep 'qwen38:' | head -1 | sed 's/aien-serve-http: qwen38: //') |
| 18 | printf '%s\t%s\tclient_wall_s=%s\tcompletion=%s\tids_sha=%s\t%s\n' "$(date -u +%FT%TZ)" "$TAG-$i" "$w" \ |
| 19 | "$(jq '.usage.completion_tokens' "$f.json")" "$(jq -c '.usage.aien_token_ids' "$f.json" | sha256sum | cut -c1-12)" "$line" | tee -a "$OUT/runs.tsv" |
| 20 | done |