Skip to main content

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

Metadata

Release files for polyrouter 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polyrouter 1.2.2
File Size Uploaded Provenance Actions
polyrouter-1.2.2.tar.gz 8.2 kB Without provenance Details for polyrouter-1.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polyrouter 1.2.2
File Interpreter ABI Platform Actions
polyrouter-1.2.2-py3-none-any.whl Python 3 none any Details for polyrouter-1.2.2-py3-none-any.whl

Total release size: 16.3 kB

Release files / polyrouter-1.2.2.tar.gz

Download URL polyrouter-1.2.2.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
81dc502d108f52abad9b69ae30f566e9666435966ffe09eec76aff7ccd26af49
BLAKE2b-256 checksum
How to use checksums
5314dee881f52957a475747a8eb47fccb6fa7ea2b8a49ff1572b252d896a9392
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / polyrouter-1.2.2-py3-none-any.whl

Download URL polyrouter-1.2.2-py3-none-any.whl
Size 8.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f8fbe57104ae159cf8ae81d62d67c49a36b3ed07eee973c7fa1b54aa16edc3c
BLAKE2b-256 checksum
How to use checksums
b2773c23dd69b10bb356f55a91270f606792b3b6d31db3a87160705ccaaf775c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for polyrouter 1.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page