Spaces:
Sleeping
Sleeping
| set -e | |
| export HOME="/root" | |
| export HERMES_HOME="/root/.hermes" | |
| echo "=== π Hermes Serverless Starting ===" | |
| # Install Hermes using pip (more reliable than git clone in HF Spaces) | |
| if ! command -v hermes &> /dev/null; then | |
| echo "π¦ Installing Hermes via pip..." | |
| pip3 install --quiet git+https://github.com/nousresearch/Hermes.git 2>&1 | tail -3 || \ | |
| pip3 install --quiet hermes-agent 2>&1 | tail -3 || \ | |
| echo "β οΈ Hermes install may have issues" | |
| fi | |
| # Configure to use YOUR Vercel Gemini proxy | |
| if [ ! -f "/root/.hermes/config.yaml" ]; then | |
| echo "βοΈ Configuring Hermes with your Vercel Gemini proxy..." | |
| mkdir -p /root/.hermes | |
| # Use a dummy key or set via HF Secret | |
| API_KEY="${HERMES_KEY:-gemini-proxy-key}" | |
| cat > /root/.hermes/config.yaml << EOF | |
| provider: openai | |
| model: ${HERMES_MODEL:-gemini-3.1-flash-lite} | |
| uri: ${HERMES_URI:-https://antigravity-seven-delta.vercel.app/v1} | |
| api_key: ${API_KEY} | |
| EOF | |
| echo "β Config created:" | |
| cat /root/.hermes/config.yaml | |
| fi | |
| echo "π Starting API on port 7860..." | |
| exec uvicorn server:app --host 0.0.0.0 --port 7860 |