An open API service indexing awesome lists of open source software.

https://github.com/exploring-solver/vpp_aggregation_platform


https://github.com/exploring-solver/vpp_aggregation_platform

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

          

# HackCBS 8.0 ne mera ghee khatam kardiya hai.
# Vusio - AI-Powered Virtual Power Plant Platform

> **Transforming Data Centers from Energy Consumers into Active Grid Assets**

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Node.js](https://img.shields.io/badge/Node.js-18+-green.svg)](https://nodejs.org/)
[![Python](https://img.shields.io/badge/Python-3.9+-blue.svg)](https://www.python.org/)
[![React](https://img.shields.io/badge/React-18+-61dafb.svg)](https://reactjs.org/)

## 🎯 The Problem

India faces a critical power reserve crisis that threatens its digital infrastructure growth:

- **Critical Reserve Margin**: India's spinning reserve margin is just **5%** (vs. recommended 15-20%)
- **Exponential Data Center Growth**: Data center demand set to rise **5-7x by 2030**
- **Grid Instability**: Insufficient reserve capacity leads to frequency fluctuations and potential blackouts
- **Energy Waste**: Data centers consume massive energy but remain passive grid participants
- **AI Infrastructure Challenge**: Growing AI workloads require sustainable, flexible power management

**The Challenge**: How do we enable sustainable digital infrastructure growth while strengthening grid resilience?

## 💡 The Solution: Vusio

**Vusio** is an AI-powered Virtual Power Plant (VPP) that aggregates battery storage and flexible compute loads across data centers to provide synthetic reserve capacity for India's power grid.

### Core Value Propositions

1. **Grid Stability**: Provides synthetic spinning reserve by intelligently managing distributed energy resources
2. **Revenue Generation**: Creates new revenue streams for data center operators through energy market participation
3. **Sustainable Growth**: Enables sustainable AI and digital infrastructure expansion
4. **Intelligent Optimization**: AI-driven predictions and optimizations for grid stress and energy arbitrage
5. **Energy Resilience**: Strengthens India's overall energy infrastructure resilience

## 🏗️ Architecture Overview

```
┌─────────────────────────────────────────────────────────────────┐
│ Vusio VPP Platform │
├─────────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Web │ │ Vendor │ │ Data │ │
│ │ Dashboard │ │ Portal │ │ Layer │ │
│ │ (React) │ │ (React) │ │ Service │ │
│ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘ │
│ │ │ │ │
│ └──────────────────┼──────────────────┘ │
│ │ │
│ ┌────────▼────────┐ │
│ │ Aggregator API │ │
│ │ (Express.js) │ │
│ └────────┬────────┘ │
│ │ │
│ ┌──────────────────┼──────────────────┐ │
│ │ │ │ │
│ ┌──────▼──────┐ ┌───────▼──────┐ ┌───────▼──────┐ │
│ │ ML │ │ MQTT │ │ Redis │ │
│ │ Pipeline │ │ Broker │ │ Cache │ │
│ │ (Python) │ │ (Mosquitto) │ │ Pub/Sub │ │
│ └──────┬──────┘ └───────┬──────┘ └───────┬──────┘ │
│ │ │ │ │
│ └──────────────────┼──────────────────┘ │
│ │ │
│ ┌────────▼────────┐ │
│ │ Edge Nodes │ │
│ │ (Data Centers) │ │
│ │ DC01, DC02... │ │
│ └──────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
```

## 📦 Project Modules

### 1. **Backend Aggregator** (`backend_express/`)

The core API server that orchestrates all VPP operations.

**Key Features:**
- RESTful API with 50+ endpoints
- Real-time telemetry ingestion
- Multi-agent system coordination
- Marketplace for energy contracts
- SSH management for edge nodes
- WebSocket support for real-time updates

**Technologies:**
- Node.js + Express.js
- MongoDB (data persistence)
- Redis (caching & pub/sub)
- MQTT (edge communication)
- JWT authentication

**Key Routes:**
- `/api/telemetry` - Real-time data ingestion
- `/api/aggregate` - VPP state aggregation
- `/api/dispatch` - Command dispatch to nodes
- `/api/marketplace` - Energy contracts & bidding
- `/api/agents` - Multi-agent coordination
- `/api/forecast` - Load & grid stress predictions
- `/api/optimization` - RL-based recommendations

### 2. **ML Pipeline** (`ml_pipeline/`)

AI/ML services for forecasting, optimization, and intelligent decision-making.

**Key Components:**
- **LSTM Forecaster**: Time-series forecasting for load prediction
- **Foundation Forecaster**: Transformer-based grid stress prediction
- **RL Optimizer**: Reinforcement learning for optimal dispatch decisions
- **Intelligent Agent**: Multi-agent coordination logic
- **Drift Monitor**: Model performance monitoring
- **Model Registry**: ML model versioning and management

**Technologies:**
- Python 3.9+
- PyTorch / TensorFlow
- FastAPI
- scikit-learn
- pandas, numpy

### 3. **Web Dashboard** (`web_dashboard/`)

Main operator dashboard for monitoring and controlling VPP operations.

**Key Pages:**
- **Dashboard**: Real-time VPP metrics and KPIs
- **Data Center Operator**: Node-specific operations and monitoring
- **Trading**: RL-based trading strategies and market participation
- **Agent Management**: Multi-agent system status and control
- **Forecasting**: Load and grid stress visualizations
- **Marketplace**: Energy contracts and bidding interface

**Technologies:**
- React 18
- Vite
- Tailwind CSS
- WebSocket client
- Auth0 integration

### 4. **Vendor Portal** (`vendor_portal/`)

Separate portal for energy companies to post contracts and manage transactions.

**Features:**
- Vendor authentication (JWT)
- Create energy contracts
- View and accept bids from operators
- Transaction management
- Revenue tracking

**Technologies:**
- React 18
- Vite
- Tailwind CSS
- JWT authentication

### 5. **Data Layer Service** (`data_layer_service/`)

Dedicated service for data analytics, ETL, and historical analysis.

**Features:**
- Telemetry data ingestion
- Analytics engine
- Transaction logging
- Metadata management
- ETL pipelines

**Technologies:**
- Node.js + Express.js
- MongoDB
- Redis

### 6. **Edge Node Simulator** (`services/edge_node/`)

Simulates data center edge nodes for testing and development.

**Features:**
- MQTT telemetry publishing
- Command execution simulation
- Battery state management
- Load simulation
- SSH server simulation

**Technologies:**
- Python + FastAPI
- MQTT client
- Simulated hardware interfaces

### 7. **Infrastructure** (`docker-compose.yml`)

Containerized deployment with all services.

**Services:**
- MongoDB (database)
- Redis (cache & pub/sub)
- Mosquitto (MQTT broker)
- Aggregator backend
- Edge node simulators
- Web dashboard
- ML pipeline services

## 🔄 How It Works

### 1. **Telemetry Collection**

```
Edge Node (DC01) → MQTT → Aggregator → MongoDB + Redis
```

- Edge nodes publish real-time telemetry (power, SOC, frequency, temperature)
- Aggregator ingests and stores data
- Real-time state cached in Redis

### 2. **VPP State Aggregation**

```
All Nodes → Aggregator → Virtual Plant State
```

- Aggregates capacity, battery state, and power across all nodes
- Calculates total available reserve
- Monitors grid frequency and stability metrics

### 3. **AI-Powered Forecasting**

```
Historical Data → ML Models → Predictions
```

- **Load Forecasting**: Predicts data center demand 24h ahead
- **Grid Stress Forecasting**: Predicts grid stress events 6h ahead
- Models: LSTM (time-series) + Foundation models (transformer-based)

### 4. **Multi-Agent Coordination**

```
Forecast Agent + Optimization Agent + Monitoring Agent → Coordinated Actions
```

- **Forecast Agent**: Analyzes predictions and identifies opportunities
- **Optimization Agent**: Uses RL to determine optimal actions
- **Monitoring Agent**: Tracks system health and available reserves
- Agents coordinate to make intelligent dispatch decisions

### 5. **Energy Marketplace**

```
Vendor Posts Contract → Operators Bid → Vendor Accepts → Transaction Created
```

**Flow:**
1. Energy company (vendor) posts contract: "Need 10 MW for 2 hours, max ₹5000/MW"
2. Data center operators see contract and place bids
3. Vendor reviews bids and accepts best offer
4. System creates transaction and tracks execution
5. Revenue distributed to operators

### 6. **Dispatch Optimization**

```
Grid Stress Detected → RL Agent Recommends → Dispatch Commands → Edge Nodes
```

- RL agent analyzes current state and forecasts
- Recommends optimal actions (charge, discharge, defer load, hold)
- Commands dispatched via MQTT to edge nodes
- Real-time feedback loop for continuous learning

### 7. **Grid Support Operations**

**Synthetic Reserve:**
- When grid frequency drops, VPP discharges batteries
- Provides immediate power injection to stabilize grid

**Load Deferral:**
- During peak demand, non-critical workloads deferred
- Reduces grid load without impacting critical operations

**Energy Arbitrage:**
- Charge batteries during low-price periods
- Discharge during high-price periods
- Maximizes revenue for operators

## 🚀 Quick Start

### Prerequisites

- Docker & Docker Compose
- Node.js 18+
- Python 3.9+
- MongoDB (or use Docker)
- Redis (or use Docker)

### Installation

1. **Clone the repository**
```bash
git clone
cd vpp_aggregation_platform
```

2. **Start infrastructure services**
```bash
docker-compose up -d mongodb redis mqtt_broker
```

3. **Install backend dependencies**
```bash
cd backend_express
npm install
```

4. **Configure environment variables**
```bash
cp .env.example .env
# Edit .env with your configuration
```

5. **Start the aggregator backend**
```bash
cd backend_express
npm start
```

6. **Start the web dashboard**
```bash
cd web_dashboard
npm install
npm run dev
```

7. **Start ML pipeline** (optional)
```bash
cd ml_pipeline
pip install -r requirements.txt
python src/api/main.py
```

### Environment Variables

**Backend (`backend_express/.env`):**
```env
PORT=3000
WS_PORT=3001
MONGODB_URI=mongodb://localhost:27017/vpp_platform
REDIS_HOST=localhost
REDIS_PORT=6379
MQTT_BROKER_URL=mqtt://localhost:1883
JWT_SECRET=your-secret-key
```

**Web Dashboard (`web_dashboard/.env`):**
```env
VITE_API_URL=http://localhost:3000
VITE_WS_URL=ws://localhost:3001
```

## 📊 Key Features

### For Data Center Operators

- ✅ Real-time monitoring of energy operations
- ✅ Bid on energy contracts from vendors
- ✅ Track revenue from grid services
- ✅ Automated dispatch optimization
- ✅ Battery health and performance metrics
- ✅ Forecast-based planning tools

### For Energy Companies (Vendors)

- ✅ Post energy contract opportunities
- ✅ Review and accept bids from operators
- ✅ Track transaction history
- ✅ Manage multiple contracts
- ✅ Revenue and performance analytics

### For Grid Operators

- ✅ Synthetic reserve capacity
- ✅ Grid frequency stabilization
- ✅ Demand response capabilities
- ✅ Real-time VPP state visibility
- ✅ Predictive grid stress alerts

## 🔬 Testing

### API Testing with Qyrus QAPI

The project includes a comprehensive Swagger/OpenAPI specification (`backend_express/swagger.yaml`) for automated API testing.

**Upload to Qyrus QAPI:**
1. Import `backend_express/swagger.yaml` into QAPI
2. QAPI automatically generates test suites for all 50+ endpoints
3. Run automated tests for:
- Authentication flows
- Marketplace operations
- Telemetry ingestion
- Dispatch commands
- Agent coordination

**Test Coverage:**
- 50+ API endpoints
- 200+ test scenarios
- Complete workflow validation
- Authentication & authorization
- Error handling

## 📈 Performance Metrics

- **Latency**: < 100ms for telemetry ingestion
- **Throughput**: 1000+ messages/second via MQTT
- **Forecast Accuracy**: 85-90% for 24h load predictions
- **Grid Response Time**: < 5 seconds for reserve activation
- **API Response Time**: < 200ms average

## 🔐 Security

- JWT-based authentication for vendors
- Auth0 integration for operators
- SSH key encryption for edge node access
- Rate limiting on API endpoints
- CORS protection
- Input validation and sanitization

## 📚 Documentation

- **API Documentation**: `backend_express/swagger.yaml` (OpenAPI 3.0)
- **Setup Guide**: See individual module READMEs
- **Architecture**: See `AGENT_SYSTEM_IMPLEMENTATION.md` and `TRADING_SYSTEM_IMPLEMENTATION.md`

## 🤝 Contributing

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request

## 📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

## 🙏 Acknowledgments

- Built for India's energy resilience
- Designed to support sustainable AI infrastructure growth
- Enabling data centers to become active grid participants

## 📞 Contact

For questions, issues, or contributions, please open an issue on GitHub.

---

**Vusio** - Powering India's Digital Future with Intelligent Energy Management