Intelligent autopilot for cloud infrastructure - harvest optimal energy windows
Project description
๐ฒ Arboric
Intelligent autopilot for cloud infrastructure that schedules AI workloads during optimal energy windows to minimize cost and carbon emissions.
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 nowcarbon_savings_kgโ COโ avoidedgrid_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
- Load grid forecast โ Get 48-hour prices + carbon intensity for your region
- Find all feasible windows โ Scan every possible start time that meets your deadline
- Score each window โ Calculate cost ร (70%) + carbon ร (30%), normalized
- Pick the best โ Return the schedule that minimizes your composite score
- 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/arboric/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
- Questions? Open an issue on GitHub
- Want to contribute? PRs welcome. See CLAUDE.md for dev setup.
- Feedback? Reach out to team@arboric.dev
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arboric-0.1.0.tar.gz.
File metadata
- Download URL: arboric-0.1.0.tar.gz
- Upload date:
- Size: 54.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6bd4d634e636330667286db4bb2df4c8a628d3721f0b53b0aa3c8d915e184fa4
|
|
| MD5 |
086749f9061ff85a2cdea978749c1a6f
|
|
| BLAKE2b-256 |
2fe84bdd6e5d765a6957e606b515f6ff9bc3da90eef593cd44486142cf65ee21
|
File details
Details for the file arboric-0.1.0-py3-none-any.whl.
File metadata
- Download URL: arboric-0.1.0-py3-none-any.whl
- Upload date:
- Size: 48.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a66a9ac3fdf9d3d9fc8cee0cf0c3c21f2459c55f7cc67bd9993b5a27779e148
|
|
| MD5 |
990f474ffb152fe6b04c073a38b6f2be
|
|
| BLAKE2b-256 |
ed6d120d6955edc58ca8e2556a4cb83a663a181fb61ded1cc7d7e02806708c0a
|