Simple web UI to toggle OpenClaw agents between work mode (qwen3 on ollama) and lab mode (groq cloud fallback), giving the lab agent exclusive GPU access. Features: - One-click mode switching - Real-time agent status - Lab model selector - Direct config file patching + gateway restart
1.9 KiB
1.9 KiB
Ollama GPU Switcher
A simple web UI to toggle OpenClaw agents between work mode (local ollama inference) and lab mode (cloud fallback), so experiments get exclusive GPU access.
The Problem
With a single GPU (RTX 3090), loading different models causes VRAM swaps. When the lab agent (Eric) loads granite4 while other agents are using qwen3, both tasks fail. This tool lets you switch all non-lab agents to cloud (groq) with one click.
Modes
| Mode | GPU Agents | Lab Agent | GPU Status |
|---|---|---|---|
| 🛠️ Work | qwen3-128k:14b (ollama) | granite4 (ollama) | Shared |
| 🧪 Lab | groq (cloud) | granite4 (ollama) | Exclusive for lab |
Features
- One-click mode switching (work ↔ lab)
- Real-time agent status display
- Lab model selector (change what Eric runs)
- Auto-refresh every 30s
- Dark theme, mobile-friendly
- No LLM involved — pure config switching via OpenClaw gateway API
Setup
pip install -r requirements.txt
Usage
# Set your gateway token (from openclaw.json)
export OPENCLAW_GATEWAY_TOKEN="your-token-here"
# Run on port 8585 (default)
python app.py
# Or custom port
PORT=9090 python app.py
Then open http://localhost:8585 in your browser.
Environment Variables
| Variable | Default | Description |
|---|---|---|
OPENCLAW_GATEWAY_URL |
http://127.0.0.1:18789 |
Gateway API endpoint |
OPENCLAW_GATEWAY_TOKEN |
(empty) | Gateway auth token |
PORT |
8585 |
Web UI port |
How It Works
The app reads and patches the OpenClaw gateway config via its REST API:
- Status:
GET /api/status→ reads agent model assignments - Switch:
POST /api/switch→ patches agent models (qwen3 ↔ groq) - Lab model:
POST /api/lab-model→ changes Eric's model
Config changes trigger an automatic gateway restart.
License
MIT