Observed since 20 Oct, 18:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Routing strategies for the AccuralAI orchestration pipeline.
accuralai-router provides pluggable routing strategies for the AccuralAI orchestration core. Routers map canonicalized requests to backend identifiers using deterministic policies, weighted load balancing, failover rules, metadata-aware predicates, or complexity-based tiering.
Router protocol from accuralai-core.Install alongside the core orchestrator:
pip install accuralai-core accuralai-router
The complexity router analyzes request characteristics to automatically route tasks to appropriate model tiers, optimizing cost and performance.
The router calculates a complexity score using configurable weights:
Requests are routed to three tiers based on score thresholds:
< 50): Simple tasks → efficient models (e.g., gemini-2.0-flash-lite)50-199): Moderate tasks → balanced models (e.g., gemini-2.0-flash)≥ 200): Complex tasks → powerful models (e.g., gemini-2.5-flash)[router]
plugin = "complexity"
[router.options]
low_threshold = 50.0
high_threshold = 200.0
honor_explicit_complexity = true
backend_id = "google"
[router.options.scoring]
token_weight = 1.0
history_weight = 2.0
tool_weight = 10.0
parameter_complexity_weight = 5.0
[[router.options.tiers]]
tier = "low"
models = ["gemini-2.0-flash-lite"]
[[router.options.tiers]]
tier = "medium"
models = ["gemini-2.0-flash", "gemini-2.0-flash-lite"]
[[router.options.tiers]]
tier = "high"
models = ["gemini-2.5-flash", "gemini-2.0-flash"]
# Single backend configuration
[backends.google]
plugin = "google"
[backends.google.options]
model = "gemini-2.5-flash" # Default model, overridden by router
You can override automatic scoring by setting explicit complexity in request metadata:
request = GenerateRequest(
prompt="Complex task that should use powerful model",
metadata={"complexity": "high"} # Forces high-tier routing
)
Adjust scoring weights based on your use case:
token_weight: Emphasize prompt lengthhistory_weight: Penalize long conversations moretool_weight: Treat tool usage as more complexparameter_complexity_weight: Weight advanced generation parameters morepython -m venv .venv && source .venv/bin/activate
pip install -e packages/accuralai-core[dev]
pip install -e packages/accuralai-router[dev]
pytest packages/accuralai-router/tests -q
Routers register entry points under accuralai_core.routers so accuralai-core can discover them automatically.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.1 | 26 Jan 2026 | 5 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 18:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:b65471ab31493453f989370aba2c824b51b341e101b9263c5fef4d2992d2e4ff