File size: 398 Bytes
9b2f1cf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/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