AIN - AI Node Plugin
简介
AIN - AI Node Plugin
原始描述
Integrates AIN providers into OpenClaw with intelligent model routing and tools for prompt execution and task classification.
通过你的 Agent 添加
安装目录:ain-ai-node-plugin/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
技能正文
AIN — AI Node Plugin for OpenClaw
Bridges the AIN provider registry, intelligent routing engine, and execution layer into the OpenClaw ecosystem.
What it does
- Provider bridging — All AIN-configured providers (LM Studio, Ollama, OpenAI, vLLM, etc.) are automatically exposed to OpenClaw as
ain:<name> providers
- LLM tools — Two agent tools:
ain_run (prompt execution with routing, structured output, fallback chains) and ain_classify (task type and complexity classification)
- Routing hook —
before_model_resolve hook uses AIN's intelligent routing engine to automatically select the best model for each task based on policies and task classification
Installation
npm install openclaw-plugin-ain
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).
Configuration
In your OpenClaw config:
{
"plugins": {
"ain": {
"enableRouting": true,
"routingPolicy": "local-first",
"exposeTools": true
}
}
}
Options
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
Tools
ain_run
| 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_run
Execute 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 temperature
Returns: { output, provider, model, usage, parsedOutput }
ain_classify
Classify a prompt's task type and estimate its complexity.
Parameters:
prompt(string, required) — The prompt to classify
Returns: { taskType, complexity }
Task types: classification, extraction, generation, reasoning, unknown
Complexity: low, medium, high
Routing
When enableRouting is true, the plugin registers a before_model_resolve hook that analyzes incoming prompts and selects the optimal model based on:
- Task classification (classification/extraction → fast tier, generation → general tier, reasoning → reasoning tier)
- Routing policies defined in
~/.ain/policies.yaml - Model tags and tier configuration
Requirements
- Node.js >= 18
- AIN configured with at least one provider (
ain config init && ain providers add ...)
- OpenClaw >= 1.0.0
License
ain config init && ain providers add ...)MIT
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。