model-failover

Automatically switch between LLM providers when one fails. Supports configurable fallback chains, rate limiting, and health monitoring. Inspired by OpenClaw's model failover system.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "model-failover" with this command: npx skills add winsorllc/upgraded-carnival/winsorllc-upgraded-carnival-model-failover

Model Failover Skill

Automatically switch between LLM providers when one fails. Supports configurable fallback chains, rate limiting, and health monitoring. Inspired by OpenClaw's model failover system.

Setup

Configure your provider chain in environment variables:

Comma-separated list of providers (in fallback order)

export LLM_PROVIDER_CHAIN="anthropic:claude-3-5-sonnet-20241022,openai:gpt-4o-mini,google:gemini-1.5-flash"

API keys for each provider

export ANTHROPIC_API_KEY="sk-ant-..." export OPENAI_API_KEY="sk-..." export GOOGLE_API_KEY="..."

Usage

Chat with automatic failover

{baseDir}/model-failover.js chat "Your message here"

Add a new provider to the chain

{baseDir}/model-failover.js add-provider anthropic claude-3-5-sonnet-20241022

Remove a provider from the chain

{baseDir}/model-failover.js remove-provider openai

List providers in chain

{baseDir}/model-failover.js list

Check provider health

{baseDir}/model-failover.js health

Reset failure counts

{baseDir}/model-failover.js reset

Configuration

Environment Variable Description Default

LLM_PROVIDER_CHAIN

Comma-separated provider:model pairs anthropic:claude-3-5-sonnet-20241022

ANTHROPIC_API_KEY

Anthropic API key

OPENAI_API_KEY

OpenAI API key

GOOGLE_API_KEY

Google API key

CUSTOM_API_KEY

Custom provider API key

MAX_RETRIES

Max retries per provider 2

RETRY_DELAY_MS

Delay between retries 1000

Provider Format

provider:model

Supported providers:

  • anthropic

  • Anthropic Claude models

  • openai

  • OpenAI GPT models

  • google

  • Google Gemini models

  • custom

  • Custom OpenAI-compatible endpoint (set OPENAI_BASE_URL )

How It Works

  • Try the first provider in the chain

  • If it fails (rate limit, error, timeout), wait and retry

  • If retries exhausted, move to next provider

  • Continue until success or all providers exhausted

  • Track failures per provider for health monitoring

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

vector-memory

No summary provided by upstream source.

Repository SourceNeeds Review
General

model-router

No summary provided by upstream source.

Repository SourceNeeds Review
General

rss-reader

No summary provided by upstream source.

Repository SourceNeeds Review
General

video-frames

No summary provided by upstream source.

Repository SourceNeeds Review