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

https://github.com/jasoncobra3/finops-copilot

An end-to-end AI-powered FinOps platform that ingests cloud billing data, analyzes cost trends, answers natural-language questions using a RAG pipeline (LangChain + FAISS + sentence-transformers + Groq), and provides actionable cost optimization recommendations. Includes a FastAPI backend and Streamlit dashboard UI - fully containerized with Docker
https://github.com/jasoncobra3/finops-copilot

ai-assistant cloud-cost-optimization cloud-enginee cost-analytics data-analysis devops docker faiss faiss-vector-database fastapi finops groq langchain llm pandas rag rag-pipeline sentence-transformers sqlite3 streamlit

Last synced: 5 days ago
JSON representation

An end-to-end AI-powered FinOps platform that ingests cloud billing data, analyzes cost trends, answers natural-language questions using a RAG pipeline (LangChain + FAISS + sentence-transformers + Groq), and provides actionable cost optimization recommendations. Includes a FastAPI backend and Streamlit dashboard UI - fully containerized with Docker

Awesome Lists containing this project

README

          

# ๐ŸŒฉ๏ธ AI-driven Cloud Cost Copilot (FinOps Assistant)

---

## ๐Ÿ“Œ Overview
**The FinOps Assistant is an AI-driven cloud cost analytics platform designed to help organizations monitor, analyze, and optimize their cloud spending.**
It provides:
- End-to-end pipeline: ETL โ†’ KPIs โ†’ RAG โ†’ Recommendations โ†’ API โ†’ UI
- KPI dashboards to analyze cost trends
- Natural-language Q&A over your cost data and FinOps documentation
- Actionable recommendations to reduce costs

[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/jasoncobra3/FinOps-Copilot)

---

## ๐Ÿงฉ Features

- Cost Analysis โ€” Monthly spend trends, top cost drivers, cost anomalies
- RAG Q&A โ€” Ask natural questions like โ€œWhy did compute cost increase in May?โ€
- Recommendations โ€” Detect idle resources, tagging gaps, sudden spikes
- UI + API โ€” Interactive Streamlit dashboard + FastAPI backend
- Evaluation Suite โ€” Measure retrieval quality (Recall@k) + answer quality

---

## ๐Ÿง  Architecture
![](docs/Assets/updated_architecture.png)

---

## ๐Ÿ—‚๏ธ Directory Structure

```
โ”œโ”€โ”€ app/
โ”‚ โ”œโ”€โ”€ main.py # FastAPI backend entrypoint
โ”‚ โ”œโ”€โ”€ models.py # SQLAlchemy schema (billing, resources)
โ”‚ โ”œโ”€โ”€ analytics.py # KPI & trend calculations
โ”‚ โ”œโ”€โ”€ rag.py # RAG pipeline setup (retriever + LLM)
โ”‚ โ”œโ”€โ”€ etl.py # ETL piepline to validate data
| โ”œโ”€โ”€ reccomendations.py # Suggestions Generation
| โ”œโ”€โ”€ rag_qa.py # LangChain QA chain logic
โ”‚ โ””โ”€โ”€ validators.py # input validation, prompt-injection guard
|
โ”œโ”€โ”€ docs/ # Project documentation
โ”‚ โ”œโ”€โ”€ finops.md # Refernce Docs for LLM
โ”‚ โ”œโ”€โ”€ PRD.pdf # Product requirement Document
โ”‚ โ”œโ”€โ”€ Technical Design doc.pdf
โ”‚ โ”œโ”€โ”€ Assets/
|
โ”œโ”€โ”€ UI/
โ”‚ โ””โ”€โ”€ app.py # Streamlit frontend dashboard
โ”œโ”€โ”€ scripts/
โ”‚ โ”œโ”€โ”€ ingest_billing.py
โ”‚ โ”œโ”€โ”€ seed _resources.py
โ”‚ โ”œโ”€โ”€ build_faiss_index.py
โ”‚ โ”œโ”€โ”€ update_assignments.py
| โ”œโ”€โ”€ manage_data.py
โ”‚ โ””โ”€โ”€ ...
|
โ”œโ”€โ”€ tests/ # Testing Files for evaluation
โ”‚ โ”œโ”€โ”€ conftest.py
โ”‚ โ”œโ”€โ”€ evaluate_rag.py
โ”‚ โ”œโ”€โ”€ test_analytics.py
โ”‚ โ”œโ”€โ”€ test_reccomendations.py
| โ”œโ”€โ”€ test_reccomendations_api.py
โ”‚ โ””โ”€โ”€ rag_eval_results.json
|
|
โ”œโ”€โ”€ data/ # SQLite DB (billing.db) & Data Files
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ docker-compose.yml
โ”œโ”€โ”€ .dockerignore
โ”œโ”€โ”€ .env.example
โ””โ”€โ”€ README.md

```
---

## โš™๏ธ Tech Stack

| Layer | Technology | Purpose |
| ------------- | ------------------------------------------------------------- | ----------------------------- |
| ETL & DB |Python, SQLAlchemy, SQLite | Data ingestion + schema |
| Analytics | Pandas, SQL | KPI & cost trend calculations |
| RAG Pipeline | sentence-transformers, FAISS, LangChain, Groq LLM | Natural-language Q\&A |
| API Layer | FastAPI | Serve KPIs and Q\&A endpoints |
| Frontend | Streamlit | Interactive dashboard UI |
| Deployment | Docker, Docker Compose | Containerization |
| Observability | LangSmith | Logging + traces |
| Security | Prompt-injection guards, keyword filters | Secure LLM input |

---

## ๐Ÿงช Setup & Running Locally

1. **Clone repo**
```bash
git clone https://github.com/jasoncobra3/FinOps-Copilot.git
cd FinOps-Copilot

2. **Create environment**
```bash
python -m venv .venv
source venv/bin/activate # or venv\\Scripts\\activate (Windows)

3. **Install dependencies:**
```bash
pip install -r requirements.tx

4. **Initialize DB**
```bash
python -m app.models

5. **Generate Sammple Data**
```bash
python scripts/generate_sample_data.py

7. **Ingest sample data**
```bash
python scripts/ingest.py --input data/sample_billing.csv
python scripts/seed_resources.py
python scripts/update_assignments.py ##generate randomness in data

9. **Build RAG index**
```bash
python scripts/build_faiss_index.py

10. **Run FAstAPI Backend**
```bash
uvicorn app.main:app --reload

- FastAPI - http://localhost:8000

12. **Run Streamlit Frontend**
```bash
streamlit run UI/app.py

- Streamlit - http://localhost:8501

---

## ๐Ÿ“Š Evaluation

**Run RAG retrieval evaluation**
```bash
python tests/eval_rag.py
```
- Outputs Recall@1/3/5 scores in CSV
- Also includes answer quality scores (1โ€“5 rubric)

---
## ๐Ÿง  Design Decisions & Trade-offs

- SQLite chosen for local simplicity, can migrate to PostgreSQL later
- FAISS is fast and lightweight for demo scale (vs hosted vector DBs)
- LangChain simplifies orchestration but adds abstraction โ†’ documented clearly
- Streamlit is quick to build for MVP, though not production-grade
- Groq LLM chosen to avoid dependency on paid APIs

---

## ๐Ÿš€ Future Work

- Migrate to PostgreSQL for multi-user deployments
- Add real billing data ingestion from cloud APIs
- Implement cost optimization engine (idle resource detection, right-sizing)
- Add user auth + role-based access control
- Enhance Streamlit UI (filters, charts, reports)
- Deploy on Railway or Render with CI/CD

---

## ๐Ÿ“ธ Screenshots
| Dashboard KPI View| Month DropDown | Reccommendations |
|----------------|------------|---------------|
| ![](docs/Assets/Screenshot_1.png) | ![](docs/Assets/Screenshot_2.png) | ![](docs/Assets/Screenshot_3.png)|

| Underutilized resources| AI RAG Chatbot | Response With Resource group |
|----------------|------------|----------------|
|![](docs/Assets/Screenshot_5.png)| ![](docs/Assets/Screenshot_7.png) | ![](docs/Assets/Screenshot_8.png) |

---
## ๐ŸŒŸ Contributing
**Feel free to fork, star, or submit a pull request to contribute improvements!**