AICalcX — AI Project Cost Calculator
2025 | Python, Microsoft Agent Framework, Chainlit, Azure Retail API | GitHub
AICalcX is 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.
Problem / Motivation
Organizations planning AI projects face critical challenges in cost estimation:
- Static Pricing: Traditional calculators use hardcoded prices that quickly become outdated
- Hidden Costs: Infrastructure, operations, and human resource costs are often overlooked
- Multi-Cloud Complexity: Difficult to compare costs across Azure, AWS, GCP, and other platforms
- Dynamic Workloads: Token consumption and resource usage are unpredictable
- Enterprise TCO: Hard to calculate accurate Total Cost of Ownership for large-scale AI deployments
- Transparency Issues: Black-box calculators provide no insight into cost breakdown methodology
AICalcX addresses these challenges with real-time pricing APIs, multi-agent orchestration, and transparent cost breakdowns that adapt dynamically to live Azure pricing, usage patterns, and AI model parameters.
Core Functionalities
Real-Time Pricing Intelligence
- Live Azure Pricing: Fetch current pricing from Azure Retail API with automatic updates
- Fallback Mechanisms: SerpAPI and cached JSON for when primary APIs are unavailable
- Cross-Cloud Ready: Azure support with upcoming AWS, GCP, Render, and Vercel integration
- No Hardcoded Prices: All pricing data sourced from live APIs or MCP-managed data
Multi-Agent Cost Analysis
- Intent Recognition: Natural language query parsing (e.g., "Cost of 1M GPT-4 tokens in eastus")
- AI Model Costs: Token-based pricing for GPT-4, embeddings, fine-tuning, and more
- Infrastructure Costs: Compute (VMs, containers), storage, and network bandwidth
- Human Resource Costs: Client-side and vendor-side personnel estimates
- Operational Overhead: Maintenance, monitoring, and contingency calculations
- Cost Aggregation: Unified reports with markdown tables and detailed breakdowns
Dynamic Scenario Simulation
- Token Computation: Understands shorthand notation (e.g., "500k", "2.5M", "1B")
- Usage Scaling: Model different user loads, agent counts, and token volumes
- Regional Pricing: Compare costs across Azure regions automatically
- SKU Variations: Handle multiple pricing tiers and subscription types
Transparent Reporting
- Detailed Breakdowns: Line-by-line cost calculations with formulas and references
- Export Options: Markdown, CSV, JSON, and PDF formats
- Live References: Links to Azure pricing sources for verification
- Analysis History: Local storage of previous cost analyses for comparison
Description / How It Works
- User Query: Submit natural language query or structured parameters via Chainlit web interface
- Intent Parsing: IntentAgent extracts model name, token count, region, and usage patterns
- Pricing Fetch: PricingAgent retrieves live Azure pricing via Retail API or MCP cache
- Fallback Handling: FallbackAgent uses SerpAPI or cached JSON if primary sources fail
- Multi-Agent Analysis: Parallel execution of specialized agents:
- AIAgent calculates model token costs
- InfraAgent estimates compute and storage
- HumanAgent computes personnel costs
- OpsAgent adds operational overhead
- Cost Aggregation: AggregatorAgent combines all outputs into unified markdown tables
- Result Visualization: Display interactive cost breakdown with export options
Agent Architecture
| Text Only | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | |
Each agent operates autonomously, fetching real-time data and updating a shared AgentContext before final aggregation.
Challenges & Issues Addressed
- Pricing Complexity: Multiple SKUs, dynamic regions, and unclear model mapping
- Azure API Gaps: Delayed updates and inconsistent SKU naming conventions
- Human Resource Variability: Non-standardized rates and team composition differences
- Usage Estimation: Unpredictable token consumption patterns across workloads
- Subscription Variations: Enterprise vs. retail pricing mismatches
- Cloud Type Differences: Public, government, and sovereign region pricing inconsistencies
Project Status: Experimental / WIP
AICalcX is currently in proof-of-concept stage due to several critical blockers. See BLOCKERS.md for detailed context on data mapping challenges, pricing API limitations, and enterprise pricing variations. The project demonstrates agentic cost computation using Microsoft Agent Framework but requires refined data sources before production readiness.
Tech Stack & Frameworks
- Languages / Frameworks: Python 3.10+, Chainlit (Web UI)
- AI Orchestration: Microsoft Agent Framework (multi-agent coordination)
- Pricing APIs: Azure Retail API, SerpAPI (fallback)
- Data Persistence: GitHub MCP Server (version-controlled pricing cache)
- In-Memory State: Pandas DataFrames, Python dictionaries (shared agent context)
- Visualization: Plotly charts, Markdown tables
- Export Formats: Markdown, CSV, JSON, PDF
Features / Capabilities
- Live Pricing Fetch: Azure Retail API with SerpAPI fallback
- Multi-Agent Orchestration: 8 specialized agents for modular cost computation
- Natural Language Queries: Parse "Cost of 1M GPT-4 tokens in eastus" automatically
- Dynamic Token Computation: Handle shorthand notation (500k, 2.5M, 1B)
- Cross-Cloud Ready: Azure support with 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 data from APIs or MCP-managed sources
- Export Options: Markdown, CSV, JSON, PDF formats
- Analysis History: Local storage for tracking previous cost calculations
Example Query & Result
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 AI Cost | — | — | — | $17.20 |
Additional infrastructure, human resource, and operational costs displayed in separate sections.
Potential Applications
- Enterprise AI Planning: Calculate accurate TCO before deploying large-scale AI systems
- Multi-Cloud Comparison: Compare costs across Azure, AWS, and GCP for cost optimization
- Budget Forecasting: Model different usage scenarios to predict monthly/annual costs
- Vendor Proposals: Generate detailed cost breakdowns for client proposals
- Cost Optimization: Identify expensive components and find cheaper alternatives
- Scenario Analysis: Test "what-if" scenarios for scaling AI workloads
- Compliance Reporting: Transparent cost calculations for audit and compliance
Future Enhancements
- Integrate AWS, GCP, Vercel, and Render pricing APIs
- Build interactive visualization dashboard with Plotly/Streamlit
- Add autonomous reasoning loop for cost optimization suggestions
- Implement budget alerting and cost tracking over time
- Develop REST/GraphQL API for programmatic access
- Add support for fine-tuning, batch inference, and GPU pricing
- Create browser extension for quick cost estimation
Learning Outcomes
- Built multi-agent orchestration system using Microsoft Agent Framework
- Integrated live cloud pricing APIs with fallback mechanisms
- Developed natural language query parsing for cost parameters
- Implemented modular agent architecture with specialized cost domains
- Designed shared agent context for coordinated multi-agent workflows
- Learned Azure Retail API nuances and pricing data structures
- Created transparent cost reporting with detailed formula breakdowns
Links
- GitHub Repository: AICalcX
- Known Blockers: BLOCKERS.md
Real-Time Pricing
AICalcX fetches pricing from Azure Retail API in real-time. Unlike static calculators, all costs reflect current Azure pricing. Prices may vary by region, subscription type, and cloud environment (public, government, sovereign).
Open Source Contribution
This project demonstrates how autonomous agents can perform real-time AI project cost computation using live cloud data and MCP-based orchestration. Contributions welcome to improve pricing accuracy, add cloud providers, or enhance agent logic.