Spaces:
Sleeping
Sleeping
File size: 1,130 Bytes
af0a62e 868d895 c04f0c5 249253b e629615 fcb99b8 e629615 249253b 96189f2 | 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 | #!/bin/bash
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 |