The Admin Dashboard provides a web-based interface for monitoring and managing the AI Council Proxy system.
- System Metrics: Total requests, active sessions, average response time
- Cost Tracking: Total cost, today's cost, average cost per request
- Performance: Success rate, consensus rate, average deliberation rounds
- Recent Activity: Live feed of recent requests with status and metrics
- Health Monitoring: Real-time status of all AI providers (OpenAI, Anthropic, Google)
- Performance Metrics: Success rate, average latency, request count per provider
- Failure Tracking: Consecutive failure counts and warnings
- Preset Configurations: Quick selection of fast-council, balanced-council, or research-council
- Custom Settings:
- Max deliberation rounds
- Consensus threshold
- Synthesis strategy (consensus, weighted, meta)
- Live Updates: Changes take effect immediately
- Performance Analytics: Request volume, success rates, latency trends
- Cost Breakdown: Total costs, per-request costs, costs by provider and model
- Time Range Selection: View metrics for different time periods
- System Events: Real-time view of system events and errors
- Event Types: Request processing, consensus decisions, provider health changes
- Detailed Data: Full event data in JSON format
- PostgreSQL database running
- Redis cache running
- AI Council Proxy configured
# Start the admin dashboard (runs on port 3001 by default)
npm run adminThe dashboard will be available at: http://localhost:3001
Set the ADMIN_PORT environment variable to use a different port:
ADMIN_PORT=4000 npm run adminThe admin dashboard consists of:
-
Backend Server (
src/dashboard/admin-server.ts)- Express server serving static files and API endpoints
- Runs on separate port from main API (default: 3001)
- Provides REST endpoints for dashboard data
-
Frontend (
src/dashboard/public/)admin.html: Single-page application interfaceadmin.js: Client-side JavaScript for data fetching and rendering- Auto-refreshes data every 10 seconds
-
Dashboard Component (
src/dashboard/dashboard.ts)- Aggregates data from analytics engine, provider pool, and database
- Provides unified interface for monitoring data
Returns system overview metrics (requests, sessions, costs, performance)
Returns health status for all providers
Returns recent request activity
Returns current council configuration
Updates council configuration
{
"preset": "balanced-council",
// OR
"maxRounds": 3,
"consensusThreshold": 0.7,
"synthesisStrategy": "consensus"
}Returns performance metrics for specified time range
Returns cost analytics for specified time range
Returns recent system logs
The admin dashboard currently has no authentication. For production use:
- Add authentication middleware to admin server
- Use HTTPS/TLS for encrypted connections
- Restrict access by IP address or VPN
- Consider running on internal network only
src/dashboard/
├── admin-server.ts # Backend Express server
├── dashboard.ts # Dashboard data aggregation
└── public/
├── admin.html # Frontend HTML
└── admin.js # Frontend JavaScript
- Add API endpoint in
admin-server.ts - Add corresponding function in
dashboard.tsif needed - Update frontend in
admin.htmlandadmin.js
The dashboard uses a dark theme with:
- Background:
#0f172a(slate-900) - Cards:
#1e293b(slate-800) - Accent:
#3b82f6(blue-500) - Success:
#10b981(green-500) - Warning:
#f59e0b(amber-500) - Error:
#ef4444(red-500)
- Check PostgreSQL is running:
docker ps | grep postgres - Check Redis is running:
docker ps | grep redis - Verify DATABASE_URL and REDIS_URL environment variables
- Ensure main API has processed some requests
- Check browser console for JavaScript errors
- Verify API endpoints are responding:
curl http://localhost:3001/api/admin/overview
- Change port:
ADMIN_PORT=4000 npm run admin - Or stop process using port 3001:
lsof -ti:3001 | xargs kill
- Real-time WebSocket updates instead of polling
- Interactive charts and graphs (Chart.js, D3.js)
- User authentication and role-based access
- Configuration history and rollback
- Alert notifications for system issues
- Export data to CSV/JSON
- Dark/light theme toggle