Metadata-Version: 2.4
Name: polyrouter
Version: 1.2.1
Summary: A provider/model/key routing/orchestration library for LLMs.
Author-email: Pratham Tomar <partham68209@gmail.com>
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Topic :: Software Development
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Artificial Life
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: cerebras_cloud_sdk==1.67.0
Requires-Dist: google-genai==2.4.0
Requires-Dist: groq==1.1.0

# PolyRouter

**Deterministic failover and rotation for Large Language Models.**

PolyRouter is a lightweight Python library that routes requests across multiple LLM providers (like Groq, Google Gemini, and Cerebras). It helps applications achieve operational resilience by automatically rotating API keys, client providers, and model candidates when requests fail or get rate-limited.

## Key Features

* **Provider Rotation:** Seamlessly failover between different LLM providers (e.g., Groq → Gemini).
* **Key Pool Management:** Attach multiple API keys to a single provider to survive rate limits and expirations.
* **Model Fallback:** Define a preference chain of models to try before surfacing a failure to the user.
* **Zero App-Code Changes:** Handle complex failover logic at the orchestration layer, keeping your application logic clean.

## Installation

```bash
pip install polyrouter
```

## Project Contribution
This project is a Open Source Project, users add/contribute by adding more client as per requirement.
```
https://github.com/prathamtomar99/PolyRouter
```
