One interface for resilient, multi-provider AI generation.
Project description
██████╗ ██████╗ █████╗ ██╗ ██╔══██╗██╔══██╗██╔══██╗██║ ██████╔╝██║ ██║███████║██║ ██╔══██╗██║ ██║██╔══██║██║ ██║ ██║██████╔╝██║ ██║██║ ╚═╝ ╚═╝╚═════╝ ╚═╝ ╚═╝╚═╝
🚀 rdai (Ranajit Dhar AI) - Multi-Brain AI Orchestrator
One Interface. Any AI. Unbreakable Auto-Failover.
Version: v1.0.1
👑 Created by: Ranajit Dhar
🌐 Website: https://ranajitdhar.in
rdai is a Quantum-Ready, Self-Healing AI Operating System and Python SDK. It allows you to call multiple AI models (Gemini, OpenAI, Claude, DeepSeek, and more) through one single, unified interface. It automatically discovers your API keys, selects the best provider based on your strategy, and features a limitless Circuit Breaker that silently auto-failovers to a backup provider when rate limits, crashes, or timeouts occur.
Zero downtime. 100% Reliability.
✨ Key Features
- 🧠 11+ Built-in AI Brains: Native support for Gemini, OpenAI, Groq, Claude, DeepSeek, Qwen, Llama, Mistral, VertexAI, AWS Bedrock, and HuggingFace.
- ⚡ Unbreakable Auto-Failover: If your primary model crashes or hits a rate limit, the system instantly and silently routes the prompt to the next available model.
- 🛠️ Bring-Your-Own-Model (BYOM): Inject any custom/private AI API into the failover chain without changing the core framework.
- 🩺 Live Ping Diagnostics: The built-in CLI doctor actually pings the AI servers to report real-time ALIVE/ERROR status and latency.
- 🪄 Smart Auto-Setup: Automatically installs missing required SDKs in the background during initialization. Prevents accidental configuration overwrites.
📦 Installation
pip install rdai
# Or if using local source: pip install -r requirements.txt
🚦 Quick Start (The CLI Wizard)
rdai comes with a powerful CLI dashboard. To configure your multi-brain environment, simply run:
rdai init
This interactive wizard will let you select your AI providers, define your failover strategy, auto-install missing packages, and generate your .env and rdai.yaml files.
Next, add your API keys to the generated .env file:Code snippet
GEMINI_API_KEY=your_key_here
GROQ_API_KEY=your_key_here
OPENAI_API_KEY=your_key_here
# Add others as selected...
(Note: Your API keys are kept strictly local and secure. They are never hardcoded.)
Finally, verify your setup with the live diagnostic tool:
rdai doctor
The doctor will scan your .env file, ping the AI networks, and show you the real-time latency and health of your failover chain.
💻 Python SDK Usage (Writing Code)
Using the SDK is incredibly simple. You don't need to learn 10 different SDKs; rdai standardizes everything.
from rdai import AI
# Initialize the AI Engine. It automatically loads your rdai.yaml strategy.
ai = AI()
# Send a prompt. If the first model fails, it silently falls back to the next!
response = ai.generate("Write a multi-agent orchestration script in Python.")
print(response)
Bring Your Own Model (BYOM)
Want to use a custom API? Inject it directly into the engine:
from rdai.providers.base import BaseProvider
from rdai import AI
import requests
class CustomNexusProvider(BaseProvider):
def __init__(self, api_key):
super().__init__(api_key, "nexus-v1")
def generate(self, prompt: str, **kwargs) -> str:
res = requests.post("[https://api.nexus.com/v1](https://api.nexus.com/v1)", headers={"Key": self.api_key}, json={"text": prompt})
return res.json()["reply"]
# Inject your custom engine into the failover chain!
ai = AI(providers=[CustomNexusProvider(api_key="your_custom_key")])
print(ai.generate("Hello Custom Engine!"))
⚙️ Routing Strategies & Configuration
rdai reads your setup from an optional rdai.yaml file in the current directory. Environment variables take precedence over values in .env
strategy: smart
provider_order:
- gemini
- openai
- groq
🧠 Routing Strategies
smart: Selects a ready provider whose traits best fit the specific request.manual: Strictly follows the exactprovider_orderdefined in yourrdai.yaml.
Note: Both strategies retain the remaining ready providers as automatic fallbacks for transient rate-limit and timeout failures.
🎛️ Supported AI Engines & Environment Keys
| Provider Engine | Environment Variable | Backend Logic |
|---|---|---|
| Gemini | GEMINI_API_KEY |
Modern google.genai SDK |
| OpenAI | OPENAI_API_KEY |
Official openai SDK |
| Groq | GROQ_API_KEY |
Official groq SDK |
| VertexAI | VERTEXAI_API_KEY |
GCP Project ID via google.genai |
| Claude | CLAUDE_API_KEY |
Direct Anthropic REST API |
| AWS Bedrock | AWS_BEDROCK_API_KEY |
AWS boto3 SDK |
| DeepSeek | DEEPSEEK_API_KEY |
Direct DeepSeek REST API |
| Qwen | QWEN_API_KEY |
Alibaba DashScope REST API |
| Llama | LLAMA_API_KEY |
Universal OpenAI-Compatible API |
| Mistral | MISTRAL_API_KEY |
Direct Mistral REST API |
| HuggingFace | HUGGINGFACE_API_KEY |
HF Serverless Inference API |
🛠️ Complete CLI Command Reference
rdai init- Setup your workspace, strategies, and AI providers.rdai doctor- Run a live.envnetwork scan and API health check.rdai config- View your active routing strategy and failover chain.rdai benchmark- Run a latency test across your active models.rdai health- Check overall internal system health and readiness.rdai about- Learn about the master orchestration architecture.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rdai-1.0.1.tar.gz.
File metadata
- Download URL: rdai-1.0.1.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f7b6f50db49c6d867f74182161b2a87bf6b54ffad3a7edcca9287b7e29217c5
|
|
| MD5 |
87b3eb54570c5719b36d338fc45b5b70
|
|
| BLAKE2b-256 |
44ff0af359786c561611945182401c2d56f9476391fdc4085d4ef001989715d3
|
File details
Details for the file rdai-1.0.1-py3-none-any.whl.
File metadata
- Download URL: rdai-1.0.1-py3-none-any.whl
- Upload date:
- Size: 35.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a292f67626e74ee0ae54c69d5e2e038ee2f110a5bc6ae0eddaa9586e1727063
|
|
| MD5 |
1627fcaa480ee858e4c5869465cd1f32
|
|
| BLAKE2b-256 |
695ed293285bec0cd09f919d9fbe0b801d032a432e36e596d065994683f9c03e
|