grok-record / harness /scripts /wait_api.sh
simonycl's picture
Upload folder using huggingface_hub
9b2f1cf verified
Raw
History Blame Contribute Delete
398 Bytes
#!/usr/bin/env bash
# Wait until the vLLM engine OpenAI API is up (PORT+100, not the hung router).
set -euo pipefail
OFFSET="${AGENTPTB_PORT_OFFSET:-500}"
PORT=$((8000 + OFFSET + 100))
URL="http://127.0.0.1:${PORT}/v1/models"
for i in $(seq 1 60); do
if curl -sf --max-time 2 "$URL" >/dev/null; then
echo "ready $URL"
exit 0
fi
sleep 5
done
echo "timeout waiting for $URL" >&2
exit 1