#!/usr/bin/env bash # DealFlow AI — Start script # Usage: ./scripts/start.sh [--port 7860] [--backend vllm|hf] set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" PROJECT_DIR="$(dirname "$SCRIPT_DIR")" PORT="${GRADIO_PORT:-7860}" BACKEND="${LLM_BACKEND:-vllm}" cd "$PROJECT_DIR" echo "==> DealFlow AI starting..." echo " Port: $PORT" echo " Backend: $BACKEND" # Load .env if present if [[ -f ".env" ]]; then echo " Loading .env" set -a source .env set +a fi # Check Python deps if ! python3 -c "import crewai" 2>/dev/null; then echo "==> Installing dependencies..." pip3 install -r requirements.txt fi export LLM_BACKEND="$BACKEND" export GRADIO_PORT="$PORT" echo "==> Launching Gradio UI on http://0.0.0.0:$PORT" python3 ui/app.py