lmstudio-subagents
This skill routes tasks to local LM Studio models via http://127.0.0.1:1234 and provides helper scripts (scripts/lmstudio-api.mjs, scripts/load.mjs, scripts/unload.mjs). It instructs running node/curl commands, writes a state file .lmstudio-state, and uses Authorization: Bearer lmstudio for authentication.
LM Studio Subagents Skill
An OpenClaw skill that equips agents to search for and offload tasks to local models running in LM Studio. This skill enables agents to discover available models, select appropriate ones based on task requirements, and use them for cost-effective local processing.
Features
- REST-only (no CLI) - Uses LM Studio v1 REST API only; no
lmson PATH required - Model discovery - Lists and selects from models via GET /api/v1/models
- Task offloading - Routes appropriate tasks to local models to save paid API tokens
- Stateful multi-turn - Optional response_id / previous_response_id for conversation context
- JIT loading - No explicit load required; first chat request loads the model (stats.model_load_time_seconds)
- No configuration required - Works with models in LM Studio without OpenClaw config setup
- Local processing - All processing happens locally for privacy
- Model selection - Supports LLMs, VLMs, and embedding models based on task needs
- Helper scripts - load.mjs, unload.mjs; lmstudio-api.mjs supports --stateful, --unload-after, --log; smoke test: test.mjs
Installation
Via ClawdHub (Recommended)
npm i -g clawdhub
clawdhub install lmstudio-subagents
Manual Installation
- Clone this repository or download the skill folder
- Place the
lmstudio-subagentsfolder in your OpenClaw skills directory:- Workspace:
<workspace>/skills/lmstudio-subagents/ - Global:
~/.openclaw/skills/lmstudio-subagents/
- Workspace:
Prerequisites
- LM Studio 0.4+ with server running (default: http://127.0.0.1:1234)
- No CLI required
- Models downloaded in LM Studio
Usage
The skill is automatically triggered when the agent needs to:
- Offload simple tasks to free local models (summarization, extraction, classification, rewriting, first-pass code review, brainstorming)
- Use specialized model capabilities (vision models for images, smaller models for quick tasks, larger models for complex reasoning)
- Save paid API tokens by using local models when quality is sufficient
- Process tasks locally for privacy
Example: "Use lmstudio-subagents to summarize this document"
How It Works
- Lists available models via GET /api/v1/models
- Optionally checks loaded_instances or runs scripts/load.mjs for explicit load
- Selects model by key and capabilities (vision, embedding, context)
- Calls POST /api/v1/chat via lmstudio-api.mjs (JIT loads model if needed)
- Parses output and optional response_id for stateful follow-up (--stateful persists id)
- Optionally runs scripts/unload.mjs or uses --unload-after on chat
Performance
Tested with LM Studio 0.4.x. JIT first-request load time in response stats.model_load_time_seconds. API call latency varies with generation length. Run scripts/test.mjs to verify setup.
License
MIT License - See LICENSE file for details.
Contributing
Contributions welcome! Please open an issue or pull request.
Links
- GitHub Repository - Source code and issues
- ClawdHub - Browse and install skills
- OpenClaw Documentation - Learn more about OpenClaw
- LM Studio - Download LM Studio