Install
openclaw skills install openclaw-plugin-ainIntegrates AIN providers into OpenClaw with intelligent model routing and tools for prompt execution and task classification.
openclaw skills install openclaw-plugin-ainBridges the AIN provider registry, intelligent routing engine, and execution layer into the OpenClaw ecosystem.
ain:<name> providersain_run (prompt execution with routing, structured output, fallback chains) and ain_classify (task type and complexity classification)before_model_resolve hook uses AIN's intelligent routing engine to automatically select the best model for each task based on policies and task classificationnpm install openclaw-plugin-ain
Requires @felipematos/ain-cli (installed as a dependency).
In your OpenClaw config:
{
"plugins": {
"ain": {
"enableRouting": true,
"routingPolicy": "local-first",
"exposeTools": true
}
}
}
| Option | Type | Default | Description |
|---|---|---|---|
configPath | string | ~/.ain/config.yaml | Path to AIN config file |
enableRouting | boolean | true | Enable intelligent model routing |
routingPolicy | string | — | Named routing policy from AIN policies.yaml |
exposeTools | boolean | true | Expose ain_run and ain_classify tools to agents |
ain_runExecute an LLM prompt through AIN's execution engine with full support for routing, structured output, and fallback chains.
Parameters:
prompt (string, required) — The prompt to executeprovider (string) — Provider namemodel (string) — Model ID or aliasjsonMode (boolean) — Request JSON outputschema (object) — JSON Schema for output validationsystem (string) — System prompttemperature (number) — Sampling temperatureReturns: { output, provider, model, usage, parsedOutput }
ain_classifyClassify a prompt's task type and estimate its complexity.
Parameters:
prompt (string, required) — The prompt to classifyReturns: { taskType, complexity }
Task types: classification, extraction, generation, reasoning, unknown
Complexity: low, medium, high
When enableRouting is true, the plugin registers a before_model_resolve hook that analyzes incoming prompts and selects the optimal model based on:
~/.ain/policies.yamlain config init && ain providers add ...)MIT