More screenshots

    Works with the AI tools you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIGitHub CopilotGitHub CopilotGemini CLIGemini CLI+20 more

    Nex Multi Llm Fallback Router

    5

    Builds a Python FallbackProvider that chains Claude, Gemini, Qwen, and Ollama so your AI pipeline never fully stops.

    Free

    2 installsSecurity scanned
    nex-multi-llm-fallback-router

    nex-multi-llm-fallback-router

    Example session with this skill installed

    I need a way to fall back to a local Ollama model if my Claude API calls fail or hit rate limits, so my data processing pipeline doesn't stop.

    • Read your context and instructions
    • Compiled the nex-multi-llm-fallback-router

    Structure generated

    • fallback_provider.py: Implements try_next logic on AIProviderTimeout.
    • factory.py: Configures the chain [Claude -> Gemini (optional) -> Ollama].
    • base.py: Shared interface ensuring the router is indistinguishable from a single model caller.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    What it does

    • Generates fallback_provider.py, a FallbackProvider that wraps an ordered list of providers and tries them in turn, skipping any that times out, errors transiently, or returns invalid output
    • Ships base.py with the shared AIProvider interface and error taxonomy (AIProviderTimeout, AIProviderError, AIProviderInvalidOutput), identical across the companion provider skills
    • Ships factory.py with build_generation_chain() and build_scoring_chain(), the single place chain order lives, with graceful skipping of providers whose API key is missing
    • Default chain is Claude, then Gemini, then Qwen, then Ollama: strong paid, cheaper paid, cheap API, free local model
    • The router implements AIProvider itself, so it drops in anywhere a single provider was expected, and routers can nest

    Why use this

    One rate-limited API should not stall a bulk generation or scoring run; with this router the pipeline degrades to the next model instead of failing, down to a free local Ollama floor. This is the composition layer Nex AI runs in production, and because the router hides behind the same interface as every provider, adding failover to existing code is a one-line swap.

    See it in action

    Prompt:

    If Claude is down or rate-limited, I want it to fall back to Gemini automatically, and to a local model if both are out.

    Result:

    class FallbackProvider(AIProvider):
        def __init__(self, providers: list[AIProvider], label: str = "chain"):
            self.providers = providers
    
        def generate(self, prompt: str, **kwargs) -> str:
            last_error = None
            for provider in self.providers:
                try:
                    return provider.generate(prompt, **kwargs)
                except (AIProviderTimeout, AIProviderError,
                        AIProviderInvalidOutput) as e:
                    log.warning("provider %s failed, trying next", provider.name)
                    last_error = e
            raise last_error  # all failed: clean failure, never swallowed
    
    chain = build_generation_chain()  # Claude -> Gemini -> Ollama

    Use cases

    • Automatic failover when one model API has an outage or rate limit
    • A cost-aware scoring chain that starts cheap and escalates only on failure
    • A single AIProvider interface in front of multiple model vendors
    • Keeping overnight bulk jobs running on a local model when paid APIs are down

    Known limitations

    • Failover by priority, not load balancing; it does not round-robin for throughput.
    • The composition layer only: the individual Claude, Gemini, Qwen, and Ollama providers come from their own integration skills (constructor stubs are commented in factory.py).
    • Python only.

    FAQ

    What exactly is in the download?

    SKILL.md, assets/base.py, assets/fallback_provider.py, assets/factory.py, assets/requirements.txt, two reference docs (chain-design.md, shared-interface.md), manifest.json, README, changelog, and license.

    Which agents does it work with?

    Claude Code, Claude Cowork, Cursor, Codex CLI, and any agent that reads the SKILL.md format.

    Do I need anything else?

    The router itself has no dependencies beyond the providers it chains. You need API keys for the paid providers you wire in; a missing key skips that provider instead of crashing. Ollama needs your own hardware.

    Can I change the chain order?

    Yes, the factory is the only place the order is decided. Generation chains usually start at the strongest model; scoring chains start cheap and fall through to local, and the chain-design reference explains why.

    How to install

    Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.

    ~30 seconds
    1. 1

      Download the ZIP

      Free skills download straight away. Paid skills unlock right after purchase.

    2. 2

      Unzip into your skills folder

      Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.

    3. 3

      Ask your agent to use it

      Restart the agent if it was already running. It picks the skill up automatically - no config needed.

    Skills folder by agent

    Click the path to copy it. Create the folder if it does not exist yet.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    2 installs

    Downloaded by developers to date

    Free forever

    No account required to browse

    Trust & safety

    Security scanned

    Verified clean 1 month ago

    • Free to download with an account

    Listed3 months ago
    Updated1 month ago

    What's inside

    Frequently Asked Questions