Skip to main content

AI-powered multi-cloud cost optimization for humans

Project description

FinOps AI ๐Ÿค–โ˜๏ธ

Enterprise-Grade Multi-Cloud Cost Optimization Platform

Features โ€ข Quickstart โ€ข Providers โ€ข AI Engine โ€ข Configuration โ€ข Contributing


Python License Multi-Cloud

Stop paying for cloud resources nobody uses. FinOps AI scans your multi-cloud infrastructure, detects orphaned resources, estimates waste, and provides AI-powered recommendations โ€” saving enterprises an average of 30% on cloud spend.

๐Ÿš€ Features

Feature Description
Multi-Cloud Scanning Azure, AWS, and GCP โ€” one unified interface
14+ Resource Types Snapshots, disks, VMs, IPs, NICs, LBs, RDS, App Services, and more
AI/ML Engine Isolation Forest anomaly detection + Prophet cost forecasting
Smart Recommendations Prioritized, actionable savings with effort/risk ratings
Policy Engine YAML-driven governance with approval workflows
Dependency Graph NetworkX-powered safe-deletion analysis
Rich Reports HTML (dark theme), JSON, CSV, and Slack notifications
Beautiful CLI Click + Rich with color-coded output and progress bars

โšก Quickstart

Install

# Core package
pip install finops-ai

# With cloud providers
pip install finops-ai[azure]     # Azure only
pip install finops-ai[aws]       # AWS only
pip install finops-ai[gcp]       # GCP only
pip install finops-ai[all]       # All providers + ML

# Development
pip install finops-ai[dev]

First Scan

# Generate a config file
finops-ai init

# Scan Azure (uses CLI auth by default)
finops-ai scan --provider azure

# Scan all providers
finops-ai scan --provider all

# Scan with JSON report
finops-ai scan --provider azure --output json --report my_report.json

# Check version and installed providers
finops-ai version

Python API

from finops_ai.core.auth_manager import AuthManager
from finops_ai.providers.azure.snapshot_manager import AzureSnapshotManager

# Authenticate
credential = AuthManager.get_azure_credential()

# Scan for orphaned snapshots
manager = AzureSnapshotManager(credential)
result = manager.scan()

print(f"Found {result.total_resources} orphaned snapshots")
print(f"Estimated savings: ${result.total_estimated_cost:.2f}/month")

for resource in result.resources:
    print(f"  {resource.name}: ${resource.estimated_monthly_cost:.2f}/mo ({resource.age_days} days old)")

โ˜๏ธ Providers

Azure (7 Resource Types)

  • Snapshots โ€” Orphaned managed snapshots (source disk deleted)
  • Disks โ€” Unattached managed disks (with SKU-aware pricing)
  • Network โ€” Unused public IPs, detached NICs, idle load balancers
  • VMs โ€” Zombie VMs (stopped/deallocated > N days)
  • Storage โ€” Idle blob containers (>90 days no modification)
  • App Service Plans โ€” Plans with zero web apps
  • Resource Groups โ€” Empty resource groups

AWS (4 Resource Types)

  • EC2 โ€” Stopped instances (zombie VMs) + unused security groups
  • EBS โ€” Unattached volumes + orphaned snapshots (source volume deleted)
  • Network โ€” Unassociated Elastic IPs + idle ALBs/NLBs
  • RDS โ€” Orphaned manual snapshots (source DB deleted)

GCP (3 Resource Types)

  • Compute โ€” Orphaned snapshots + unattached disks + stopped VMs
  • Network โ€” Reserved (unused) static IPs (regional + global)
  • Storage โ€” Empty Cloud Storage buckets

๐Ÿง  AI Engine

from finops_ai.ml.anomaly_detector import AnomalyDetector
from finops_ai.ml.cost_forecaster import CostForecaster
from finops_ai.ml.recommender import SmartRecommender

# Anomaly detection (Isolation Forest)
detector = AnomalyDetector(contamination=0.1)
anomalies = detector.detect(resources)

# Cost forecasting (Linear/Prophet)
forecaster = CostForecaster()
forecast = forecaster.forecast_from_snapshots(historical_data, forecast_days=30)

# Smart recommendations
recommender = SmartRecommender()
report = recommender.analyze(resources)
print(f"Total savings: ${report.total_annual_savings:,.2f}/year")

โš™๏ธ Configuration

Generate a config file with finops-ai init, then customize:

dry_run: true
log_level: INFO

providers:
  azure:
    enabled: true
    auth:
      method: cli  # cli | managed_identity | service_principal
    subscription_id: ""

  aws:
    enabled: true
    auth:
      method: profile
    regions: [us-east-1, us-west-2]

  gcp:
    enabled: true
    auth:
      method: adc
    project_id: my-project

policies:
  policies_dir: ./policies
  enforce: false

ml:
  enabled: true
  anomaly_detection: true
  cost_forecasting: true

๐Ÿ—๏ธ Architecture

src/finops_ai/
โ”œโ”€โ”€ __init__.py              # Package root
โ”œโ”€โ”€ cli.py                   # Click + Rich CLI
โ”œโ”€โ”€ config.py                # Pydantic Settings configuration
โ”œโ”€โ”€ core/
โ”‚   โ”œโ”€โ”€ auth_manager.py      # Multi-cloud authentication
โ”‚   โ”œโ”€โ”€ base_manager.py      # Abstract base + data models
โ”‚   โ”œโ”€โ”€ graph_analyzer.py    # Dependency graph (NetworkX)
โ”‚   โ””โ”€โ”€ policy_engine.py     # YAML governance policies
โ”œโ”€โ”€ providers/
โ”‚   โ”œโ”€โ”€ azure/               # 7 Azure resource managers
โ”‚   โ”œโ”€โ”€ aws/                 # 4 AWS resource managers
โ”‚   โ””โ”€โ”€ gcp/                 # 3 GCP resource managers
โ”œโ”€โ”€ ml/
โ”‚   โ”œโ”€โ”€ anomaly_detector.py  # Isolation Forest
โ”‚   โ”œโ”€โ”€ cost_forecaster.py   # Prophet / linear regression
โ”‚   โ””โ”€โ”€ recommender.py       # Smart recommendations
โ”œโ”€โ”€ reporters/
โ”‚   โ”œโ”€โ”€ json_reporter.py     # JSON export
โ”‚   โ”œโ”€โ”€ csv_reporter.py      # CSV export
โ”‚   โ”œโ”€โ”€ html_reporter.py     # Standalone dark-theme HTML
โ”‚   โ””โ”€โ”€ slack_reporter.py    # Slack webhook (Block Kit)
โ””โ”€โ”€ utils/
    โ”œโ”€โ”€ logger.py             # Rich logging + JSON audit
    โ””โ”€โ”€ cost_calculator.py    # Cross-cloud pricing

๐Ÿงช Testing

# Run tests
pytest tests/ -v

# With coverage
pytest tests/ --cov=finops_ai --cov-report=html

๐Ÿ“‹ Migrating from TerraSnap-Govern

The original TerraSnap-Govern code has been preserved in legacy/. To migrate:

# Old way
python scripts/azure_snapshot_cleanup.py --subscription-id $SUB_ID

# New way
finops-ai scan --provider azure --resource-type snapshot -s $SUB_ID

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/my-feature
  3. Install dev dependencies: pip install -e ".[dev]"
  4. Make changes and add tests
  5. Run linting: ruff check src/
  6. Run tests: pytest tests/ -v
  7. Submit a pull request

๐Ÿ“„ License

MIT License โ€” see LICENSE for details.


Built with โค๏ธ for FinOps practitioners everywhere

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finops_ai-0.1.1.tar.gz (84.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finops_ai-0.1.1-py3-none-any.whl (71.7 kB view details)

Uploaded Python 3

File details

Details for the file finops_ai-0.1.1.tar.gz.

File metadata

  • Download URL: finops_ai-0.1.1.tar.gz
  • Upload date:
  • Size: 84.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for finops_ai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6451a1a66d54584cc89a579576d3891c97adff9c2d844c7810e3036f1dfc4f58
MD5 e57c5924499100351313580ec91e8ff5
BLAKE2b-256 ff4c67cb97f5dc2982d7e4d14d1e387b19a63ad29116e2f7cc5320987c912e8e

See more details on using hashes here.

File details

Details for the file finops_ai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: finops_ai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 71.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for finops_ai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef7fcf60fdc0b6802b96b6acfd0cd53c7690d6cc4314d0f6059b72da50222d52
MD5 0ef70a7da2c7b739e2a9086d2ce2e055
BLAKE2b-256 d93b912d9f67dade7250c74ca255cb970b9f90ee31f9acaedcdc041f8a9202f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page