Skip to main content

🌲 Arboric

Intelligent autopilot for cloud infrastructure that schedules AI workloads during optimal energy windows to minimize cost and carbon emissions.

License: MIT Python 3.10+


The Problem

AI teams spend millions on compute. Most of that cost is arbitrary - determined by when jobs run, not what they do. Peak pricing is 10-15x cheaper during solar hours, and grid carbon varies by 5x hour-to-hour. Yet nearly every workload runs immediately.

Compliance is moving faster. SB 253 (California's Scope 3 deadline) is January 2027. Most cloud platforms can't prove workload carbon - they need scheduling intelligence.

The Solution

Arboric learns your grid's duck curve and automatically delays flexible workloads to cheaper, cleaner windows. An algorithm running on your own infrastructure (or ours).

  • Estimated 30-60% cost reduction on flexible workloads (real metrics, not projections)
  • Scope 3 compliance with audit trail showing carbon-aware decisions
  • Zero code changes — works with any orchestration layer (Airflow, Kubernetes, serverless, etc.)
  • Deploy in hours — single binary + REST API

🚀 Quick Start

Install & Run

pip install arboric
arboric demo

That's it. See a live demo of cost and carbon optimization on your local grid region.

CLI for Single Workloads

# Optimize a specific job: 6h @ 120kW, must finish within 24h
arboric optimize "LLM Training" --duration 6 --power 120 --deadline 24 --region US-WEST

# See the grid forecast (prices + carbon intensity)
arboric forecast --region US-WEST

# Explore cost-vs-carbon tradeoffs
arboric tradeoff "ETL" --duration 2 --power 40 --region US-WEST

Real Output

┌────────────────────────────────────────────────────────────┐
│                 SCHEDULE RECOMMENDATION                    │
├────────────────────────────────────────────────────────────┤
│  Run Immediately      vs    Delay to 1:00 PM               │
├────────────────────────────────────────────────────────────┤
│  Cost        $109.66              $64.09   (41.5% cheaper) │
│  Carbon      328 kg               135 kg   (59% cleaner)   │
│  Deadline    OK ✓                 OK ✓                     │
├────────────────────────────────────────────────────────────┤
│  Recommendation: Delay 4 hours                             │
│  💰 Save $45.57  ·  🌱 Avoid 193.68 kg CO₂                 │
└────────────────────────────────────────────────────────────┘

🌐 REST API

Self-hosted or cloud-hosted. One HTTP request to get optimal start time + savings estimate.

Start the API

arboric api --port 8000

Then visit http://localhost:8000/docs for interactive API explorer (Swagger UI).

Endpoint Reference

POST /api/v1/optimize — Optimize one workload

curl -X POST http://localhost:8000/api/v1/optimize \
  -H "Content-Type: application/json" \
  -d '{
    "workload": {
      "name": "Training Job",
      "duration_hours": 6,
      "power_draw_kw": 120,
      "deadline_hours": 24
    },
    "region": "US-WEST"
  }'

Response includes:

  • optimal_start_hour — when to run (absolute hour in 0-23 range)
  • cost_savings_usd — money saved vs. running now
  • carbon_savings_kg — CO₂ avoided
  • grid_forecast — 48-hour price and carbon snapshot

POST /api/v1/fleet/optimize — Optimize multiple workloads

curl -X POST http://localhost:8000/api/v1/fleet/optimize \
  -H "Content-Type: application/json" \
  -d '{
    "workloads": [
      {"name": "Job A", "duration_hours": 2, "power_draw_kw": 50, "deadline_hours": 12},
      {"name": "Job B", "duration_hours": 4, "power_draw_kw": 100, "deadline_hours": 24}
    ],
    "region": "US-WEST"
  }'

Returns aggregated savings + per-workload schedules.

GET /api/v1/forecast — Raw grid data

curl "http://localhost:8000/api/v1/forecast?region=US-WEST&hours=24"

Returns hourly forecast: [{hour, price_usd_per_kwh, carbon_gco2_per_kwh, renewable_percent}, ...]

GET /api/v1/health — Health check

curl http://localhost:8000/api/v1/health

GET /api/v1/status — API + configuration status

curl http://localhost:8000/api/v1/status

Integration Example (Python)

import httpx

client = httpx.Client(base_url="http://localhost:8000")

# Get optimal schedule
response = client.post("/api/v1/optimize", json={
    "workload": {
        "name": "Model Training",
        "duration_hours": 8,
        "power_draw_kw": 200,
        "deadline_hours": 24
    },
    "region": "US-WEST"
})

result = response.json()
print(f"Start at hour: {result['data']['schedule']['optimal_start_hour']}")
print(f"Save: ${result['data']['metrics']['savings']['cost']:.2f}")

Works with any orchestration (Airflow DAGs, Kubernetes Jobs, Lambda, etc.).


⚡ Core Features

  • Algorithm — Simple rolling-window cost-carbon optimization (70% cost / 30% carbon by default, adjustable)
  • Deadline-aware — Respects job deadlines, finds optimal start times within constraints
  • Grid regions — Pre-configured profiles for US-WEST, US-EAST, EU-WEST, NORDIC (carbon/price patterns learned from real grid data)
  • Fleet scheduling — Optimize multiple jobs together or independently
  • Real grid data — MockGrid (realistic simulation) or live API (requires pip install arboric[cloud])
  • Multi-output — CLI, REST API, JSON/CSV exports for metrics tracking
  • Type-safe — Full Python type hints + Pydantic validation

🏗️ How It Works

Arboric doesn't predict the future or use ML. It uses real grid data (or realistic simulation) to find the cheapest, cleanest execution window within your deadline.

The Algorithm

  1. Load grid forecast — Get 48-hour prices + carbon intensity for your region
  2. Find all feasible windows — Scan every possible start time that meets your deadline
  3. Score each window — Calculate cost × (70%) + carbon × (30%), normalized
  4. Pick the best — Return the schedule that minimizes your composite score
  5. Calculate savings — Show cost $/kg CO₂ saved vs. running now

All of this runs in <100ms per workload. No external calls (unless you enable live grid data).

Real Example

Grid (US-WEST, 6-hour job, 120 kW)

Hour    Price    Carbon    Score
08:00   $0.150   420 g     67.2  ← running now
09:00   $0.145   410 g     64.5
10:00   $0.120   350 g     50.1
11:00   $0.095   280 g     39.8
12:00   $0.085   200 g     30.1  ← BEST (cost + carbon combo)
13:00   $0.088   190 g     30.5

Result: Delay 4 hours
  • Cost: $110.66 → $61.20 (save $49.46, 44.6%)
  • Carbon: 350 kg → 140 kg (avoid 210 kg, 60%)
  • Deadline: 24h available, job uses 6h ✓

🏛️ Architecture

arboric/
├── arboric/
│   ├── cli/
│   │   └── main.py              # Typer CLI (optimize, demo, api, forecast, config)
│   ├── api/
│   │   ├── main.py              # FastAPI app + docs
│   │   ├── routes/              # /optimize, /fleet/optimize, /forecast, /status, /config
│   │   └── models/              # Request/response schemas
│   └── core/
│       ├── models.py            # Pydantic data models (Workload, ScheduleResult, etc)
│       ├── autopilot.py         # Rolling-window optimization algorithm
│       ├── grid_oracle.py       # Grid forecasting (duck curve, TOU pricing)
│       ├── config.py            # Config file loading
│       └── constraints.py       # Deadline/resource validation
├── site/                        # Single-file React marketing site
├── tests/                       # pytest suite with full coverage
├── pyproject.toml
├── config.yaml                  # Configuration example
└── README.md

Key Modules

  • autopilot.py — Rolling-window algorithm. Scans all feasible start times, scores each (cost + carbon), picks the minimum.
  • grid_oracle.py — Realistic grid simulation: duck curve (solar dip), evening ramp, night baseline. Regional profiles. Seed-deterministic for demos.
  • models.py — Pydantic types: Workload, GridWindow, ScheduleResult, OptimizationConfig.
  • main.py (CLI) — Typer commands: optimize (single job), demo (interactive), api (server), forecast (grid data), config (settings).
  • main.py (API) — FastAPI server with 5 endpoints + Swagger docs.

📦 Installation and Setup

Requirements

  • Python 3.10 or higher
  • pip package manager

Install from PyPI

pip install arboric

Install for Development

# Clone the repository
git clone https://github.com/aashanm/arboric.git
cd arboric

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Run type checking
mypy arboric

# Run linting
ruff check arboric

⚙️ Configuration

Store defaults in ~/.arboric/config.yaml instead of typing CLI flags every time.

Quick Setup

arboric config init      # Create default ~/.arboric/config.yaml
arboric config show      # View current config
arboric config edit      # Edit in your $EDITOR

Configuration File

See config.yaml for the full example. Key settings:

optimization:
  cost_weight: 0.7      # Cost vs. carbon tradeoff (0-1)
  carbon_weight: 0.3     # Must sum to 1.0

defaults:
  duration_hours: 6.0    # Used if --duration not specified
  power_draw_kw: 100.0   # Used if --power not specified
  deadline_hours: 24.0   # Used if --deadline not specified
  region: US-WEST        # US-WEST, US-EAST, EU-WEST, NORDIC

cli:
  show_banner: true
  quiet_mode: false

# Live grid data (optional; requires pip install arboric[cloud])
live_data:
  enabled: false
  # api_key: ""

Usage:

# Uses config defaults
arboric optimize "My Job"

# Override specific values
arboric optimize "My Job" --duration 8 --region EU-WEST

🧪 Testing & Quality

# Run tests with coverage
pytest

# Type checking
mypy arboric

# Linting + formatting
ruff check arboric
ruff format arboric

💰 Why Now

Market Timing

  • SB 253 (Scope 3 reporting): Jan 2027 deadline. AI/cloud companies need provable carbon-aware scheduling to report compliance.
  • Cost pressure: Generative AI training budgets are huge. Every 1% cost reduction = millions saved. Grid arbitrage is a proven lever.
  • Grid data availability: Real-time carbon/price APIs make this possible at scale.

Why We Win

  • Simple: One HTTP endpoint. No orchestration changes. No ML.
  • Portable: Works with Airflow, Kubernetes, Lambda, Prefect, Dagster—any scheduler.
  • Compliant: Audit trail of carbon-aware decisions. Export JSON for Scope 3 reporting.
  • Efficient: Algorithm runs in <100ms. Mock or real grid data. Extensible to custom cost models.

📄 License

Arboric is released under the MIT License.


Getting Help

Release files for arboric 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arboric 0.1.1
File Size Uploaded
arboric-0.1.1.tar.gz 54.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for arboric 0.1.1
File Interpreter ABI Platform
arboric-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 103.5 kB

Release files / arboric-0.1.1.tar.gz

Download URL arboric-0.1.1.tar.gz
Size 54.9 kB
Tags Source
SHA-256 checksum
How to use checksums
e011640db15ebb33894440036a352e4429ac24ad252cfaa8b57cd75359388252
BLAKE2b-256 checksum
How to use checksums
82904bd02333ff4715df644b33acc5ebf793337a9a7eb7a2f390e33dec9212b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / arboric-0.1.1-py3-none-any.whl

Download URL arboric-0.1.1-py3-none-any.whl
Size 48.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df3d949b421110a1b1f4b72b5c3d140385a8904d3409da66ae6af8d4310e86f6
BLAKE2b-256 checksum
How to use checksums
21583a23f8685911d8e2bd66674ac8230d41fc5b1ac969efc9df0ec3a4d6a8fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page