Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polyrouter-1.2.0.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

polyrouter-1.2.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

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

Hashes for polyrouter-1.2.0.tar.gz
Algorithm Hash digest
SHA256 41e00bacb06bb0e8b8ebf3224bab16103a51f62d0948cb3dd4edc0d534b9e15a
MD5 609416006f636748ed8d8d3909705ca2
BLAKE2b-256 ed54acda24d436a76adbe1d01cbec0e06acc0558104c822031aa54873547e12d

See more details on using hashes here.

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

Hashes for polyrouter-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ebe4e945be797002f33f8a3ee2a2dcb2e16349ff609f9618bafd13f97dd38dd0
MD5 7d877f58e79f55f5ce5e2cd7d1c34665
BLAKE2b-256 2e1417f88e4715c697928a0dc8d276d66ef1075874e010a2c53a761fdc0c6cda

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page