Difficulty-aware routing and model selection for multi-agent LLM workflows
Project description
pyagent-router
Difficulty-aware routing and model selection for multi-agent LLM workflows. Route easy tasks to cheap models, hard tasks to expensive ones.
Install
pip install pyagent-router
Components
- DifficultyScorer — Score task difficulty 1-10 based on heuristics
- CostEstimator — Estimate LLM call costs with built-in model pricing
- ModelSelector — Auto-select the cheapest viable model
- RouterMiddleware — Inject routing into agent calls
Quick Example
from pyagent_router import ModelSelector
result = ModelSelector().select("What is 2+2?")
print(f"{result.model}: ${result.cost_estimate.total_cost:.6f}")
# gpt-4.1-nano: $0.000002 (instead of $0.003 with gpt-4o)
Typical Savings: 40-60%
For workloads where 70% of queries are easy, routing to cheap models saves 40-60% vs always using the most expensive model.
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 pyagent_router-0.1.0.tar.gz.
File metadata
- Download URL: pyagent_router-0.1.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0126502c139df48d7f9913cbf37e935f27f8e5da162df3bebb9e2ce4e453363c
|
|
| MD5 |
241f649de48e63760013c23e5004cd5f
|
|
| BLAKE2b-256 |
07d95f613f7d9979fd58ea3ba53e18ab1c7d1bf462eab86c49036fdf2178e1ac
|
File details
Details for the file pyagent_router-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pyagent_router-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6915a883e5d92e5d2b8b0a897f3234c9bb1bb7f0805c59ac6dd96cb9a4eba481
|
|
| MD5 |
94d410546a2cea0cdf18923c2ab73416
|
|
| BLAKE2b-256 |
8d8c63eba6bfb15243c9d3994589f9d28c6c02eb076209f2d05f70fa4a326a5c
|