Docgenie-API / api /start.sh
Ahadhassan-2003
deploy: update HF Space
dc4e6da
#!/bin/bash
# Start the DocGenie API server
# Note: All dependencies should be installed via 'uv sync' or 'pip install -e .'
echo "Starting DocGenie API..."
# Check if .env file exists
if [ ! -f .env ]; then
echo "Warning: .env file not found. Using .env.example as template."
echo "Please copy .env.example to .env and set your ANTHROPIC_API_KEY"
if [ -f .env.example ]; then
cp .env.example .env
echo "Created .env file from .env.example"
fi
fi
# Load environment variables
if [ -f .env ]; then
export $(cat .env | grep -v '^#' | xargs)
fi
# Check if ANTHROPIC_API_KEY is set
if [ -z "$ANTHROPIC_API_KEY" ]; then
echo "Error: ANTHROPIC_API_KEY not set in .env file"
exit 1
fi
# Default values
HOST=${API_HOST:-0.0.0.0}
PORT=${API_PORT:-8000}
WORKERS=${API_WORKERS:-4}
echo "Configuration:"
echo " Host: $HOST"
echo " Port: $PORT"
echo " Workers: $WORKERS"
echo ""
# Start the API
uvicorn main:app --host $HOST --port $PORT --workers $WORKERS --reload