✦ v1.0.2 — now available on PyPI

One interface. Any AI.
Unbreakable auto-failover.

rdai is a multi-brain AI orchestrator for your terminal — route requests across Gemini, OpenAI, and Claude with a circuit-breaker failover engine that never leaves you stuck on a dead provider.

Gemini
OpenAI
Claude
View on GitHub →
zsh
❯
Gemini ◆VertexAI ◆OpenAI ◆Claude ◆AWS Bedrock ◆Groq ◆DeepSeek ◆Qwen ◆Llama ◆Mistral ◆HuggingFace ◆Custom (Bring Your Own Model) ◆Gemini ◆VertexAI ◆OpenAI ◆Claude ◆AWS Bedrock ◆Groq ◆DeepSeek ◆Qwen ◆Llama ◆Mistral ◆HuggingFace ◆Custom (Bring Your Own Model) ◆Gemini ◆VertexAI ◆OpenAI ◆Claude ◆AWS Bedrock ◆Groq ◆DeepSeek ◆Qwen ◆Llama ◆Mistral ◆HuggingFace ◆Custom (Bring Your Own Model) ◆
MIT
License
Python
Built with Typer + Rich
3-Tier
Circuit Breaker
Cross-platform
macOS · Linux · Windows
Under the hood

How a request actually moves through rdai.

Request
→
Router
→
Provider Registry
→
Circuit Breaker
→
Response

If a provider fails at the Circuit Breaker stage, the request loops back to the next entry in the Provider Registry — automatically.

Why rdai

Built so one dead API key never kills your app.

engine.py

Unbreakable Auto-Failover

A 3-tier circuit breaker tracks every provider's health. If one fails repeatedly, rdai skips it, waits for a recovery window, then quietly retries — your request always finds a working model.

router.py

Smart Routing

rdai reads intent straight from your prompt — coding-related requests route toward the strongest coding model, speed-sensitive ones toward the fastest, no manual switching required.

registry.py

11+ Built-in AI Brains

Native support for Gemini, OpenAI, Groq, Claude, DeepSeek, Qwen, Llama, Mistral, VertexAI, AWS Bedrock, and HuggingFace — call them all through one interface.

providers/base.py

Bring Your Own Model

Got a private or custom AI API? Inject it directly into the failover chain as a provider — no changes to the core framework required.

doctor.py

Live Ping Diagnostics

rdai doctor doesn't just check if a key exists — it actually pings each provider's servers and reports real-time ALIVE/ERROR status with latency.

init.py

Smart Auto-Setup

Missing an SDK for a provider you just enabled? rdai installs it automatically during rdai init — and never overwrites an existing config by accident.

Zero boilerplate

One YAML file. That's the whole config.

rdai init writes this file for you — no SDKs to wire up, no boilerplate per provider. Edit the priority chain any time, no code changes needed.

# rdai.yaml
strategy: smart
provider_order:
- gemini
- openai
- claude
# your_script.py
from rdai import AI
ai = AI()
response = ai.generate(
"Write a multi-agent script"
)
print(response)
Not just a CLI

It's a Python SDK too.

No need to learn ten different provider SDKs. rdai standardizes everything behind one AI() object — it loads your rdai.yaml strategy automatically, and silently falls back if the first model fails.

Extensible by design

Got a private model? Bring it in.

Inject any custom or internal API into the failover chain by extending BaseProvider — it joins the same circuit-breaker protection as every built-in engine.

class CustomProvider(BaseProvider):
def generate(self, prompt):
...call your API...
return reply
ai = AI(providers=[CustomProvider()])
Supported engines

Every provider, one env file.

ProviderEnv VariableBackend
GeminiGEMINI_API_KEYgoogle.genai SDK
OpenAIOPENAI_API_KEYOfficial openai SDK
GroqGROQ_API_KEYOfficial groq SDK
VertexAIVERTEXAI_API_KEYGCP Project via google.genai
ClaudeCLAUDE_API_KEYDirect Anthropic REST API
AWS BedrockAWS_BEDROCK_API_KEYAWS boto3 SDK
DeepSeekDEEPSEEK_API_KEYDirect DeepSeek REST API
QwenQWEN_API_KEYAlibaba DashScope REST API
LlamaLLAMA_API_KEYOpenAI-compatible API
MistralMISTRAL_API_KEYDirect Mistral REST API
HuggingFaceHUGGINGFACE_API_KEYHF Serverless Inference API
How it works

The circuit breaker, in three steps.

01

A request comes in. rdai calls the first provider in your priority chain — or the smart-ranked best match for that prompt.

02

If it fails, rdai logs the failure and instantly retries the next provider in the chain — no crash, no manual retry.

03

After 3 failures, that provider's circuit "opens" and is skipped entirely for a cooldown window — then quietly re-tested.

Commands

Everything, from six commands.

rdai initSetup your AI providers & routing strategy
rdai doctorCheck your API keys and their health
rdai configView your current routing configuration
rdai benchmarkRun a latency test across configured models
rdai healthCheck system health and network readiness
rdai aboutLearn about the rdai orchestrator
Why I built this

One rate-limited API shouldn't take down a whole build.

Every AI provider goes down eventually — rate limits, outages, quota caps. I built rdai so a single failing key never becomes a dead end. It's the orchestration layer I wanted for my own AI systems work, now open for anyone building on top of multiple models.

More about Ranajit Dhar →

Stop losing requests to one dead API key.

Install rdai and route your first request in under a minute.