-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·86 lines (73 loc) · 2.13 KB
/
start.sh
File metadata and controls
executable file
·86 lines (73 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# Quick start script for vLLM CPU deployment
set -e
echo "================================================"
echo "vLLM CPU Deployment - Quick Start"
echo "================================================"
echo ""
# Check if Docker is running
if ! docker info > /dev/null 2>&1; then
echo "❌ Error: Docker is not running"
echo "Please start Docker Desktop and try again"
exit 1
fi
echo "✓ Docker is running"
echo ""
# Check if .env exists
if [ ! -f .env ]; then
echo "⚠️ Warning: .env file not found"
echo "Using default configuration from docker-compose.yml"
echo ""
fi
# Build and start services
echo "Starting vLLM service..."
echo "This may take a while on first run (model download)"
echo ""
docker compose up -d
echo ""
echo "Waiting for service to be ready..."
echo "This can take 5-10 minutes on first startup..."
echo ""
# Wait for health check
MAX_RETRIES=60
RETRY_COUNT=0
SLEEP_TIME=10
while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do
if curl -sf http://localhost:8009/health > /dev/null 2>&1; then
echo ""
echo "✓ vLLM service is ready!"
echo ""
echo "================================================"
echo "Service Information"
echo "================================================"
echo "API URL: http://localhost:8009"
echo "Health: http://localhost:8009/health"
echo "Models: http://localhost:8009/v1/models"
echo ""
echo "View logs:"
echo " docker compose logs -f vllm-cpu"
echo ""
echo "Test the API:"
echo " python test_vllm.py"
echo ""
echo "Stop the service:"
echo " docker compose down"
echo ""
exit 0
fi
RETRY_COUNT=$((RETRY_COUNT + 1))
echo -n "."
sleep $SLEEP_TIME
done
echo ""
echo "⚠️ Service did not become ready in time"
echo ""
echo "Check logs with:"
echo " docker compose logs vllm-cpu"
echo ""
echo "Common issues:"
echo " - Insufficient memory (check Docker Desktop settings)"
echo " - Model download in progress (wait longer)"
echo " - Port 8000 already in use (change VLLM_PORT in .env)"
echo ""
exit 1