53 lines · 1.5 KB · Shell
RawDownload
#!/bin/bash# vLLM Studio - Start Scriptset -e cd "$(dirname "$0")" # ColorsGREEN='\033[0;32m'BLUE='\033[0;34m'NC='\033[0m' echo -e "${BLUE}╔═══════════════════════════════════════╗${NC}"echo -e "${BLUE}║          vLLM Studio                  ║${NC}"echo -e "${BLUE}╚═══════════════════════════════════════╝${NC}" # Load .env if exists[ -f .env ] && export $(grep -v '^#' .env | xargs) # DefaultsPORT=${VLLM_STUDIO_PORT:-8080}DEV_MODE=false # Parse argswhile [[ $# -gt 0 ]]; do    case $1 in        --dev) DEV_MODE=true; shift ;;        --port) PORT="$2"; shift 2 ;;        -h|--help)            echo "Usage: ./start.sh [--dev] [--port PORT]"            echo ""            echo "Options:"            echo "  --dev   Development mode with auto-reload"            echo "  --port  Controller port (default: 8080)"            exit 0            ;;        *) shift ;;    esacdone # Use non-snap bun (snap bun has sandbox restrictions)BUN="${HOME}/.bun/bin/bun"if [ ! -x "$BUN" ]; then    BUN="bun"  # Fallback to system bunfi # Startif [ "$DEV_MODE" = true ]; then    echo -e "${GREEN}Starting in dev mode...${NC}"    VLLM_STUDIO_PORT="$PORT" "$BUN" --watch controller/src/main.tselse    echo -e "${GREEN}Starting controller on port $PORT...${NC}"    VLLM_STUDIO_PORT="$PORT" "$BUN" controller/src/main.tsfi