2.0 KiB
2.0 KiB
SolFuse
SolFuse is a privacy-preserving federation layer for hybrid microgrids. It coordinates solar, wind, and thermal storage sites through summarized signals, incremental plan deltas, and auditable governance instead of raw data exchange.
What It Provides
- Canonical protocol primitives for local optimization, shared signals, dual variables, and plan deltas
- A SQLite-backed graph-of-contracts registry for adapter versioning and schema conformance
- An ADMM-lite solver for federated dispatch planning
- Signed message envelopes and DID-style identities for short-lived trust
- Audit logging and privacy-budget accounting
- Delta-sync journaling for islanded/offline operation
Package Layout
solfuse.models: protocol objects and canonical payload schemassolfuse.identity: identity generation, signing, and verificationsolfuse.registry: adapter registry and schema conformance checkssolfuse.solver: federated consensus solversolfuse.delta_sync: incremental plan journal and replay helperssolfuse.governance: audit log and privacy budget ledgersolfuse.transport: canonical envelope serialization and TLS context helperssolfuse.cli: small demo entry point
Quick Start
python3 -m pip install -e .[dev]
pytest
solfuse demo
Minimal Example
from solfuse.models import LocalProblem
from solfuse.solver import ADMMLiteSolver
solver = ADMMLiteSolver(rho=1.0, tolerance=1e-6, max_iterations=100)
result = solver.solve([
LocalProblem(site_id="solar-a", preferred_dispatch=[4.0, 4.5], quadratic_weight=2.0),
LocalProblem(site_id="storage-b", preferred_dispatch=[1.0, 1.5], quadratic_weight=1.5),
])
print(result.consensus)
Governance Model
Each message can be wrapped in a signed envelope, recorded in the audit ledger, and charged against a privacy budget. Contract adapters are versioned and validated against JSON Schema so controllers can be swapped without changing the federation core.
Testing And Build
bash test.shpytestpython3 -m build