#!/bin/bash
set -uo pipefail
ROOT=/home/lab/bench/ornith/modular/sglang
PROFILE=${1:?profile required}
for ((i=0;i<450;i++)); do
  if curl --fail --silent --max-time 2 http://127.0.0.1:8130/health >/dev/null; then break; fi
  sleep 2
done
curl --fail --silent --max-time 3 http://127.0.0.1:8130/health >/dev/null || exit 1
python3 /home/lab/bench/ornith/modular/shared/quality.py --base http://127.0.0.1:8130/v1 --model ornith-sglang --out "$ROOT/results/quality-$PROFILE.json"
CUDA_VISIBLE_DEVICES= /home/lab/venvs/sglang/bin/python /home/lab/bench/ornith/modular/shared/bench.py --base http://127.0.0.1:8130/v1 --model ornith-sglang --out "$ROOT/results/$PROFILE-4k" --lengths 4096 --concurrency 1,3 --repeats 1 --gpu GPU-f4a988cb-c310-b618-5a9c-4462d4d33add
