route66 Python SDK
Project description
route66
Team Information
- Team Lead: Het Shah
- Members: Rajdeep Kamani, Dharv Pandya, Harsh Maradia, Dhruv Fadadu, Devanshu Patel
- Note This is the link to our development repo.
Project Overview
route66 is an intelligent tool router for LLM agents. Given a query and a large tool catalog, it returns only the relevant tools — deduplicated, in an ordered execution plan, with policy-aware defaults (deprecation preference, out-of-scope refusal, clarify-on-vague- destructive). It is catalog-in and pure compute: it never opens a network connection, authenticates, or executes a tool. The caller keeps their own agent loop and credentials; route66 just picks which tools belong in the next prompt.
Built against the router-testkit grading contract:
single-tool routing, ordered multi-tool plans, near-duplicate resolution,
capability-based fallback widening, deprecation policy, out-of-scope
refusal, and clarify-on-vague-destructive.
The pipeline is a Facade over pluggable strategies (retriever, fuser, reranker, vector store, planner, capability provider, policy chain) — each injectable, each independently testable, each swappable via a constructor argument or an environment variable.
Demo Video
One Pager Link
Technical Design / Architecture Decision Record
docs/architecture/query-flow.md— sequence diagram of a singleroute()call end-to-end. Every arrow points at a function you cangrepfor.docs/architecture/components.md— module dependency graph, per-module code map, and extension points.docs/PRD.mdanddocs/hackathon-definition.md— original problem statement and PRD.docs/chroma-and-mcp-sync.md— setup and testing guide for the optional Chroma DB vector store and the MCP tool-sync feature.specs/— spec-driven implementation plan; every module has acceptance criteria pinned to specificTC-*cases.
Inline summary
Query → grammar-driven plan split (rule-based, LLM optional) → for each
step: dense (via a pluggable VectorStore) + BM25 + learned-association
retrievers → reciprocal rank fusion → optional cross-encoder rerank
(Bedrock Cohere or local sentence-transformers) → runtime near-duplicate
resolution → cluster-hint reorder → capability filter → policy chain
(PreferCurrent, NoToolOnOOS, ClarifyOnDestructiveVague) → pick.
Tech Stack
- Language: Python ≥ 3.14 (pinned in
.python-version, managed byuv) - Core: standard library only for the pipeline
- Embedding backends: built-in
HashingEmbedder(zero-dep default),SentenceTransformerEmbedder(opt-in,--extra semantic),BedrockEmbedder(via internal gateway;TR_EMBEDDER=bedrock) - Rerank backends: local
CrossEncoderReranker(sentence- transformers) orBedrockReranker(Cohere rerank via gateway;TR_RERANKER=bedrock) - Vector store: in-memory exact-cosine default; optional Chroma DB
backend (
--extra chroma,TR_VECTOR_STORE=chroma) - Planner: rule-based
RuleChainPlannerby default; optionalLLMChainPlanner(Bedrock chat, fail-open) viaTR_PLANNER=bedrock - Catalog sync (opt-in): MCP client via the official
mcpSDK (--extra mcp) - Grading harness:
router-testkit— standard-library only - Tooling: Ruff (lint + format), pytest, pre-commit
Setup & Run Instructions
# 1. Clone and install (uv-managed).
git clone <this repo>
cd route66
uv sync # base install, zero extras
# Optional extras:
uv sync --extra semantic # local sentence-transformers embedder
uv sync --extra chroma # Chroma DB vector store
uv sync --extra mcp # MCP client for live tool sync
uv sync --extra dev # ruff + pytest + pre-commit
# 2. Score the reference baseline (sanity check).
cd router-testkit/harness
python run_benchmark.py --verbose
# 3. Score this project's router against the default suite.
python run_benchmark.py --router testkit_adapter:MyRouter --verbose
# 4. Score every suite in parallel and save per-suite logs to results/.
cd ../..
python results/run_all.py
Optional environment variables
| Variable | Values | Effect |
|---|---|---|
TR_EMBEDDER |
bedrock | semantic | hashing |
Which embedder to load (default: semantic → hashing fallback). |
TR_RERANKER |
bedrock | cross-encoder | unset |
Enable a cross-encoder rerank stage (off by default). |
TR_VECTOR_STORE |
chroma | memory |
Dense-retrieval backend (default: memory). |
TR_PLANNER |
bedrock | rule |
Chain planner backend (default: rule). |
TR_FORCE_HASHING |
any value | Force HashingEmbedder even when semantic is installed. |
TR_LOG |
debug | info | warning | error |
route66 logger level (default: WARNING). |
TR_TRACE |
any value | Print one line per routed query and bump logging to INFO. |
BEDROCK_API_KEY |
value | Required for any Bedrock backend. |
BEDROCK_CA_CERT |
path | Required for any Bedrock backend. |
Dev commands
uv run ruff check . # lint
uv run ruff format . # format
uv run pytest # full test suite (Bedrock-live tests skip when credentials absent)
CI / release pipeline
route66 ships with a GitLab CI pipeline that runs on every push and publishes releases to PyPI:
.gitlab-ci.yml— lint → test → build on every non-master branch and MR. Same checks run locally viapre-commit.ci/release.gitlab-ci.yml— a manually-triggered child pipeline on master. It bumpssrc/route66/_version.py, builds wheel + sdist, publishes to PyPI, tags the commit, and appends torelease/CHANGELOG.md.
See release/README.md for the full release
knobs (BUMP, VERSION, RELEASE_NOTES).
Additional Links / Resources
- PyPI package: pypi.org/project/route66 —
pip install route66 - How to use route66 via pip (with provider snippets):
docs/pip-usage.md - Grading contract:
router-testkit/README.md - Chroma + MCP setup guide:
docs/chroma-and-mcp-sync.md - Original PRD:
docs/PRD.md - Problem statement:
docs/hackathon-definition.md - Release process:
release/README.md - GitLab CI pipeline:
.gitlab-ci.yml(lint / test / build) +ci/release.gitlab-ci.yml(PyPI publish, tag, changelog) - Demo script (60-tool toy catalog):
python demo.py - Extra benchmarks (baseline, mutations, guardrail):
bench/ - Per-suite result logs:
results/
Repository Layout
route66/
├── src/route66/ # The library (facade + retrievers + policy + vector store + MCP sync)
├── testkit_adapter.py # Bridges route66 to the harness contract
├── demo.py # Toy 60-tool catalog demo
├── metrics.py # Recall / precision / token-savings eval
├── router-testkit/ # Grading kit (catalog + test cases + harness)
├── bench/ # Additional benchmarks
├── specs/ # Spec-driven implementation plan
├── docs/ # PRDs, architecture docs, feature guides
├── results/ # Per-suite benchmark logs + run_all.py driver
└── tests/ # Unit tests
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 route66-3.0.0.tar.gz.
File metadata
- Download URL: route66-3.0.0.tar.gz
- Upload date:
- Size: 68.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
364488233142f2b96e98df784f1d8eed8888c3d9547744dd3dfbdbdd53e07a64
|
|
| MD5 |
9e7fc60413558695f5ae2563f9eb1e35
|
|
| BLAKE2b-256 |
d09bf6ae5cf433f97af165a8c011d0ecd619692bbe7bd3a600550d40bfb5115d
|
File details
Details for the file route66-3.0.0-py3-none-any.whl.
File metadata
- Download URL: route66-3.0.0-py3-none-any.whl
- Upload date:
- Size: 85.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2b4e90bda7fc29517464062bf83779ea2fa9461157fd510f7966b0e90f0f56c
|
|
| MD5 |
deef22a5f91c2435405cb5b9ddbcecbf
|
|
| BLAKE2b-256 |
a8748e0a951879b5be747b86a601104f289ae6990f281a0efefb2e5ec262d126
|