Overview
Section titled “Overview”La Fase 8 transforma AI-LAB de un runtime funcional con observabilidad clasica a un Cognitive Mesh en tiempo real: una malla cognitiva donde cada componente emite eventos, se visualiza en vivo y puede ser monitorizado con latencia sub-5s.
Componentes
Section titled “Componentes” ┌──────────────┐ │ Open WebUI │ │ :3000 │ └──────┬───────┘ │ /v1/chat/completions ▼┌──────────────────────────────────────────────────────┐│ ROUTER API (:8083) ││ capability-aware routing · stream sanitization ││ CORS · model selection · session tracking │└────────────────────┬─────────────────────────────────┘ │ ┌──────────┼──────────┐ ▼ ▼ ▼ ┌──────────┐ ┌──────────┐ ┌──────────┐ │ Gateway │ │ Gateway │ │ Gateway │ │ :8008 │ │ :8008 │ │ :8008 │ └────┬─────┘ └────┬─────┘ └────┬─────┘ │ │ │ ┌────▼────┐ ┌────▼────┐ ┌────▼────┐ │ RX9070 │ │RX7900XT │ │ NAS │ │ LMStudio│ │LMStudio │ │(offline)│ └─────────┘ └─────────┘ └─────────┘Capas del Sistema
Section titled “Capas del Sistema”Capa 1: Infraestructura Fisica
Section titled “Capa 1: Infraestructura Fisica”- Hyper-V host (NAS-N5) con 2 VMs Ubuntu Server
- 3 nodos GPU (RX9070 16GB, RX7900XT 20GB, NAS offline)
- Red 10Gb + 2.5Gb con Cloudflare Tunnel
Capa 2: Runtime Cognitivo
Section titled “Capa 2: Runtime Cognitivo”- 7 servicios systemd con autoarranque
- Gateway OpenAI-compatible con failover y rate limiting
- Router API con routing capability-aware
- Live API con eventos SSE y topologia
Capa 3: Observabilidad operativa en 1.40
Section titled “Capa 3: Observabilidad operativa en 1.40”- Prometheus:
192.168.1.40:9090 - Grafana:
192.168.1.40:3000 - Loki:
192.168.1.40:3100 - Promtail:
192.168.1.30:1514/tcpparaunifi-ids - Dashboards y logs ya conectados al stack vivo
Capa 4: Visualizacion en Tiempo Real (Fase 8)
Section titled “Capa 4: Visualizacion en Tiempo Real (Fase 8)”- SSE Event Bus: eventos estructurados via streaming
- ClusterHealth: indicadores vivos GPUs/Docker/VRAM
- EventStream: timeline de eventos cognitivos
- TopologyGraph: topologia interactiva del cluster
- Cytoscape.js: grafo de red para futura migracion
Flujo de Datos en Tiempo Real
Section titled “Flujo de Datos en Tiempo Real”GPU Nodes (9182/9183) │ scrape cada 30s ▼Prometheus (:9090 en 1.40) │ ├── Grafana dashboards (query) └── live_api.py (:8084 en 1.30) │ ├── /api/status.json → Polling (ClusterHealth) ├── /api/topology → Polling (TopologyGraph) └── /api/events → SSE push (EventStream)Metricas Tiempo Real
Section titled “Metricas Tiempo Real”| Metrica | Fuente | Latencia |
|---|---|---|
| GPU temperatura | GPU API :9183 | 3s (SSE) |
| VRAM usado | windows_exporter :9182 | 30s (scrape) |
| Docker count | live_api.py | 3s (SSE) |
| Requests total | Gateway :8008/metrics | 15s (scrape) |
| Eventos SSE | live_api.py | 3s (push) |
| Topologia | live_api.py | 5s (polling) |
Seguridad
Section titled “Seguridad”- CORS configurado en Router API y Live API
- Rate limiting en Gateway (30 req/min)
- Cloudflare Zero Trust para acceso publico
- Sin exponer puertos entrantes (solo Tunnel)