GitHub - ShivamGoyal03/AICalcX: live pricing APIs, human resource cost inputs, and autonomous agents for multi-dimensional cost breakdowns. · GitHub
Skip to content

ShivamGoyal03/AICalcX

Repository files navigation

AI Project Cost Calculator (AICalcX)

A real-time, agentic cost intelligence system powered by the Microsoft Agent Framework, built to compute and visualize AI project costs dynamically using live cloud pricing and autonomous reasoning.

Portfolio AICalcX


🧩 Overview

AICalcX provides real-time, transparent, and intelligent cost estimation for AI projects — combining live pricing APIs, human resource cost inputs, and autonomous agents for multi-dimensional cost breakdowns.

Unlike static calculators, AICalcX adapts dynamically to live Azure pricing, usage patterns, and AI model parameters, producing accurate TCO (Total Cost of Ownership) for enterprise-scale AI workloads.


🚀 Features

  • Live Pricing Fetch — Azure Retail API + SerpAPI fallback
  • Multi-Agent Orchestration — modular agents for pricing, infra, AI, ops, and human cost
  • Natural Language Queries — e.g., “Cost of 1M GPT-4 tokens in eastus”
  • Dynamic Token Computation — understands shorthand (e.g., “500k”, “2.5B”)
  • Cross-Cloud Ready — Azure, AWS, GCP, Render, Vercel (upcoming)
  • Transparent Reports — detailed cost breakdowns with live references
  • Scenario Simulation — scale users, agents, or tokens dynamically
  • No Hardcoded Pricing — all fetched from APIs or MCP-managed data

🧠 Agent Roles

Agent Role
IntentAgent Interprets user queries and extracts model, token count, and region.
PricingAgent Fetches real-time cloud pricing via Azure Retail API or MCP cache.
FallbackAgent Uses SerpAPI or cached JSON when APIs fail or data is missing.
AIAgent Calculates AI model usage cost (tokens, embeddings, fine-tuning).
InfraAgent Estimates compute, storage, and network infrastructure costs.
HumanAgent Handles human resource cost — client-side and vendor-side personnel.
OpsAgent Computes operational overhead (maintenance, monitoring, contingency).
AggregatorAgent Consolidates all agent outputs into unified markdown tables.

🏗️ Architecture

User Query
   ↓
IntentAgent → PricingAgent → Azure Retail API
   ↓             ↑
FallbackAgent ← SerpAPI
   ↓
AIAgent / InfraAgent / HumanAgent / OpsAgent
   ↓
AggregatorAgent → Markdown / CSV Report Output

Each agent operates autonomously, fetching real-time data and updating a shared AgentContext before aggregation.


💬 Example Query

Prompt:

“Estimate cost of 1M GPT-4 input tokens and 500k output tokens in East US.”

Result:

Type Tokens Unit Price Formula Cost
Input 1,000,000 $0.0022/1K (1M ÷ 1K) × 0.0022 $2.20
Output 500,000 $0.0300/1K (500k ÷ 1K) × 0.03 $15.00
Total $17.20

⚙️ Tech Stack

Layer Tool / Framework Purpose
Frontend Chainlit Interactive query and report visualization
Core Engine Microsoft Agent Framework Multi-agent orchestration
Pricing Fetch Azure Retail API / SerpAPI Real-time pricing data
Data Persistence GitHub MCP Server Version-controlled pricing.json
In-Memory Context Pandas / Dict Shared agent state
Visualization Plotly / Markdown Cost breakdown rendering
Language Python 3.10+ Backend logic and integration

🔍 Functional Flow

  1. User Input
    • Fill project parameters via Chainlit or natural language query.
  2. Agent Execution
    • Each agent fetches or computes its domain-specific costs.
  3. Cost Aggregation
    • AggregatorAgent combines all outputs into a single structured report.
  4. Visualization & Export
    • Display breakdowns or export as CSV/JSON/PDF.

🧮 Usage Examples

  • Cost of Standard_D4s_v3 in eastus
  • Estimate 2M GPT-4 tokens in japaneast
  • Azure SQL Managed Instance DSU1500 cost
  • Render GPU instance 8GB VRAM

🧰 Setup

# Clone the repository
git clone https://github.com/ShivamGoyal03/AICalcX.git
cd AICalcX

# (Optional) Create a virtual environment
python -m venv .venv
source .venv/bin/activate   # or .venv\Scripts\activate on Windows

# Install dependencies
pip install -r requirements.txt

# Run the app
python app.py

🗺️ Roadmap

  • AWS / GCP / Vercel pricing integration
  • Visualization dashboard
  • Autonomous reasoning loop
  • Budget alerting and cost tracking
  • REST / GraphQL API support

⚠️ Known Limitations & Blockers

Refer to BLOCKERS.md for full context.
Summary of major challenges:

  1. AI Model Pricing Complexity – multiple SKUs, dynamic regions, unclear mapping.
  2. Human Resource Variability – non-standardized rates and team compositions.
  3. Deployment Costs – regional pricing differences and scaling complexity.
  4. Usage Estimation Uncertainty – unpredictable token consumption.
  5. Azure Pricing API Gaps – delayed updates and inconsistent SKUs.
  6. Subscription Variations – enterprise vs. retail pricing mismatches.
  7. Cloud Type Differences – public, government, and sovereign region issues.

These limitations led to temporary project suspension pending reliable, unified data mapping.


🧾 License

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


🤝 Contributing

Contributions are welcome!
If you'd like to improve agents, integrate new cloud providers, or enhance pricing logic, fork the repository and submit a pull request.


Note: This repository currently serves as a Proof of Concept (PoC) for open-source release, demonstrating how autonomous agents can perform real-time AI project cost computation using live cloud data and MCP-based orchestration.

About

live pricing APIs, human resource cost inputs, and autonomous agents for multi-dimensional cost breakdowns.

Resources

License

Stars

Watchers

Forks

Contributors

Languages