feat: Refactor LLM router and integrate health check endpoint

- Simplified LLM call logic in llm_router.py, removing tool adapter complexity and enhancing error handling.
- Added health check endpoint to main.py for system status verification.
- Cleaned up router.py by removing unused imports and commented-out code, streamlining the structure.
- Updated docker-compose.yml to unify services under a single Lyra container, enhancing deployment simplicity.
- Created Dockerfile for unified container setup, including both Relay and Cortex services.
- Added QUICKSTART.md for improved onboarding and usage instructions.
- Implemented start.sh script to manage service startup and health checks.
This commit is contained in:
2026-05-29 18:20:56 -04:00
parent 376b8114ad
commit 5f53fb32a4
14 changed files with 802 additions and 1665 deletions
+34
View File
@@ -0,0 +1,34 @@
#!/bin/bash
# Unified startup script for Lyra (Relay + Cortex)
set -e
echo "🚀 Starting Lyra unified container..."
# Start Cortex (Python/FastAPI) in the background
echo "📡 Starting Cortex on port 7081..."
cd /app/cortex
uvicorn main:app --host 0.0.0.0 --port 7081 &
CORTEX_PID=$!
# Wait for Cortex to be ready
echo "⏳ Waiting for Cortex to be ready..."
for i in {1..30}; do
if curl -sf http://localhost:7081/_health > /dev/null 2>&1; then
echo "✅ Cortex is ready!"
break
fi
if [ $i -eq 30 ]; then
echo "❌ Cortex failed to start within 30 seconds"
exit 1
fi
sleep 1
done
# Start Relay (Node.js/Express) in the foreground
echo "🔌 Starting Relay on port 7078..."
cd /app/relay
exec node server.js
# Note: We exec the last process so signals get forwarded properly
# If Relay dies, the container stops. If Cortex dies, Relay will fail too.