Files
project-lyra/cortex/main.py
T
serversdown 5f53fb32a4 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.
2026-05-29 18:20:56 -04:00

21 lines
530 B
Python

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from router import cortex_router
app = FastAPI()
# Add CORS middleware to allow SSE connections from nginx UI
app.add_middleware(
CORSMiddleware,
allow_origins=["*"], # In production, specify exact origins
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Health check endpoint
@app.get("/_health")
async def health_check():
return {"status": "ok"}
app.include_router(cortex_router)