📖 Documentation | 🚀 Quickstart | 📚 Guide | 🔧 Internals | 📋 Reference
A fast Rust-powered command-line toolkit for power-system modeling, flows, dispatch, and time-series analysis.
If you're comfortable running simple CLI commands and want to start doing real grid analysis — without needing a giant Python stack or a full simulation lab — GAT gives you industrial-grade tools in a form you can actually tinker with. Everything runs as standalone commands, and all the heavy lifting is Rust-fast.
- Why GAT?
- Installation
- Interfaces
- Quick Start
- CLI Reference
- Common Workflows
- Documentation
- Architecture & Crates
- Start with one command at a time
- Outputs are Parquet/Arrow/CSV — easy to open in Python, R, DuckDB, Polars
- Commands behave like Unix tools: pipeable, scriptable, reproducible
- Full DC/AC power-flow solvers (Newton-Raphson with Q-limit enforcement)
- DC/AC optimal power-flow (OPF) with polynomial/piecewise costs
- Full nonlinear AC-OPF with two backends:
- L-BFGS penalty method (pure Rust, portable, no external dependencies)
- IPOPT interior-point (analytical Jacobian/Hessian, all 68 PGLib cases validated with <0.01% gap)
- N-1/N-2 contingency analysis and screening
- GPU acceleration for Monte Carlo, contingency screening, and sensitivity analysis (wgpu)
- Time-series resampling, joining, aggregation
- State estimation (weighted least squares)
- Distribution automation (FLISR/VVO/outage coordination via ADMS)
- DER analytics (envelope aggregation, pricing-based scheduling via DERMS)
- Distribution system modeling (hosting-capacity analysis, AC OPF)
- Interactive terminal UI (TUI) for workflows, datasets, pipelines, and batch jobs
- Reliability metrics (LOLE, EUE, deliverability scores)
Rust gives you C-like execution speed without unsafe foot-guns. For grid models with thousands of buses/branches, that matters. Even on a laptop.
GAT scales with you:
- Two lines for a DC power flow
- A thousand AC-OPF scenarios on 20 machines when you need throughput
- All without Conda, Jupyter, or heavyweight clusters
The modular installer lets you choose components on the fly and installs to ~/.gat with no dependency on Rust:
curl -fsSL https://raw.githubusercontent.com/monistowl/gat/v0.5.7/scripts/install-modular.sh | bashThen add to your PATH:
export PATH="$HOME/.gat/bin:$PATH"By default, only the CLI is installed. Choose additional components:
# CLI + TUI (interactive dashboard)
GAT_COMPONENTS=cli,tui bash <(curl -fsSL https://raw.githubusercontent.com/monistowl/gat/v0.5.7/scripts/install-modular.sh)
# CLI + TUI + GUI dashboard (future)
GAT_COMPONENTS=cli,tui,gui bash <(curl -fsSL https://raw.githubusercontent.com/monistowl/gat/v0.5.7/scripts/install-modular.sh)
# Everything (CLI + TUI + GUI + native solvers)
GAT_COMPONENTS=cli,tui,gui,solvers bash <(curl -fsSL https://raw.githubusercontent.com/monistowl/gat/v0.5.7/scripts/install-modular.sh)Or from the downloaded script:
bash scripts/install-modular.sh --components cli,tui
bash scripts/install-modular.sh --prefix /opt/gat --components cli,tui,solversEverything installs under ~/.gat/:
~/.gat/
├── bin/ # Executables (gat, gat-tui, gat-gui, gat-cli)
├── config/ # Configuration (gat.toml, tui.toml, gui.toml)
├── solvers/ # Native solver binaries (gat-clp, gat-cbc, gat-ipopt)
└── cache/ # Dataset cache, run history
If you prefer bundled releases with docs, download and unpack a variant:
# Full variant (CLI + TUI + all features)
curl -fsSL https://github.com/monistowl/gat/releases/download/v0.5.7/gat-0.5.7-linux-x86_64-full.tar.gz | tar xz
cd gat-0.5.7-linux-x86_64-full
./install.sh
# Headless variant (CLI only, minimal footprint)
curl -fsSL https://github.com/monistowl/gat/releases/download/v0.5.7/gat-0.5.7-linux-x86_64-headless.tar.gz | tar xz
cd gat-0.5.7-linux-x86_64-headless
./install.sh --variant headlessIf no binary is available for your platform, both installers fall back to a source build. This requires Rust:
Go to https://rustup.rs to install the Rust toolchain.
Then:
# Full distribution: all solvers + TUI + visualization (~61 MB)
cargo build -p gat-cli --release --no-default-features --features dist
# Headless distribution: all solvers, no TUI/GUI (~60 MB, for servers)
cargo build -p gat-cli --release --no-default-features --features dist-headless
# Native distribution: includes IPOPT for AC-OPF (requires libipopt)
cargo build -p gat-cli --release --no-default-features --features dist-native
# Native headless: IPOPT without UI (for HPC/cluster deployments)
cargo build -p gat-cli --release --no-default-features --features dist-native-headlessThe binary lands under target/release/gat-cli.
| Feature | Solvers | TUI | Viz | IPOPT | Use Case |
|---|---|---|---|---|---|
dist |
clarabel, highs | ✓ | ✓ | — | End users (desktop/laptop) |
dist-headless |
clarabel, highs | — | ✓ | — | Servers, automation, CI |
dist-native |
clarabel, highs | ✓ | ✓ | ✓ | AC-OPF users (requires libipopt) |
dist-native-headless |
clarabel, highs | — | ✓ | ✓ | HPC clusters, batch AC-OPF |
For minimal or custom builds:
# Minimal (Clarabel only, lean dependencies)
cargo build -p gat-cli --release --no-default-features --features minimal
# Custom: specific solvers + features
cargo build -p gat-cli --release --no-default-features --features "solver-clarabel,solver-highs,tui,viz"GAT v0.5.7 includes vendored COIN-OR solver binaries that run as isolated subprocesses, communicating via Arrow IPC. This eliminates unsafe FFI from the main codebase while providing access to industrial-strength solvers.
Available native solvers:
| Solver | Binary | Problem Type | Use Case |
|---|---|---|---|
| CLP | gat-clp |
LP | DC-OPF, economic dispatch |
| CBC | gat-cbc |
MIP | Unit commitment (coming soon) |
| IPOPT | gat-ipopt |
NLP | AC-OPF (coming soon) |
Build native solvers from vendored sources:
# Build CLP solver
cargo xtask build-solvers clp
# Install to ~/.gat/solvers/
cargo xtask build-solvers clp --installUse native solvers in your code:
use gat_algo::opf::OpfSolver;
let solution = OpfSolver::new()
.with_method(OpfMethod::DcOpf)
.prefer_native(true) // Use CLP if available, fall back to Clarabel
.solve(&network)?;Generate shell completions once gat is in your PATH:
gat completions bash | sudo tee /etc/bash_completion.d/gat > /dev/null
gat completions zsh --out ~/.local/share/zsh/site-functions/_gat
gat completions fish --out ~/.config/fish/completions/gat.fish
gat completions powershell --out ~/gat.ps1Or source them on the fly:
source <(gat completions bash)If you're contributing to GAT:
- Install Rust: https://rustup.rs
- Clone the repository and run
cargo build - Optional helpers:
bd— the beads issue tracker (runbd readybefore you start work)beads-mcp— so MCP-compatible agents can inspect docs viagat-mcp-docsjq— required byscripts/package.sh
- See
RELEASE_PROCESS.mdfor our branch strategy (experimental → staging → main)
GAT works the way you do. Pick your interface:
For scripting, batch jobs, CI/CD pipelines, and reproducible workflows.
- All features available through the
gatCLI - Outputs in Arrow/Parquet for downstream tools (Polars, DuckDB, Spark)
- See
docs/guide/overview.mdfor command reference
gat pf dc grid.arrow -o flows.parquet
gat opf dc grid.arrow --cost costs.csv --limits limits.csv -o dispatch.parquet
gat batch pf --manifest scenario_manifest.json -d batch_results
# v0.6: Pipe JSON to stdout for downstream tools
gat pf dc grid.arrow -o - | jq '.[] | select(.flow_mw > 100)'For interactive exploration, workflow visualization, and real-time status monitoring.
The TUI is a 7-pane interactive dashboard built with Ratatui:
- Dashboard — System health, KPIs (Deliverability Score, LOLE, EUE), quick-action toolbar
- Commands — 19+ built-in command snippets, dry-run/execute modes, execution history, output viewer
- Datasets — Catalog browser, upload manager, scenario template browser with validation
- Pipeline — Workflow DAG visualization, transform step tracking, node details
- Operations — Batch job monitor, allocation results, job status polling
- Analytics — Multi-tab results: Reliability, Deliverability Score, ELCC, Power Flow with context metrics
- Settings — Display, data, execution, and advanced preferences
Launch it with:
gat-tuiOr, if running from source during development:
cargo run -p gat-tui --releaseNavigate with arrow keys, Tab to switch panes, Enter to select, Esc to close modals, q to quit. See crates/gat-tui/README.md for full keyboard shortcuts and feature details.
Status: Work in Progress — The GUI is functional but should be considered experimental.
A native desktop application built with Tauri 2.0 + Svelte 5 + D3.js for interactive grid visualization and analysis:
- Grid Visualization — Force-directed, schematic, and geographic layout modes with drag-and-drop positioning
- Power Flow — DC (fast linearized) and AC (Newton-Raphson) solvers with real-time results
- DC-OPF — DC Optimal Power Flow with LMPs and congestion detection
- N-1 Contingency Analysis — Security screening that identifies overloads for single-branch outages
- PTDF/LODF Analysis — Transfer sensitivity factors and line outage distribution factors
- Grid Summary — Bus/branch counts, MW totals, voltage ranges, graph statistics
- Island Detection — Find disconnected network components
- Thermal Analysis — Pre-contingency thermal headroom assessment
- Y-bus Explorer — Interactive admittance matrix visualization with sparsity patterns
- JSON Export — Full network model export for external tools
Launch from the GUI crate:
cd crates/gat-gui && pnpm install && pnpm tauri devOr build for production:
cd crates/gat-gui && pnpm tauri buildSee crates/gat-gui/README.md for architecture details and keyboard shortcuts.
gat import matpower --m test_data/matpower/edge_cases/case9.m -o grid.arrow
gat pf dc grid.arrow -o out/dc-flows.parquetWhat this does:
- Converts the bundled MATPOWER case9 to Arrow
- Solves the DC approximation (linear, very fast)
- Writes a Parquet branch-flow summary
gat opf dc test_data/matpower/case9.arrow \
--cost test_data/opf/costs.csv \
--limits test_data/opf/limits.csv \
--piecewise test_data/opf/piecewise.csv \
-o out/dc-opf.parquetInputs:
- Cost per bus/generator
- Dispatch limits
- Demand
- Optional piecewise cost curve segments
Outputs:
- Feasible dispatch
- Branch flows
- Violation flags
gat opf ac-nlp test_data/matpower/case9.arrow \
-o out/ac-opf.json \
--tol 1e-4 --max-iter 200 --warm-start flatFull nonlinear AC-OPF using penalty method with L-BFGS. Handles polar variables (V, θ) with explicit power balance constraints. Minimizes total generation cost subject to power balance and physical limits.
Options:
--tol: Convergence tolerance (default: 1e-4)--max-iter: Maximum iterations (default: 200)--warm-start: Initial point strategy -flat,dc, orsocp(default: flat)
gat inspect summary grid.arrow # Quick network summary
gat inspect generators grid.arrow # List all generators
gat inspect power-balance grid.arrow # Check feasibility
gat inspect json grid.arrow --pretty # Export as JSONDeep-dive analysis for debugging imports and understanding network structure.
gat benchmark pglib \
--pglib-dir /path/to/pglib-opf \
--baseline baseline.csv \
--out results.csvRun the AC-OPF solver against the industry-standard PGLib benchmark suite (68 MATPOWER cases from 14 to 19,402 buses). GAT's IPOPT backend reproduces all 68 reference objective values with <0.01% gap — matching the precision of commercial solvers.
gat-tuiBrowse datasets, check pipeline status, run commands with dry-run mode, view reliability metrics.
gat <category> <subcommand> [options]
gat import {psse,matpower,cim,pandapower,powermodels} # Import grid models
gat dataset public {list,describe,fetch} # Fetch public datasets
gat runs {list,describe,resume} # Manage previous runs
gat inspect {summary,generators,branches,power-balance,json} # Network diagnostics
gat graph {stats,islands,export,visualize} # Network topology
gat pf {dc,ac} # Power flows
gat opf {dc,ac,ac-nlp,admm} # Optimal dispatch (dc=LP, ac=SOR, ac-nlp=NLP, admm=distributed)
gat nminus1 {dc,ac} # Contingency screening
gat se wls # State estimation
gat tep solve # Transmission expansion planning (MILP)
gat ts {resample,join,agg} # Time-series tools
gat featurize {gnn,kpi} # Generate features
gat scenarios {validate,materialize,expand} # Define what-if cases
gat batch {pf,opf} # Parallel job execution
gat dist {pf,opf,hosting} # Distribution modeling
gat adms {flisr,vvo,outage} # Distribution automation
gat derms {aggregate,schedule,stress} # DER analytics
gat alloc {rents,kpi} # Allocation metrics
gat analytics {ptdf,reliability,elcc,ds,deliverability,multiarea} # Grid metrics
gat benchmark {pglib,pfdelta,opfdata} # Run solver benchmarks against public datasets
gat tui # Interactive terminal dashboard
gat gui run # Web dashboard (stub)
gat viz [options] # Visualization helpers
gat completions {bash,zsh,fish,powershell} # Shell completion
Use gat --help and gat <command> --help for detailed flags and examples.
gat import matpower case9.raw -o grid.arrow
gat pf dc grid.arrow -o flows.parquetgat-tui
# Then: Browse datasets, check pipeline, view reliability metrics# 1. Define scenarios
gat scenarios validate --spec rts_nminus1.yaml
# 2. Materialize into executable form
gat scenarios materialize \
--spec rts_nminus1.yaml \
--grid-file grid.arrow \
-d runs/scenarios
# 3. Execute as batch
gat batch opf \
--manifest runs/scenarios/rts_nminus1/scenario_manifest.json \
-d runs/batch/rts_opf \
--max-jobs 4
# 4. Inspect results
gat runs describe $(gat runs list --root runs --format json | jq -r '.[0].id')gat dist hosting --grid grid.arrow --der-file ders.csv -o hosting_curves.parquetgat analytics reliability --grid grid.arrow --outages contingencies.yaml -o results.parquetAll runs emit run.json with full argument list:
gat runs resume run.json --executeUse gat runs list --root <dir> to inspect saved manifests and gat runs describe <run_id> --root <dir> --format json for metadata before resuming.
- DC PF: fast, linear approximation
- AC PF: nonlinear, more accurate
- Adds costs, limits, and optional branch constraints
- Produces an optimized operating point
- Remove one branch at a time
- Re-solve DC flows
- Summarize and rank violations
Weighted least squares over branch flows & injections.
- Resample fixed-width windows
- Join multiple streams on timestamp
- Aggregate across sensors
All outputs follow consistent Arrow/Parquet schemas.
All major commands emit Parquet because it is fast, columnar, and compatible with Polars, DuckDB, Pandas, Spark, R, etc.
Every run also emits run.json with the full argument list so you can reproduce runs with:
gat runs resume run.json --executeThis makes CI, batch jobs, and fan-out pipelines reproducible.
- Rust delivers fast execution in a single binary — no Conda or Python stack
- Each CLI command stands alone so you can fan them out across multiple machines
- Slice work embarrassingly parallel:
parallel gat pf dc grid.arrow --out out/flows_{}.parquet ::: {1..500}If you know xargs -P or GNU parallel, you already know the essence of the workflow.
test_data/matpower/— MATPOWER casestest_data/opf/— cost curves, limits, branch limitstest_data/nminus1/— contingency definitionstest_data/se/— measurement CSVstest_data/ts/— telemetry examples
Modify these freely while experimenting.
Use gat dataset public list to preview curated datasets, optionally filtering with --tag or --query:
gat dataset public list --tag "ieee"
gat dataset public describe <id>
gat dataset public fetch <id>Downloaded datasets default to ~/.cache/gat/datasets (or data/public if unavailable). Override with:
--out <path>— specify staging locationGAT_PUBLIC_DATASET_DIR— set environment variable--force— refresh a cached copy--extract— unpack a ZIP file
Available datasets include:
opsd-time-series-2020— Open Power System Data time series (CC-BY-SA 4.0)airtravel— lightweight US air travel CSV for time-series examples
Q: I have v0.1, v0.3.x, or v0.4.x. How do I upgrade to v0.5.7?
A: v0.5.7 adds vendored COIN-OR solvers (CLP, CBC) as isolated binaries, eliminates unsafe FFI from the main codebase, and introduces the prefer_native() API for solver dispatch. Upgrade by re-running the installer:
curl -fsSL https://raw.githubusercontent.com/monistowl/gat/v0.5.7/scripts/install-modular.sh | bashThis installs to ~/.gat/bin/ by default (changed from ~/.local/bin/ in v0.1). Update your PATH:
export PATH="$HOME/.gat/bin:$PATH"Q: Can I keep multiple versions installed?
A: Yes. Use the --prefix flag to install v0.5.7 elsewhere:
bash scripts/install-modular.sh --prefix /opt/gat-0.5.7Then choose which to use in your PATH by ordering the paths or using full paths.
Q: What changed in v0.5.7?
A: Major improvements include:
- Vendored COIN-OR solvers — CLP (LP) and CBC (MIP) built from source, no system dependencies
- Isolated solver binaries — Native solvers run as subprocesses with Arrow IPC, eliminating unsafe FFI
prefer_native()API — Opt into native CLP for DC-OPF with automatic fallback to Clarabelcargo xtask build-solvers— Build and install native solvers from vendored sources- Trimmed dependencies — Reduced tokio feature footprint in gat-tui
- Deprecated
solver-coin_cbc— Use native dispatch instead of system CBC
See the release notes for the full changelog.
Q: Do I need the TUI?
A: No. The CLI is fully featured and standalone. The TUI is optional and great for:
- Interactive data exploration
- Workflow visualization
- Running batch jobs with live status monitoring
- Checking reliability metrics on-the-fly
Install it with:
GAT_COMPONENTS=cli,tui bash <(curl -fsSL https://raw.githubusercontent.com/monistowl/gat/v0.5.7/scripts/install-modular.sh)Q: What are the solver components for?
A: The solvers component includes native solver binaries (gat-clp, gat-cbc, gat-ipopt) built from vendored COIN-OR sources. These run as isolated subprocesses and provide industrial-strength optimization. Install with:
GAT_COMPONENTS=cli,solvers bash <(curl -fsSL https://raw.githubusercontent.com/monistowl/gat/v0.5.7/scripts/install-modular.sh)Or build from source:
cargo xtask build-solvers clp --installThen use them programmatically with prefer_native(true) or via CLI flags (coming soon).
Q: What features are in the "headless" variant?
A: headless includes the core CLI without TUI/GUI and minimal I/O dependencies. It's great for:
- Embedded systems or minimal containers
- Server-side batch jobs where no UI is needed
- Minimal binary size (~5 MB vs ~20 MB for full)
Install with:
bash scripts/install.sh --variant headlessQ: Where does GAT store configuration?
A: All config is in ~/.gat/config/:
gat.toml— Core CLI settings (data paths, solver preferences, logging)tui.toml— Terminal UI display and behaviorgui.toml— GUI dashboard preferences (future)
Edit these files directly or use the TUI Settings pane.
Q: How do I use a custom solver?
A: Edit ~/.gat/config/gat.toml:
[solver]
default_backend = "cbc" # or "highs", "clarabel"Or pass it per-command:
gat opf dc grid.arrow --solver highsQ: Where does GAT store datasets and cache?
A: Under ~/.gat/:
lib/solvers/— Solver binaries (read-only)cache/— Downloaded datasets and run history
Override with environment variables:
GAT_PREFIX=/data/gat # Use different install location
GAT_CACHE_DIR=/var/cache/gat # Custom cache
GAT_CONFIG_DIR=/etc/gat # Custom config locationQ: Can I pipe data between GAT commands?
A: Yes! v0.6 adds full stdout piping with -o -:
# Write JSON to stdout for piping
gat pf dc grid.arrow -o - | jq '.[] | select(.flow_mw > 50)'
# Inspect generators as JSON Lines
gat inspect generators grid.arrow -f jsonl | head -5
# Export to CSV
gat inspect branches grid.arrow -f csv > branches.csvMost workflows still use intermediate files (faster, debuggable):
gat pf dc grid.arrow -o flows.parquet
gat opf dc grid.arrow --pf-file flows.parquet -o dispatch.parquetQ: gat command not found after install?
A: Add ~/.gat/bin/ to your PATH:
export PATH="$HOME/.gat/bin:$PATH"Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.) to make it permanent.
Q: How do I uninstall GAT?
A: Simply remove the install directory:
rm -rf ~/.gat/Or, if you installed elsewhere:
rm -rf /opt/gat/ # Or whatever prefix you usedQ: I'm getting solver errors. How do I fix it?
A: Install the solver binaries:
GAT_COMPONENTS=cli,solvers bash <(curl -fsSL https://raw.githubusercontent.com/monistowl/gat/v0.5.7/scripts/install-modular.sh)Or build from source (slower but self-contained):
bash scripts/install.shFull documentation is available at monistowl.github.io/gat.
- Quickstart Guide — Get running in 5 minutes
- Power Flow — DC/AC power flow examples
- Optimal Power Flow — Economic dispatch with costs and limits
- N-1 Contingency — Security screening and reliability
- State Estimation — Weighted least squares estimation
- Time Series — Resample, join, aggregate operations
- ML Features — GNN and KPI feature extraction
- CLI Architecture — Command modules and dispatcher
- Feature Matrix — Build variants and solver options
- TUI Dashboard — Terminal UI architecture
- MCP Integration — Agent and LLM integration
- CLI Reference — Complete command documentation
- Schemas — JSON schemas for manifests and outputs
For offline access or development, documentation is also available in the docs/ directory:
docs/
├── guide/ # User guides (pf.md, opf.md, ts.md, etc.)
├── cli/ # Auto-generated CLI reference
├── schemas/ # JSON schemas
└── man/ # Man pages
Regenerate local docs with:
cargo xtask doc allgat-core— Grid types, DC/AC solvers, contingency analysis, state estimationgat-io— Data formats (Arrow, Parquet, CSV), schema definitions, I/O utilitiesgat-cli— Command-line interface, command modules, dispatchergat-tui— Terminal UI (Ratatui-based), 7-pane dashboard
gat-adms— FLISR/VVO/outage helpers for automatic distribution managementgat-derms— DER envelope aggregation, pricing-based scheduling, stress-test runnersgat-dist— MATPOWER import, AC flows, OPF, and hosting-capacity sweepsgat-algo— Advanced algorithms and solver backends (LP/QP abstraction)
gat-batch— Parallel job orchestration for batch solvesgat-scenarios— Scenario definition, materialization, and manifest generationgat-schemas— Schema helpers for Arrow/Parquet consistencygat-ts— Time-series resampling, joining, aggregationgat-viz— Visualization and graph layout tools
gat-solver-common— Arrow IPC protocol, subprocess management, shared typesgat-coinor-build— Build infrastructure for vendored COIN-OR librariesgat-clp— CLP linear programming solver binary (DC-OPF, economic dispatch)gat-cbc— CBC mixed-integer programming solver binary (unit commitment)gat-ipopt— IPOPT nonlinear programming solver binary (AC-OPF)
gat-gpu— Cross-platform GPU compute using wgpu (Vulkan/Metal/DX12/WebGPU)- WGSL shaders for power mismatch, Monte Carlo, LODF screening, PTDF
- Automatic CPU fallback when no GPU available
--gpuand--gpu-precisionCLI flags for acceleration control
For details on any crate, see its README.md in crates/<crate>/.
For local development:
- Read
RELEASE_PROCESS.mdfor our branch strategy (experimental → staging → main) - Check
AGENTS.mdfor agent integration and MCP setup - Run tests with
cargo test -p gat-tui(536+ tests currently) - Use
bdto track issues:bd readybefore starting,bd closewhen done
See LICENSE in the repository root.
