| #!/bin/bash |
| |
| |
|
|
| set -e |
|
|
| echo "===== Starting Warp2API Services =====" |
|
|
| |
| export HOST=0.0.0.0 |
| export WARP_SERVER_PORT=7861 |
| export OPENAI_COMPAT_PORT=7860 |
|
|
| |
| echo "Starting Bridge Server on port $WARP_SERVER_PORT..." |
| python server.py --port $WARP_SERVER_PORT & |
| BRIDGE_PID=$! |
|
|
| |
| echo "Waiting for Bridge Server to be ready..." |
| for i in {1..30}; do |
| if curl -s http://localhost:$WARP_SERVER_PORT/healthz > /dev/null 2>&1; then |
| echo "✅ Bridge Server is ready!" |
| break |
| fi |
| if [ $i -eq 30 ]; then |
| echo "❌ Bridge Server failed to start in 30 seconds" |
| kill $BRIDGE_PID 2>/dev/null || true |
| exit 1 |
| fi |
| echo "Waiting... ($i/30)" |
| sleep 1 |
| done |
|
|
| |
| echo "Starting OpenAI Compat Server on port $OPENAI_COMPAT_PORT..." |
| python openai_compat.py --port $OPENAI_COMPAT_PORT |
|
|
| |
| kill $BRIDGE_PID 2>/dev/null || true |
|
|
|
|