How shah-kavya-03/eclipse works
Eclipse is a real-time LLM guardrail and governance product, with a V1 FastAPI service and a V2 migration split between an Express gateway, Python ML service, and React clients. The principal V2 path is chat submission through the gateway to Python guardrail evaluation and provider orchestration, with persisted conversations and audit telemetry. Admin and user-management capabilities are retained as separate branches. Some subsystem links rely on README documentation; unsampled implementation details are not inferred.
Main entry points: App.jsx Admin console · internal.py Internal ML endpoints · connection.py MongoDB · server.js Express API gateway
Components 26
User and admin clients
- Chat interface
frontend/src/App.jsx - Chat and auth state
frontend/src/context/ChatContext.jsx - Admin console
admin_frontend/src/App.jsx - Admin API client
admin_frontend/src/api/client.js - V1 audit dashboard
frontend/js/audit.js
V2 API gateway
- Express API gateway
server/server.js - Chat routes
server/routes/chatRoutes.js - Chat orchestration
server/controllers/chatController.js - Auth and access control
server/middleware/authMiddleware.js - Python service client
server/services/pythonMlClient.js
Python guardrail service
- FastAPI service
backend/main.py - Internal ML endpoints
backend/routers/internal.py - Threat evaluation
backend/security/threat_classifier.py - PII and content checks
backend/security/pii_detector.py - Injection detection
backend/security/injection_detector.py - Blocked-prompt explanation
backend/security/lime_explainer.py - Provider rotation
backend/llm/api_router.py
Security and governance
- Anomalies and reports
backend/ml/anomaly_detector.py - Admin and telemetry
server/controllers/adminController.js - Logs and dashboard stats
server/controllers/logsController.js - Conversation management
server/controllers/conversationController.js - User settings
server/controllers/settingsController.js
Persistence and providers
- MongoDB
backend/database/connection.py
Other components
- Chat user
- Administrator
- LLM providers
Connections 31
- Chat user → Chat interface: uses
- Chat interface → Chat and auth state: delegates to
frontend/src/App.jsx - Chat and auth state → Express API gateway: sends chat requests
- Administrator → Admin console: uses
admin_frontend/src/App.jsx - Admin console → Admin API client: uses
admin_frontend/src/App.jsx - Admin API client → Express API gateway: calls Node API
admin_frontend/src/api/client.js - Admin API client → FastAPI service: calls Python API
admin_frontend/src/api/client.js - Express API gateway → Chat routes: mounts routes
server/server.js - Chat routes → Chat orchestration: dispatches
- Chat orchestration → Python service client: submits prompt
server/services/pythonMlClient.js - Python service client → Internal ML endpoints: calls internal API
server/services/pythonMlClient.js - FastAPI service → Internal ML endpoints: registers router
backend/main.py - Internal ML endpoints → Threat evaluation: evaluates threats
backend/routers/internal.py - Internal ML endpoints → Blocked-prompt explanation: explains blocks
backend/routers/internal.py - Internal ML endpoints → Provider rotation: requests generation
backend/routers/internal.py - Internal ML endpoints → Anomalies and reports: records and analyzes
backend/routers/internal.py - Threat evaluation → PII and content checks: uses PII checks
- Threat evaluation → Injection detection: uses injection checks
- Provider rotation → LLM providers: fails over across
backend/llm/api_router.py - Admin console → Admin and telemetry: requests admin data
- Admin console → Logs and dashboard stats: requests telemetry
- Admin console → Conversation management: manages conversations
- Admin console → User settings: manages settings
- Express API gateway → Auth and access control: protects routes
- Conversation management → MongoDB: reads and writes
- Admin and telemetry → MongoDB: reads and writes
- Logs and dashboard stats → MongoDB: reads telemetry
server/controllers/logsController.js - Logs and dashboard stats → Python service client: fetches anomalies and reports
server/controllers/logsController.js - User settings → MongoDB: reads and writes
- FastAPI service → MongoDB: connects at startup
backend/main.py - V1 audit dashboard → Administrator: shows audit telemetry