How to Use LLM Task in Openclaw

Image
Table of contents: [Show]

Quick Start

The LLM Task plugin lets you delegate specific prompts to different models within Openclaw workflows. Perfect for tasks like email classification, data extraction, or content generation—without switching your primary agent model.

LLM Task in Openclaw

For more advanced model integrations, check out our guide on LiteLLM Models Openclaw which offers a unified interface for multiple providers.

Enable the Plugin

Add this to your ~/.openclaw/openclaw.json:

{ "plugins": { "entries": { "llm-task": { "enabled": true } } }, "agents": { "list": [ { "id": "main", "tools": { "allow": ["llm-task"] } } ] } }

Configure Model Restrictions

Lock down which models the tool can call using allowedModels:

{ "plugins": { "entries": { "llm-task": { "enabled": true, "config": { "defaultProvider": "openai-codex", "defaultModel": "gpt-5.4", "defaultAuthProfileId": "main", "allowedModels": ["openai-codex/gpt-5.4"], "maxTokens": 800, "timeoutMs": 30000 } } } } }

If you need to chain multiple AI operations, you might also want to explore Lobster Tool Openclaw for workflow automation.

Use in Workflows

Invoke via CLI with structured output:

openclaw.invoke --tool llm-task --action json --args-json '{ "prompt": "Given the input email, return intent and draft.", "input": { "subject": "Hello", "body": "Can you help?" }, "schema": { "type": "object", "properties": { "intent": { "type": "string" }, "draft": { "type": "string" } }, "required": ["intent", "draft"], "additionalProperties": false } }'

Troubleshooting

  • Tool not found: Verify llm-task is in your agent's allow list
  • Model rejected: Check that the model is in allowedModels
  • Timeouts: Increase timeoutMs for slow providers

For complex multi-step reasoning tasks, consider using Tool Loop Detection to prevent runaway iterations.