A desktop application for analyzing PyPSA energy networks with an AI assistant.
- Load & Visualize PyPSA networks (.nc, .h5 files)
- Interactive Map with buses, lines, and links
- Run Optimizations with HiGHS solver
- AI Assistant for natural language interaction
- "Load the example network"
- "What generators are in this network?"
- "Run optimization" (with human approval)
- Real-time Logs during optimization
# Install pixi
curl -fsSL https://pixi.sh/install.sh | bash# Terminal 1: Start LLM server (first run downloads ~1.9GB model)
cd app/llm-server
./scripts/download_llamacpp.sh # One-time setup
./scripts/start.sh
# Terminal 2: Start backend
cd app/backend
pixi install
pixi run serve
# Terminal 3: Start frontend
cd app/frontend
npm install
npm run devcd app/frontend
npm startcd app/frontend
npm install
npm run dist:linuxOutput: release/GridAssistant-0.1.0.AppImage
Build on Windows:
# 1. Clone repository
git clone https://github.com/cdgaete/gridassistant.git
cd gridassistant
# 2. Download llama.cpp Windows binaries
cd app\llm-server\scripts
.\download_llamacpp.bat
# 3. Build installer
cd ..\..\frontend
npm install
npm run dist:winOutput: release\GridAssistant Setup 0.1.0.exe
User requirements:
- Install Pixi:
powershell -c "iwr -useb https://pixi.sh/install.ps1 | iex" - First launch downloads LLM model (~1.9GB) and Python dependencies
Build on macOS:
# 1. Clone repository
git clone https://github.com/cdgaete/gridassistant.git
cd gridassistant
# 2. Download llama.cpp macOS binaries
cd app/llm-server/scripts
./download_llamacpp.sh
# 3. Build DMG
cd ../../frontend
npm install
npm run dist:macOutput: release/GridAssistant-0.1.0.dmg
User requirements:
- Install Pixi:
curl -fsSL https://pixi.sh/install.sh | bash - First launch downloads LLM model (~1.9GB) and Python dependencies
app/
├── frontend/ # Electron + React + Vite
│ ├── src/ # React components
│ ├── electron/ # Electron main process
│ └── release/ # Built packages
├── backend/ # FastAPI + PyPSA
│ ├── app.py # Main API
│ └── ai_chat.py # AI chat service
└── llm-server/ # Local LLM
├── bin/ # llama.cpp binaries
└── scripts/ # Start scripts
The AI assistant uses:
- Salesforce xLAM-2-3b - Small model optimized for tool calling
- llama.cpp - CPU inference, no GPU required
- Human-in-the-loop - Dangerous operations require approval
| Command | Description |
|---|---|
| Load example network | Load PyPSA demo network |
| List networks | Show loaded networks |
| Network summary | Get bus/generator/line counts |
| Generator info | Generators by carrier type |
| Run optimization | Optimize (requires approval) |
| Optimization status | Check if running |
| Get results | Show optimization results |
The packaged application requires:
- Pixi installed on the system
- Internet connection on first run (to download LLM model ~1.9GB)
MIT
