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.1.tar.gz (8.1 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.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file polyrouter-1.2.1.tar.gz.

File metadata

  • Download URL: polyrouter-1.2.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for polyrouter-1.2.1.tar.gz
Algorithm Hash digest
SHA256 6123741b2521df08ecfbb6574d205440c2ec99d0fd1b9253adac91920f80f5f1
MD5 ddd2b7d3a0e7bd777b4a450412023d5d
BLAKE2b-256 21c45275f462f6040794462c280922545d324cb2418531af2ab60b77f747c1fa

See more details on using hashes here.

File details

Details for the file polyrouter-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: polyrouter-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for polyrouter-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e8ee33fb517de353b1b9a9da895fd5b6822e503188357d194878ce5852bd88b
MD5 80d0ddb95022cb4f5abfc9b536097311
BLAKE2b-256 aa293f25e0d4d88eb5e0f9d10b9c0e3c68c4c4c5241da1c5a74cad018363f46a

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