A provider/model/key routing/orchestration library for LLMs.
Project description
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
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
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 polyrouter-1.2.0.tar.gz.
File metadata
- Download URL: polyrouter-1.2.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41e00bacb06bb0e8b8ebf3224bab16103a51f62d0948cb3dd4edc0d534b9e15a
|
|
| MD5 |
609416006f636748ed8d8d3909705ca2
|
|
| BLAKE2b-256 |
ed54acda24d436a76adbe1d01cbec0e06acc0558104c822031aa54873547e12d
|
File details
Details for the file polyrouter-1.2.0-py3-none-any.whl.
File metadata
- Download URL: polyrouter-1.2.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebe4e945be797002f33f8a3ee2a2dcb2e16349ff609f9618bafd13f97dd38dd0
|
|
| MD5 |
7d877f58e79f55f5ce5e2cd7d1c34665
|
|
| BLAKE2b-256 |
2e1417f88e4715c697928a0dc8d276d66ef1075874e010a2c53a761fdc0c6cda
|