Norbert d678a4d3d4 feat: ollama VRAM status + model loading/pinning on switch
- Show loaded models with VRAM usage bar (24GB 3090)
- On mode switch: unload old model, load+pin target model (keep_alive=-1m)
- Loading banner with spinner (polls faster at 2s while loading)
- Lab model changes also trigger model swap when in lab mode
- Manual load/unload API endpoints
2026-02-18 19:47:22 +00:00
2026-02-18 17:16:35 +00:00
2026-02-18 17:16:35 +00:00

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:

  1. Status: GET /api/status → reads agent model assignments
  2. Switch: POST /api/switch → patches agent models (qwen3 ↔ groq)
  3. Lab model: POST /api/lab-model → changes Eric's model

Config changes trigger an automatic gateway restart.

License

MIT

Description
Web UI to toggle OpenClaw agents between work and lab mode for exclusive GPU access
Readme 51 KiB
Languages
HTML 56%
Python 44%