# darshan-stack/effective-parakeet architecture

> Architecture diagram of the GitHub repository darshan-stack/effective-parakeet, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/darshan-stack/effective-parakeet
- Repository: https://github.com/darshan-stack/effective-parakeet

## Overview

GPUGuard observes GPU telemetry and ROS 2 topic performance, correlates their timelines, detects anomalies, and exposes live status through an API and dashboard. The README also describes AI root-cause diagnostics and actionable recommendations. The graph includes the ROS 2 node adapters as well as the core analysis path; relationships between the dashboard and API, and between telemetry streams and correlation, rely on README descriptions where sampled source does not show the wiring.

Main entry points: [`src/gpuguard/correlation/correlator.py`](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/correlation/correlator.py) (GPU–ROS Correlator), [`src/gpuguard/api/routes.py`](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/api/routes.py) (REST and WS Routes), [`src/gpuguard/collector/nvml_collector.py`](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/collector/nvml_collector.py) (NVML Collector), [`src/gpuguard/collector/sampler.py`](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/collector/sampler.py) (GPU Sampler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_collection["Telemetry Collection"]
  node_gpu_collector["NVML Collector<br/>[nvml_collector.py]"]
  node_gpu_metrics["GPU Metrics<br/>[metrics.py]"]
  node_gpu_sampler["GPU Sampler<br/>[sampler.py]"]
  node_ros_monitor["ROS Monitor<br/>[ros_monitor.py]"]
  node_topic_tracker["Topic Tracker<br/>[topic_tracker.py]"]
  node_config["Configuration<br/>[config.py]"]
end

subgraph group_analysis["Correlation Analysis"]
  node_time_sync["Time Synchronizer<br/>[time_sync.py]"]
  node_correlator["GPU–ROS Correlator<br/>[correlator.py]"]
  node_anomaly["Anomaly Detection<br/>[detector.py]"]
end

subgraph group_diagnostics["Diagnostics"]
  node_recommendations["Recommendations"]
  node_ai_diagnostic["AI Diagnostics<br/>[ai_diagnostic.py]"]
  node_prompts["Diagnostic Prompts"]
end

subgraph group_delivery["API and Dashboard"]
  node_api_app["FastAPI App<br/>[main.py]"]
  node_api_routes["REST and WS Routes<br/>[routes.py]"]
  node_websocket_manager["WebSocket Manager"]
  node_dashboard_app["Dash Application<br/>[app.py]"]
  node_dashboard_layout["Dashboard Layouts<br/>[layouts.py]"]
  node_dashboard_callbacks["Dashboard Callbacks<br/>[callbacks.py]"]
end

subgraph group_integration["ROS 2 Integration"]
  node_collector_node["Collector Node<br/>[collector_node.py]"]
  node_monitor_node["Monitor Node<br/>[monitor_node.py]"]
  node_correlator_node["Correlator Node<br/>[correlator_node.py]"]
  node_anomaly_node["Anomaly Node<br/>[anomaly_node.py]"]
end

node_gpu(("NVIDIA GPU"))
node_ros_stack(("ROS 2 Stack"))
node_operator(("Robot Operator"))

node_gpu -->|"provides telemetry"| node_gpu_collector
node_gpu_collector -->|"builds samples"| node_gpu_metrics
node_gpu_collector -->|"collects into"| node_gpu_sampler
node_gpu_sampler -->|"stores states"| node_gpu_metrics
node_ros_stack -->|"provides topic data"| node_ros_monitor
node_ros_monitor -->|"records samples"| node_topic_tracker
node_gpu_sampler -.->|"supplies GPU stream"| node_correlator
node_topic_tracker -.->|"supplies ROS metrics"| node_correlator
node_correlator -->|"aligns samples"| node_time_sync
node_correlator -.->|"supports detection"| node_anomaly
node_anomaly -->|"informs advice"| node_recommendations
node_correlator -.->|"provides root-cause context"| node_ai_diagnostic
node_ai_diagnostic -->|"uses templates"| node_prompts
node_api_app -->|"registers routes"| node_api_routes
node_api_app -->|"closes connections"| node_websocket_manager
node_api_routes -->|"reads GPU state"| node_gpu_sampler
node_api_routes -->|"reads topic stats"| node_topic_tracker
node_api_routes -->|"requests causality"| node_correlator
node_api_routes -->|"handles subscriptions"| node_websocket_manager
node_api_app -.->|"serves live data"| node_dashboard_app
node_dashboard_app -->|"uses layouts"| node_dashboard_layout
node_dashboard_app -->|"registers callbacks"| node_dashboard_callbacks
node_dashboard_callbacks -.->|"updates views"| node_dashboard_layout
node_operator -.->|"views telemetry"| node_dashboard_app
node_collector_node -->|"uses collector"| node_gpu_collector
node_monitor_node -->|"uses monitor"| node_ros_monitor
node_correlator_node -->|"uses engine"| node_correlator
node_anomaly_node -.->|"runs detection"| node_anomaly
node_config -.->|"configures polling"| node_gpu_collector
node_config -->|"configures topics"| node_ros_monitor
node_config -->|"configures analysis"| node_correlator

click node_gpu_collector "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/collector/nvml_collector.py"
click node_gpu_metrics "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/collector/metrics.py"
click node_gpu_sampler "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/collector/sampler.py"
click node_ros_monitor "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/monitor/ros_monitor.py"
click node_topic_tracker "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/monitor/topic_tracker.py"
click node_time_sync "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/correlation/time_sync.py"
click node_correlator "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/correlation/correlator.py"
click node_anomaly "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/anomaly/detector.py"
click node_recommendations "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/diagnostic/recommendation_engine.py"
click node_ai_diagnostic "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/diagnostic/ai_diagnostic.py"
click node_prompts "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/diagnostic/prompt_templates.py"
click node_api_app "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/api/main.py"
click node_api_routes "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/api/routes.py"
click node_websocket_manager "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/api/websocket_manager.py"
click node_dashboard_app "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/dashboard/app.py"
click node_dashboard_layout "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/dashboard/layouts.py"
click node_dashboard_callbacks "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/dashboard/callbacks.py"
click node_collector_node "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/ros2/gpuguard_ros2/collector_node.py"
click node_monitor_node "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/ros2/gpuguard_ros2/monitor_node.py"
click node_correlator_node "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/ros2/gpuguard_ros2/correlator_node.py"
click node_anomaly_node "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/ros2/gpuguard_ros2/anomaly_node.py"
click node_config "https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/utils/config.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_gpu_collector,node_gpu_metrics,node_gpu_sampler,node_ros_monitor,node_topic_tracker,node_config toneBlue
class node_time_sync,node_correlator,node_anomaly toneAmber
class node_recommendations,node_ai_diagnostic,node_prompts toneMint
class node_api_app,node_api_routes,node_websocket_manager,node_dashboard_app,node_dashboard_layout,node_dashboard_callbacks toneRose
class node_collector_node,node_monitor_node,node_correlator_node,node_anomaly_node,node_gpu,node_ros_stack,node_operator toneIndigo
```

## Components

### Telemetry Collection

- [NVML Collector](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/collector/nvml_collector.py): `src/gpuguard/collector/nvml_collector.py`
- [GPU Metrics](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/collector/metrics.py): `src/gpuguard/collector/metrics.py`
- [GPU Sampler](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/collector/sampler.py): `src/gpuguard/collector/sampler.py`
- [ROS Monitor](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/monitor/ros_monitor.py): `src/gpuguard/monitor/ros_monitor.py`
- [Topic Tracker](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/monitor/topic_tracker.py): `src/gpuguard/monitor/topic_tracker.py`
- [Configuration](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/utils/config.py): `src/gpuguard/utils/config.py`

### Correlation Analysis

- [Time Synchronizer](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/correlation/time_sync.py): `src/gpuguard/correlation/time_sync.py`
- [GPU–ROS Correlator](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/correlation/correlator.py): `src/gpuguard/correlation/correlator.py`
- [Anomaly Detection](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/anomaly/detector.py): `src/gpuguard/anomaly/detector.py`

### Diagnostics

- [Recommendations](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/diagnostic/recommendation_engine.py): `src/gpuguard/diagnostic/recommendation_engine.py`
- [AI Diagnostics](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/diagnostic/ai_diagnostic.py): `src/gpuguard/diagnostic/ai_diagnostic.py`
- [Diagnostic Prompts](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/diagnostic/prompt_templates.py): `src/gpuguard/diagnostic/prompt_templates.py`

### API and Dashboard

- [FastAPI App](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/api/main.py): `src/gpuguard/api/main.py`
- [REST and WS Routes](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/api/routes.py): `src/gpuguard/api/routes.py`
- [WebSocket Manager](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/api/websocket_manager.py): `src/gpuguard/api/websocket_manager.py`
- [Dash Application](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/dashboard/app.py): `src/gpuguard/dashboard/app.py`
- [Dashboard Layouts](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/dashboard/layouts.py): `src/gpuguard/dashboard/layouts.py`
- [Dashboard Callbacks](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/dashboard/callbacks.py): `src/gpuguard/dashboard/callbacks.py`

### ROS 2 Integration

- [Collector Node](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/ros2/gpuguard_ros2/collector_node.py): `src/gpuguard/ros2/gpuguard_ros2/collector_node.py`
- [Monitor Node](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/ros2/gpuguard_ros2/monitor_node.py): `src/gpuguard/ros2/gpuguard_ros2/monitor_node.py`
- [Correlator Node](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/ros2/gpuguard_ros2/correlator_node.py): `src/gpuguard/ros2/gpuguard_ros2/correlator_node.py`
- [Anomaly Node](https://github.com/darshan-stack/effective-parakeet/blob/main/src/gpuguard/ros2/gpuguard_ros2/anomaly_node.py): `src/gpuguard/ros2/gpuguard_ros2/anomaly_node.py`

### Other components

- **NVIDIA GPU**
- **ROS 2 Stack**
- **Robot Operator**

## Connections

- NVIDIA GPU → NVML Collector: provides telemetry
- NVML Collector → GPU Metrics: builds samples (evidence: `src/gpuguard/collector/nvml_collector.py`)
- NVML Collector → GPU Sampler: collects into (evidence: `src/gpuguard/collector/cli.py`)
- GPU Sampler → GPU Metrics: stores states (evidence: `src/gpuguard/collector/sampler.py`)
- ROS 2 Stack → ROS Monitor: provides topic data
- ROS Monitor → Topic Tracker: records samples (evidence: `src/gpuguard/monitor/ros_monitor.py`)
- GPU Sampler → GPU–ROS Correlator: supplies GPU stream
- Topic Tracker → GPU–ROS Correlator: supplies ROS metrics
- GPU–ROS Correlator → Time Synchronizer: aligns samples (evidence: `src/gpuguard/correlation/correlator.py`)
- GPU–ROS Correlator → Anomaly Detection: supports detection
- Anomaly Detection → Recommendations: informs advice (evidence: `src/gpuguard/diagnostic/recommendation_engine.py`)
- GPU–ROS Correlator → AI Diagnostics: provides root-cause context
- AI Diagnostics → Diagnostic Prompts: uses templates (evidence: `src/gpuguard/diagnostic/__init__.py`)
- FastAPI App → REST and WS Routes: registers routes (evidence: `src/gpuguard/api/main.py`)
- FastAPI App → WebSocket Manager: closes connections (evidence: `src/gpuguard/api/main.py`)
- REST and WS Routes → GPU Sampler: reads GPU state (evidence: `src/gpuguard/api/routes.py`)
- REST and WS Routes → Topic Tracker: reads topic stats (evidence: `src/gpuguard/api/routes.py`)
- REST and WS Routes → GPU–ROS Correlator: requests causality (evidence: `src/gpuguard/api/routes.py`)
- REST and WS Routes → WebSocket Manager: handles subscriptions (evidence: `src/gpuguard/api/routes.py`)
- FastAPI App → Dash Application: serves live data
- Dash Application → Dashboard Layouts: uses layouts (evidence: `src/gpuguard/dashboard/app.py`)
- Dash Application → Dashboard Callbacks: registers callbacks (evidence: `src/gpuguard/dashboard/app.py`)
- Dashboard Callbacks → Dashboard Layouts: updates views
- Robot Operator → Dash Application: views telemetry
- Collector Node → NVML Collector: uses collector (evidence: `src/gpuguard/ros2/gpuguard_ros2/collector_node.py`)
- Monitor Node → ROS Monitor: uses monitor (evidence: `src/gpuguard/ros2/gpuguard_ros2/monitor_node.py`)
- Correlator Node → GPU–ROS Correlator: uses engine (evidence: `src/gpuguard/ros2/gpuguard_ros2/correlator_node.py`)
- Anomaly Node → Anomaly Detection: runs detection (evidence: `src/gpuguard/ros2/gpuguard_ros2/anomaly_node.py`)
- Configuration → NVML Collector: configures polling (evidence: `src/gpuguard/collector/nvml_collector.py`)
- Configuration → ROS Monitor: configures topics (evidence: `src/gpuguard/monitor/ros_monitor.py`)
- Configuration → GPU–ROS Correlator: configures analysis (evidence: `src/gpuguard/correlation/correlator.py`)
