#!/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