CloudSpend Guardian is a full-stack FinOps application that ingests cloud billing files, detects spending anomalies, explains root causes with LLM-generated insights, and delivers actionable dashboards and reports.
This project helps teams monitor cloud spend proactively by combining:
- Data ingestion and normalization for billing files
- Hybrid storage for analytics and context-heavy records
- Rule-based anomaly detection
- AI-assisted anomaly explanations
- Streamlit dashboards and reporting tools for fast decision-making
Cloud costs are often reviewed too late, after overspending has already happened. Teams typically face:
- Delayed visibility into daily/service-level spend spikes
- Limited context when anomalies are detected
- Fragmented reporting across tools and formats
- Difficulty translating technical anomalies into business actions
CloudSpend Guardian addresses this by centralizing ingestion, analytics, anomaly detection, and AI-generated recommendations in one lightweight workflow.
- Upload billing files via API and Streamlit (
CSVandJSON) - Normalize and persist billing records
- Aggregate daily and service-level cost summaries
- Manage budgets by cloud account
- Detect anomalies using rolling-average and threshold logic
- Generate AI explanations for anomalies (OpenAI or Gemini)
- Convert USD spend to local currency (e.g., MYR) with FX API
- View dashboards, anomalies, AI insights, and monthly reports
- Export report summaries as CSV
- Framework: FastAPI
- Layers:
api/route handlersservices/business logicrepositories/database accessdb/connection + SQLAlchemy modelsschemas/Pydantic request/response contracts
- Framework: Streamlit
- Multi-page UI:
- Upload Data
- Dashboard
- Anomalies
- AI Insights
- Budgets
- Reports
CloudSpend Guardian uses a hybrid persistence strategy:
-
SQLite (SQLAlchemy) for structured analytics and operational entities:
budgetsanomaliesdaily_cost_summariesservice_cost_summariesreports(snapshot-ready model)
-
MongoDB Atlas for flexible/raw/contextual data:
raw_billing_records(raw + normalized ingestion rows)ingestion_logs(upload status and metadata)anomaly_diagnostics(detection context)ai_insights(full AI responses + prompt context)
This design keeps analytics fast and predictable while preserving rich diagnostic/AI context.
- OpenAI API (optional): anomaly explanation generation
- Google Gemini API (optional): alternative LLM provider
- Exchange Rate API (
open.er-api.com): USD to local currency conversion
- Create and activate a Python virtual environment
- Install dependencies:
pip install -r requirements.txt
- Configure environment:
cp .env.example .env
- Update
.envvalues (MongoDB URI, AI keys, FX settings) as needed
cd backend
uvicorn app.main:app --reloadcd frontend
streamlit run streamlit_app/Home.py- Open the Streamlit app home page
- Go to Upload Data and upload a sample billing file
- Open Dashboard to view total spend, trend, and service breakdown
- Open Budgets and create a budget for
globalor a cloud account - Open Anomalies and run detection
- Open AI Insights and generate explanation for an anomaly
- Open Reports to review monthly summary and export CSV
aws_quickstart_usage.csvgcp_quickstart_usage.jsonbaseline_usage.csvservice_spike_usage.csvbudget_breach_usage.csvmulti_anomaly_usage.csv
Use this script during presentation:
- “I’ll upload a monthly billing file and ingest it.”
- “Now we can see daily and service-level spend in the dashboard.”
- “I’ll set a budget threshold and run anomaly detection.”
- “Here’s a detected spike; now I’ll generate an AI explanation.”
- “Finally, I’ll open Reports and export a CSV summary for stakeholders.”
- Built a full-stack FinOps platform using FastAPI, Streamlit, SQLAlchemy/SQLite, and MongoDB Atlas for cloud cost ingestion, monitoring, and reporting.
- Designed a hybrid database architecture separating analytical summaries (SQL) from raw/diagnostic/AI context (NoSQL) to improve maintainability and query performance.
- Implemented rule-based anomaly detection (rolling averages + budget thresholds) and integrated LLM-powered incident explanations using OpenAI/Gemini APIs.
- Added currency conversion support with external FX API integration and delivered exportable monthly reporting for stakeholder-friendly cost visibility.
- Scheduled ingestion and detection jobs
- User authentication and role-based access
- Cloud-provider-native connectors (AWS CUR, GCP Billing Export, Azure Cost Management)
- Alerting channels (email/Slack/Teams)
- Historical model-based anomaly scoring (beyond rule-based detection)
- CI pipeline with automated test execution and coverage reporting