How risaryan9/project-seraph works
Seraph profiles concurrent ML workloads, attributes hardware metrics to execution phases, and sends samples through Kafka for storage and live viewing. Its FastAPI backend queries InfluxDB and exposes REST and WebSocket access, with additional optimizer analysis, process diagnostics, and Slack notifications. The graph preserves those documented capabilities; several API relationships are supported by the SOURCE INDEX rather than full excerpts, and the Kafka-to-WebSocket bridge details are not sampled.
Main entry points: agent.py Hardware Profiler · routes.py Metrics and Analysis Routes · main.py FastAPI Backend · influx.py Influx Query Helper
Components 21
Workload Simulation
- ResNet Workload
mlviz/workloads/resnet_main.py - BERT Workload
mlviz/workloads/bert_main.py - Data Pipeline
mlviz/workloads/pipeline_main.py - Workload Runners
mlviz/workloads/runners.py - Local Orchestrator
orchestrator.py
Metric Collection
- Hardware Profiler
mlviz/profiler/agent.py - Metric Sample
mlviz/profiler/metrics.py
Metric Streaming
- Kafka Producer
mlviz/profiler/kafka_producer.py - Batch Aggregator
mlviz/aggregator/service.py - Terminal Live View
mlviz/live_view/service.py
Time-Series Storage
- InfluxDB Metrics
API and Analysis
- FastAPI Backend
mlviz/api/main.py - Metrics and Analysis Routes
mlviz/api/routes.py - Influx Query Helper
mlviz/api/influx.py - Kafka WebSocket Bridge
mlviz/api/kafka_bridge.py - Process Diagnostics
mlviz/api/model_process_pids.py - Optimizer Diagnostics
mlviz/api/optimizer_diagnostics.py - Slack Notifications
mlviz/api/slack_notifier.py
Other components
- Workload Operator
- Kafka Broker
- API Consumer
Connections 22
- Workload Operator → Local Orchestrator: starts locally
README.md - Local Orchestrator → Workload Runners: spawns runners
orchestrator.py - Workload Runners → Hardware Profiler: collects metrics
mlviz/workloads/runners.py - ResNet Workload → Hardware Profiler: starts profiler
mlviz/workloads/resnet_main.py - BERT Workload → Hardware Profiler: starts profiler
mlviz/workloads/bert_main.py - Data Pipeline → Hardware Profiler: starts profiler
mlviz/workloads/pipeline_main.py - Hardware Profiler → Metric Sample: creates samples
mlviz/profiler/agent.py - Hardware Profiler → Kafka Producer: sends samples
mlviz/profiler/agent.py - Kafka Producer → Kafka Broker: publishes metrics
mlviz/profiler/kafka_producer.py - Kafka Broker → Batch Aggregator: streams metrics
README.md - Batch Aggregator → InfluxDB Metrics: batch writes
README.md - Kafka Broker → Terminal Live View: streams metrics
README.md - API Consumer → FastAPI Backend: queries or streams
README.md - FastAPI Backend → Metrics and Analysis Routes: registers routes
mlviz/api/main.py - FastAPI Backend → Influx Query Helper: connects database
mlviz/api/main.py - FastAPI Backend → Kafka WebSocket Bridge: starts consumer
mlviz/api/main.py - Metrics and Analysis Routes → Influx Query Helper: queries metrics
mlviz/api/routes.py - Influx Query Helper → InfluxDB Metrics: reads metrics
mlviz/api/influx.py - Metrics and Analysis Routes → Process Diagnostics: gets process context
mlviz/api/routes.py - Metrics and Analysis Routes → Optimizer Diagnostics: analyzes metrics
mlviz/api/routes.py - Metrics and Analysis Routes → Slack Notifications: sends notifications
mlviz/api/routes.py - Kafka Broker → Kafka WebSocket Bridge: feeds live stream