Metadata-Version: 2.4
Name: llm-failover-router
Version: 0.1.0
Summary: Resilient Multi-Provider LLM Fallback Router (DeepSeek, OpenAI, Ollama, Anthropic).
Home-page: https://msalatmani.org
Author: Mohamed Shaban (محمد شعبان العتماني)
Author-email: msalatmani@gmail.com
Project-URL: Homepage, https://msalatmani.org
Project-URL: Source, https://github.com/m0shaban/llm-failover-router
Project-URL: Company, https://robovai.tech
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28.0
Requires-Dist: pydantic>=2.0.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# 🔀 llm-failover-router
> **Resilient Multi-Provider LLM Fallback Router for High-Availability AI Applications.**

[![PyPI](https://img.shields.io/badge/PyPI-llm--failover--router-38bdf8?style=for-the-badge&logo=pypi&logoColor=white)](https://pypi.org/project/llm-failover-router)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=for-the-badge)](https://opensource.org/licenses/MIT)

---

## 📌 Why `llm-failover-router`?
When LLM APIs experience outages, rate-limits (HTTP 429), or network timeouts, your application crashes or hangs.

`llm-failover-router` provides a zero-overhead, multi-provider fallback strategy:
If Provider A (e.g., DeepSeek) fails or times out, it seamlessly switches to Provider B (OpenAI) or Provider C (Local Ollama) in milliseconds!

---

## ⚡ Quick Start

```bash
pip install llm-failover-router
```

### Usage Example:

```python
from llm_failover_router import LLMRouter, ProviderConfig

# Configure providers with priority order
router = LLMRouter(
    providers=[
        ProviderConfig(name="deepseek", api_key="sk-...", model="deepseek-chat"),
        ProviderConfig(name="openai", api_key="sk-...", model="gpt-4o-mini"),
        ProviderConfig(name="ollama", endpoint="http://localhost:11434", model="llama3"),
    ],
    timeout_seconds=5.0
)

# Executes primary provider; automatically falls back if API fails!
response = router.generate("Explain quantum computing in simple terms.")
print(f"Provider Used: {response.provider_used}")
print(f"Content: {response.content}")
```

---

## 👤 Author
**Mohamed Shaban (محمد شعبان العتماني)** — Applied AI Engineer  
🌐 Website: [msalatmani.org](https://msalatmani.org) | 📧 Email: msalatmani@gmail.com
