A skill plugin for HiClaw Manager that provides a web-based management interface for the AI Gateway.
- Provider Management — Add, remove, and configure LLM providers (Qwen, DeepSeek, OpenAI, etc.)
- Model Assignment — Set default models for Manager and individual Workers
- Dynamic Switching — Change models at runtime with automatic connectivity testing
- Pixel Art UI — Retro-style web interface with theme switching
- Backup & Restore — Automatic backups before configuration changes
Copy this directory to your HiClaw Manager's skills directory:
cp -r ai-gateway-management /opt/hiclaw/agent/skills/The skill will auto-start on Manager restart.
- Clone this repository
- Copy the contents to
manager/agent/skills/ai-gateway-management/in your HiClaw installation - Rebuild the Manager container
The management interface is accessible via multiple ways:
http://manager-local.hiclaw.io:8080
http://<your-server-ip>:8080/agm/
This allows access from LAN or internet without configuring a domain.
Default credentials:
- Username:
admin(orHICLAW_ADMIN_USERenv var) - Password: Set during installation (or
HICLAW_ADMIN_PASSWORDenv var)
# List all providers
bash scripts/list-providers.sh
# Create a new provider
bash scripts/create-provider.sh --type qwen --name qwen --token "sk-xxx"
# Set Manager model (with connectivity test)
bash scripts/set-model.sh --target manager --provider qwen --model qwen3.5-plus
# Set Worker model
bash scripts/set-model.sh --target worker:alice --provider deepseek --model deepseek-chat
# Get current assignment
bash scripts/get-assignment.sh manager
bash scripts/get-assignment.sh worker:alice
# Monitor server management
bash scripts/monitor-server.sh start
bash scripts/monitor-server.sh stop
bash scripts/monitor-server.sh statusai-gateway-management/
├── SKILL.md # Skill documentation (read by Agent)
├── README.md # This file (developer documentation)
├── scripts/ # CLI scripts
│ ├── monitor-server.sh # Python HTTP server for API
│ ├── list-providers.sh # List AI providers
│ ├── create-provider.sh # Create new provider
│ ├── set-model.sh # Set model (with testing)
│ └── get-assignment.sh # Get current model assignment
├── references/ # Reference documentation
│ └── api-reference.md # API specification
└── web/ # Web UI
└── index.html # Single-page application
- HiClaw Manager container
- Higress AI Gateway
- Higress Console (for provider management)
- MinIO (for config storage)
- mc (MinIO client)
-
Monitor Server (
monitor-server.sh)- Python HTTP server on port 18080
- Provides REST API for model management
- Handles Higress Console authentication
- Tests model connectivity before applying changes
-
Web UI (
web/index.html)- Single-page application (vanilla JS)
- Pixel art theme with animations
- Calls monitor server API
- Stores backups in browser localStorage
-
CLI Scripts
set-model.sh: Bash wrapper for model switchinglist-providers.sh: Query Higress Consolecreate-provider.sh: Create new AI providerget-assignment.sh: Read model assignments
Human Admin → Web UI / CLI → Monitor Server → Higress Console API
↓
MinIO (config storage)
↓
OpenClaw Config Reload
- Manager:
/agents/manager/model.json+/root/manager-workspace/openclaw.json - Worker:
/agents/{worker-name}/model.json+ MinIO sync
Format:
{
"provider": "qwen",
"model": "qwen3.5-plus",
"contextWindow": 200000,
"maxTokens": 64000,
"reasoning": true,
"updatedAt": "2024-01-15T10:30:00Z"
}All endpoints require authentication and are prefixed with /ni_status/.
Get system metrics.
Response:
{
"cpu": 45,
"memory": 62,
"connections": 12,
"rpm": 150,
"timestamp": "2024-01-15T10:30:00Z"
}Set Manager's model.
Request:
{
"provider": "qwen",
"model": "qwen3.5-plus",
"contextWindow": 200000,
"maxTokens": 64000,
"reasoning": true
}Response:
{
"success": true,
"target": "manager",
"provider": "qwen",
"model": "qwen3.5-plus",
"routeUpdated": true
}Set Worker's model.
Request: Same as Manager Response: Similar structure
Test provider connectivity.
Request:
{
"provider": "qwen",
"model": "qwen3.5-plus"
}Response:
{
"success": true,
"models": 150
}The system uses hybrid routing to support both single-provider and multi-provider scenarios:
Single Provider Mode (default):
- Only one route exists:
default-ai-route - All model requests go through this route
- Switching providers updates
default-ai-routeupstream
Multi-Provider Mode (automatic):
- When you add a second provider, the system creates separate routes
- Each route has
modelPredicatesto auto-route by model prefix - Example:
qwen-ai-routewithmodelPredicates: [{matchType: "PRE", matchValue: "qwen"}]minimax-ai-routewithmodelPredicates: [{matchType: "PRE", matchValue: "minimax"}]default-ai-routeremains as catch-all for unmatched models
How it works in practice:
- First provider → uses
default-ai-route - Second provider added → creates
{provider}-ai-routewith model predicates - Third+ provider → creates additional
{provider}-ai-route - Manager/Worker just specify model ID → Higress auto-routes to correct provider
-
Connectivity Test
- Query Higress Console for provider API key
- Send test request to
POST /v1/chat/completions - Verify response (must be HTTP 200 with choices)
-
Manage Routes
- Check existing AI routes
- If only
default-ai-routeexists → update it - If multiple routes exist → create new
{provider}-ai-routewithmodelPredicates
-
Update OpenClaw Config
- Add model to
models.providers["hiclaw-gateway"].models[](if new) - Set
agents.defaults.model.primarytohiclaw-gateway/{model} - Add alias to
agents.defaults.models[{model_id}]
- Add model to
-
Reload
- POST to
http://127.0.0.1:18799/api/reload - OpenClaw reloads config without restart
- POST to
-
Store Assignment
- Write to
/agents/{worker-name}/model.json
- Write to
-
Update Config (if Worker exists)
- Update
/agents/{worker-name}/openclaw.json - Sync to MinIO via
mc cp
- Update
-
Apply on Next Task
- Worker pulls config from MinIO on startup/task
- New model takes effect immediately
Symptom: set-model.sh fails with "Model not reachable"
Causes:
- Provider doesn't exist in Higress Console
- API key is invalid or expired
- Model name is incorrect
- Network connectivity issue
Solution:
- Open Higress Console → AI Providers
- Verify provider exists and has valid API key
- Test manually:
curl -H "Authorization: Bearer <key>" http://ai-gateway.hiclaw.io:8080/v1/models - Check monitor logs:
tail -f /tmp/monitor-server.log
Symptom: Model set but Manager doesn't use it
Solution:
- Verify OpenClaw is running:
ps aux | grep openclaw - Manual reload:
curl -X POST http://127.0.0.1:18799/api/reload - Check config:
jq '.agents.defaults.model.primary' /root/manager-workspace/openclaw.json - Restart Manager container if needed
Symptom: Worker model set but uses old model
Solution:
- Verify MinIO sync:
mc stat <bucket>/agents/<worker>/openclaw.json - Check Worker logs for config pull errors
- Restart Worker container
- Ensure Worker has correct Higress consumer permissions
Symptom: Blank page or 404
Solution:
- Verify Higress Manager UI route exists
- Check basic-auth is enabled for the route
- Clear browser cache and localStorage
- Check monitor server is running:
bash scripts/monitor-server.sh status
-
Start monitor server:
export HIGRESS_COOKIE_FILE=/tmp/higress-cookie.txt export HICLAW_ADMIN_USER=admin export HICLAW_ADMIN_PASSWORD=admin bash scripts/monitor-server.sh start
-
Test API:
curl http://localhost:18080/ni_status/health curl http://localhost:18080/ni_status/providers
-
Open web UI in browser:
http://localhost:18080
- Update
monitor-server.shPython code for new API endpoints - Update
web/index.htmlfor UI changes - Update
SKILL.mdandREADME.mddocumentation - Test with
set-model.shand manual API calls
MIT License
- Fork the repository
- Create a feature branch
- Make changes and test thoroughly
- Submit a pull request
For issues or questions:
- Check troubleshooting section above
- Review monitor logs:
/tmp/monitor-server.log - Consult HiClaw documentation:
docs/directory