-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.sh
More file actions
executable file
·48 lines (43 loc) · 993 Bytes
/
server.sh
File metadata and controls
executable file
·48 lines (43 loc) · 993 Bytes
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
#!/bin/bash
cd "$(dirname "$0")"
# Parse arguments
MOCK_MODE=""
HOST="0.0.0.0"
PORT=8000
while [[ $# -gt 0 ]]; do
case $1 in
--mock)
MOCK_MODE="--mock"
shift
;;
--llm)
MOCK_MODE="--llm"
shift
;;
--host)
HOST="$2"
shift 2
;;
--port)
PORT="$2"
shift 2
;;
*)
echo "Usage: ./server.sh [--mock|--llm] [--host HOST] [--port PORT]"
exit 1
;;
esac
done
# If no explicit mode, auto-detect based on NVIDIA_API_KEY
if [ -z "$MOCK_MODE" ]; then
if [ -n "$NVIDIA_API_KEY" ]; then
MOCK_MODE="--llm"
else
MOCK_MODE="--mock"
fi
fi
echo "=== Starting Code5 Web Server ==="
echo "Mode: $([ "$MOCK_MODE" = "--mock" ] && echo "MOCK" || echo "LLM")"
echo "Server: http://$HOST:$PORT"
echo ""
python3 -m code5.web $MOCK_MODE --host "$HOST" --port "$PORT"