Multi-LLM Adapter for Openclaw

A universal adapter providing a unified interface for over 100 LLM providers with built-in failover and load balancing capabilities.

michealxie001
v1.0.0
Apr 2, 2026
0
731
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install oc-multi-llm

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install oc-multi-llm using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Multi-LLM Adapter?

The Multi-LLM Adapter is a robust integration layer designed for the Openclaw Skills ecosystem, enabling developers to interact with a vast array of Large Language Models through a single, consistent API. By leveraging LiteLLM, it bridges the gap between different provider schemas, allowing you to switch between OpenAI, Anthropic, Google Gemini, and local models like Ollama without changing your core logic.

Beyond simple connectivity, this skill addresses the critical needs of production AI applications: reliability and cost-efficiency. It features an intelligent fallback mechanism that automatically redirects requests to secondary providers if the primary service experiences downtime, ensuring your Openclaw Skills remain highly available even during API outages.

Multi-LLM Adapter Use Cases

  • High Availability Architectures: Automatically switch to a backup model provider when the primary service hits rate limits or experiences downtime.
  • Cost Management: Configure priority-based routing to utilize the most cost-effective models first, falling back to premium models only when necessary.
  • Model Comparison and A/B Testing: Side-by-side evaluation of responses from different providers like GPT-4 versus Claude 3 to determine the best fit for specific tasks.
  • Local vs Cloud Hybrid Workflows: Use local Ollama instances for sensitive data or development while bursting to cloud providers for complex reasoning tasks.

How Multi-LLM Adapter Works

  1. Provider Configuration: The system loads API keys and provider-specific settings from environment variables or a YAML configuration file.
  2. Client Initialization: The LLMClient instantiates a unified controller that manages the connection pool for all registered providers.
  3. Request Routing: When a chat request is initiated, the adapter selects the appropriate provider based on explicit choice, load balancing logic, or a predefined priority list.
  4. Execution & Fallback: The adapter attempts to call the selected LLM; if an error occurs and fallback is enabled, it automatically retries the request using the next provider in the chain.
  5. Response Normalization: The raw response from the provider is parsed and converted into a standardized format, including metadata like token usage and USD cost tracking.

Multi-LLM Adapter Setup

To integrate this into your Openclaw Skills environment, first configure your provider API keys:

export OPENAI_API_KEY=sk-...
export ANTHROPIC_API_KEY=sk-ant-...
export GEMINI_API_KEY=...
export OLLAMA_HOST=http://localhost:11434

You can then run a basic chat test using the CLI:

python3 scripts/main.py chat --provider openai --model gpt-4 "Hello"

For automatic selection based on priority:

python3 scripts/main.py chat --auto "Hello"

Multi-LLM Adapter Data Schema & Taxonomy

The Multi-LLM Adapter organizes its internal logic and configuration through a structured schema to ensure seamless Openclaw Skills integration:

Component Description Format
ProviderConfig Stores API keys, model names, priorities, and timeouts. YAML/Object
Client State Manages active provider instances and connection health. Memory/Internal
Usage Logs Tracks token consumption and estimated cost per request. JSON/Stdout
Tool Schema Standardized JSON definition for function calling across providers. JSON

Multi-LLM Adapter Advanced Features

  • Fallback Chain: Define an ordered list of providers to ensure 99.9% uptime for critical Openclaw Skills.
  • Intelligent Load Balancing: Support for Round Robin, Random, or Priority-based strategies to distribute traffic across multiple API keys or instances.
  • Real-time Cost Tracking: Built-in calculation of token usage and USD expenditure for every model interaction.
  • Stream Support: Native support for streaming responses to provide low-latency feedback in user interfaces.
  • Provider Management CLI: Comprehensive commands to list, test, add, or prioritize providers on the fly.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*