zerogpu-router
v0.2.1
Published
ZeroGPU Router for OpenCLAW with hosted routing and task offload
Maintainers
Readme
ZeroGPU Router
OpenCLAW skill and CLI for routing focused tasks directly to the ZeroGPU API.
The main production path does not require a hosted adapter. The zerogpu-router CLI calls:
https://api.zerogpu.ai/v1/responseswith the user's x-api-key and x-project-id headers.
Quick Start For Users
Install and configure with OpenCLAW's native plugin flow:
openclaw plugins install zerogpu-router
openclaw gateway restartThis registers ZeroGPU as an available provider and exposes task offload tools such as zerogpu_summarize, zerogpu_classify, zerogpu_extract, and zerogpu_followups. It does not change the user's primary model. Keep your normal OpenCLAW model, such as nearai/auto, as the default brain.
Configure credentials with the hosted installer:
curl -fsSL https://raw.githubusercontent.com/zerogpu/ZeroGPU-OpenClaw-Plugin/main/scripts/setup-openclaw-provider.sh | bashThe installer asks for:
ZeroGPU API keyZeroGPU project ID
It stores those credentials locally in ~/.openclaw/zerogpu/config.json, and installs local zerogpu skill guidance so the normal agent knows when to call the offload CLI. Your primary model remains unchanged.
For OpenCLAW Cloud environments where restart is handled by the UI:
curl -fsSL https://raw.githubusercontent.com/zerogpu/ZeroGPU-OpenClaw-Plugin/main/scripts/setup-openclaw-provider.sh | SKIP_GATEWAY_RESTART=1 bashThen restart or reload the gateway from the OpenCLAW Cloud UI.
Verify the skill and provider are visible:
openclaw config get models.providers.zerogpu
openclaw skills list | grep -i zerogpu
$HOME/.openclaw/bin/zerogpu-router summarize "Summarize this sentence."To intentionally make ZeroGPU the global default model, opt in explicitly:
curl -fsSL https://raw.githubusercontent.com/zerogpu/ZeroGPU-OpenClaw-Plugin/main/scripts/setup-openclaw-provider.sh | SET_ZEROGPU_AS_DEFAULT=1 bashLocal Plugin Development
If you want to inspect or modify the plugin locally:
git clone https://github.com/zerogpu/ZeroGPU-OpenClaw-Plugin.git
cd ZeroGPU-OpenClaw-Plugin
npm install
npm run checkYou can still run the fallback setup helper locally:
ZEROGPU_API_KEY="YOUR_ZEROGPU_API_KEY" \
ZEROGPU_PROJECT_ID="YOUR_ZEROGPU_PROJECT_ID" \
npm run setup:openclawOptional Hosted Adapter
The Render adapter is optional/legacy. It is useful only if you want a shared OpenAI-compatible bridge endpoint with dashboard events:
- Create a Render Web Service from this repo.
- Use build command
npm install. - Use start command
npm start. - Set health check path
/health.
Do not add ZEROGPU_API_KEY or ZEROGPU_PROJECT_ID to Render. Users provide those during OpenCLAW setup.
Local Development
npm install
npm startThe server listens on http://localhost:8787 by default.
Useful checks:
curl http://localhost:8787/health
curl http://localhost:8787/v1/models
curl http://localhost:8787/v1/zerogpu/modelsDebug calls can pass credentials directly:
curl -X POST http://localhost:8787/v1/chat/completions \
-H "content-type: application/json" \
-H "x-api-key: YOUR_ZEROGPU_API_KEY" \
-H "x-project-id: YOUR_ZEROGPU_PROJECT_ID" \
-d '{
"model": "zerogpu/summarize",
"messages": [
{ "role": "user", "content": "Summarize this feature request in 3 bullets." }
]
}'The old endpoint remains available as a compatibility alias:
POST /v1/zerogpu/chat/completions
Model Aliases
zerogpu/autoroutes based on task detection.zerogpu/chatuses general chat.zerogpu/chat-thinkinguses reasoning-oriented chat.zerogpu/summarizeroutes summarization.zerogpu/classifyroutes classification.zerogpu/extractroutes extraction.zerogpu/followupsroutes follow-up question generation.
Dashboard
The adapter keeps the dashboard idea from the original prototype:
GET /dashboard/events?limit=50GET /dashboard/summary
Runtime events are written to plugin/tracking-events.jsonl. That file is generated on demand and should not be committed.
Configuration
The plugin package includes:
openclaw.plugin.jsonfor OpenCLAW plugin metadata.openclaw-plugin.cjsfor provider registration and setup wizard support.skills/zerogpu/SKILL.mdfor OpenCLAW skill metadata.scripts/setup-openclaw-provider.shas a fallback no-clone installer.
Optional environment variables:
PORTdefaults to8787.MODEL_CATALOG_URLdefaults tohttps://api-dashboard.zerogpu.ai/api/models.INFERENCE_API_URLdefaults tohttps://api.zerogpu.ai/v1/responses.INFERENCE_TIMEOUT_MSdefaults to10000.INFERENCE_MAX_RETRIESdefaults to2.DEFAULT_SHOW_SAVINGSdefaults totrue.ENABLE_AUTO_TASK_INFERENCEdefaults tofalse. Settrueto enable keyword-based task inference forzerogpu/auto.
ZEROGPU_API_KEY and ZEROGPU_PROJECT_ID are only supported as local development fallbacks. Hosted deployments should rely on per-request credentials from OpenCLAW.
Verify
npm run check
bash -n scripts/setup-openclaw-provider.sh
curl http://localhost:8787/health
curl http://localhost:8787/v1/models