🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

AIN - AI Node Plugin

by @felipematos

Integrates AIN providers into OpenClaw with intelligent model routing and tools for prompt execution and task classification.

Versionv0.11.6
Downloads677
TERMINAL
clawhub install openclaw-plugin-ain

πŸ“– About This Skill

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: 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
    

    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

    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 execute
  • provider (string) β€” Provider name
  • model (string) β€” Model ID or alias
  • jsonMode (boolean) β€” Request JSON output
  • schema (object) β€” JSON Schema for output validation
  • system (string) β€” System prompt
  • temperature (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

    MIT

    βš™οΈ 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 |