Skip to content

chaitra-samant/Dhara-Ecosystem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Dhara Ecosystem: Real-Time GenAI Sustainability Observability

An end-to-end observability suite designed to make the carbon footprint of Generative AI visible and actionable. By bridging the gap between infrastructure performance and environmental impact, Dhara allows developers to track, forecast, and optimize LLM emissions in real-time.

Screenshots · Frontend (React) · Library (Python)

Overview
Sessions
Optimisation
Models

The Problem

As GenAI scales, its carbon footprint is becoming a boardroom-level concern. Developers currently lack tools to measure the energy cost of individual inference calls, making it impossible to meet ESG (Environmental, Social, and Governance) targets or optimize for "Green" compute windows.


The Solution

Dhara provides a zero-config solution consisting of two modules:

  • dhara (Python SDK): A lightweight library that instruments any LLM call (OpenAI, Anthropic, LangChain) with just two lines of code.
  • Dhara Drishti (Cloud Dashboard): A high-performance React dashboard that visualizes telemetry, provides "What-If" scenario planning, and generates TCFD-compliant sustainability reports.

Key Features

1. Real-Time Emissions Intelligence

  • Granular Telemetry — Captures latency, token counts, and energy consumption (kWh) per request
  • Live Grid Signals — Correlates LLM usage with real-time regional grid intensity (gCO₂/kWh)
  • Hardware-Aware Math — Custom estimation model based on GPU Thermal Design Power (TDP) and memory overhead

2. Optimization & Strategy

  • Carbon-Aware Routing — Recommends optimal regions or "Green Hours" (7 PM–9 AM) to reduce footprint by up to 70%
  • Model Playground — Benchmark the efficiency of different architectures (e.g., Llama-3 vs. GPT-4o)
  • What-If Scenario Planner — Predictive tool for engineering teams to estimate the annual carbon impact of scaling

3. Enterprise-Ready Reporting & Gamification

  • TCFD Reports — One-click PDF generation for Task Force on Climate-related Financial Disclosures
  • Eco-Gamification — Sustainability Score and XP-based leaderboard to incentivize green coding practices
  • API Control Center — Secure Auth Token management and interactive technical specs for DevOps integration

Technical Architecture

Layer Technology
Frontend Vite, React 18, TypeScript, Tailwind CSS, Shadcn UI
State Management Zustand + Supabase real-time subscriptions
Backend / API Next.js Edge Functions, Node.js / Express
Database Supabase (PostgreSQL) with Row Level Security
Library Python (asyncio) with automated hardware-profile mapping
┌─────────────────────────┐        ┌──────────────────────────┐
│   dhara Python SDK      │──WS──▶ │  Dhara Drishti Dashboard │
│  @track_inference(...)  │        │  Vite + React + Supabase │
└─────────────────────────┘        └──────────────────────────┘
         │                                      │
         ▼                                      ▼
  LLM API call                        PostgreSQL (Supabase)
  (latency, tokens)                   sessions / interactions
         │                            recommendations / users
         ▼
  Emission Calculator
  (TDP × latency × grid intensity)

Quick Start: Instrument in 2 Lines

from dhara import track_inference
import nest_asyncio; nest_asyncio.apply()

# Decorate any LLM function — Dhara handles the rest
@track_inference(auth_token="YOUR_DHARA_TOKEN")
async def call_ai(prompt):
    return await llm.invoke(prompt)

System Walkthrough

Global Overview Real-time monitoring of CO₂, Energy, and Latency
Model Efficiency Benchmarks Comparing carbon intensity across different LLMs
Optimization & Routing Predictive forecasting and carbon-aware routing
Developer Experience Zero-config integration and API documentation

Why This Matters

Dimension What it demonstrates
Full-Stack Ownership Built both a developer SDK and a complex data-viz product end-to-end
Data-Driven Real-time data streaming, PostgreSQL, and mathematical emission modelling
Product Thinking Solves a modern enterprise problem (ESG compliance) with UX and gamification

Project Structure

allianz-esg/
├── dhara/               # Python SDK (pip-installable)
│   └── src/dhara/
│       ├── tracker.py   # @track_inference decorator
│       ├── calculator.py# GPU TDP emission model
│       └── websocket.py # Dashboard streaming client
└── dhara-drishti/       # Cloud Dashboard + API
    ├── src/             # React frontend (Vite)
    ├── dhara-api/       # Next.js Edge tracking API
    ├── server/          # Express PDF/CSV report server
    └── scripts/         # DB seed utilities

Developed by Chaitra Samant

About

Full-stack GenAI sustainability suite. Includes a Python SDK for automated telemetry & a React/TS dashboard for carbon-aware LLM optimization and TCFD reporting.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors