Python SDK

MultiRoute Python SDK

The MultiRoute Python SDK connects your app to MultiRoute's smart LLM/AI router for high-availability and client-side failover. It ensures that your AI-powered workloads remain reliable even when primary providers experience outages.

Core Features

How Failover Works

The SDK talks to MultiRoute's smart LLM/AI router:

  1. Router First: When a request is made, the SDK attempts to route it through the MultiRoute router (api.multiroute.ai).
  2. Error Detection: The SDK monitors for specific high-availability errors, including connection timeouts, server errors (5xx), and missing endpoints (404).
  3. Local Fallback: If an error is detected, the SDK immediately retries the request using the native provider's standard endpoint.
  4. Transparent Experience: This entire process happens locally within the SDK, ensuring the lowest possible latency for failover.

Supported Providers & Integrations

Installation

pip install multiroute

Note: You will also need the native provider SDKs installed.