Loop-aware router and tracing for coding agents (Claude Code, Codex). Routes workflow steps by phase and evidence and records hash-only cost/cache/verification/outcome receipts.
Project description
InferRouter
Loop-aware model routing and hash-only evidence for coding agents such as Claude Code and Codex.
Status: alpha. The package, import, and CLI are all
inferrouter. InferGuard is a separate diagnostics product.
MVP
one coding task
→ one observed coding loop
→ safe model/provider choices by phase
→ tools and tests
→ verification
→ accepted or rejected result
→ one complete hash-only receipt chain
Primary metric: cost per accepted patch at required quality and p95/p99 full-loop latency.
Current milestone
Built:
request-level gateway and protocol adapters
hard tenant/capability/protocol/tool/context/latency gates
provider cooldown and bounded affinity
pre-first-byte fallback
spend controls and hash-only receipts
loop, verification, and outcome ledgers
TaskEnvelopeV1 and ContextFingerprintV1
cross-runtime canonicalization and tenant-scoped fingerprints
Next:
1. Packet 1B receipt observability
2. accepted-task baseline-versus-routed canary
3. one provider-reported cache experiment
4. one second-provider outage drill
5. bounded worker lifecycle
Read first
- Product architecture
- Progress tracker
- MVP ship-now prompt
- Current SSoT
- Machine-readable status database
- Archive lessons and integration plan
- Touchdown Labs research bridge
Use docs/ROUTER_MASTER_SOT.md, the runbook, and audit files for detailed chronology and historical deployment evidence.
Repository boundary
OCWC22/inferrouter
= product/runtime authority
OCWC22/Touchdown-Labs
= company/research authority
InferGuard
= separate diagnostics product
See TOUCHDOWN_LABS.md.
Install
uv tool install .
# or
pip install .
After the first PyPI publication for the current package version:
uv tool install inferrouter
This installs inferrouter and inferrouter-routerd.
Coding-loop quickstart
inferrouter loop goal \
--loop-id fix_auth_tests \
--goal "auth tests pass" \
--verify "python -m pytest tests/auth -q" \
--max-turns 5 --agent codex \
-- codex exec "fix the failing auth tests"
Hash-only local evidence is written under .touchdown/:
.touchdown/loops/loop_runs.jsonl
.touchdown/loops/verifications.jsonl
.touchdown/session.json
Other commands:
inferrouter loop turn --agent generic -- <command>
inferrouter loop report [--loop-id L]
inferrouter loop usage [--by loop|task|phase|provider|model]
inferrouter doctor --split
inferrouter --help
Claude Code and Codex launchers
inferrouter claude -- -p "summarize the failing test log"
inferrouter codex -- summarize the failing test log
The split proxy is explicit and self-managed:
inferrouter proxy status
inferrouter proxy stop
The gateway routes API requests. It does not silently intercept every local prompt and does not create subagents by itself.
Production gateway
The documented gateway is:
https://touchdown-router.odd-star-67a4.workers.dev
Request path:
customer request
→ tenant/capability/protocol/tool/context/latency gates
→ cheapest viable configured route
→ bounded provider fallback
→ protocol-correct stream
→ hash-only receipt
Repository main may be ahead of the live Worker. A merged feature is not a deployment claim. Use the progress tracker and runbook for current live evidence.
Safety defaults
- Package-local commands make no live provider call unless explicitly configured.
- Raw prompts, source code, tool content, outputs, and credentials stay out of receipts and reports.
- Unsupported protocol semantics fail closed.
- Fallback happens only before client-visible output.
- Cost never overrides tenant, safety, capability, protocol, tool, context, or latency eligibility.
Development
python -m pytest -q
uv build
bash scripts/package_smoke.sh
The import package, distribution name, and CLI command are all inferrouter.
Contributing
See CONTRIBUTING.md, Code of Conduct, and SECURITY.md.
License
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 inferrouter-0.1.2.tar.gz.
File metadata
- Download URL: inferrouter-0.1.2.tar.gz
- Upload date:
- Size: 465.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f32300ad728cceea32a29e05c5f844738c775be0fa1ff49d5983b4aca0a91bcc
|
|
| MD5 |
3a0b3cfbe2bc471347179c190ae8074e
|
|
| BLAKE2b-256 |
0c32f6e0c4248b241ca9ab42b0210a1237bcb8627e58cbe7685d1eef10295f3d
|
Provenance
The following attestation bundles were made for inferrouter-0.1.2.tar.gz:
Publisher:
publish.yml on OCWC22/inferrouter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inferrouter-0.1.2.tar.gz -
Subject digest:
f32300ad728cceea32a29e05c5f844738c775be0fa1ff49d5983b4aca0a91bcc - Sigstore transparency entry: 2159303641
- Sigstore integration time:
-
Permalink:
OCWC22/inferrouter@b8978e1fda5f3b9b6918df854fe68df186efe027 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/OCWC22
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b8978e1fda5f3b9b6918df854fe68df186efe027 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file inferrouter-0.1.2-py3-none-any.whl.
File metadata
- Download URL: inferrouter-0.1.2-py3-none-any.whl
- Upload date:
- Size: 439.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bc5f0a659226cac0ebcded81d4a291be7e72c28ab37e0587b3cc35c3c0ba3a8
|
|
| MD5 |
1022613728cc870d9204b16afd9daae2
|
|
| BLAKE2b-256 |
bf73ef1e5aff8eca38f3802b471cab0ea8eb597ee97d818fd7af0dd98ded638a
|
Provenance
The following attestation bundles were made for inferrouter-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on OCWC22/inferrouter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
inferrouter-0.1.2-py3-none-any.whl -
Subject digest:
4bc5f0a659226cac0ebcded81d4a291be7e72c28ab37e0587b3cc35c3c0ba3a8 - Sigstore transparency entry: 2159303699
- Sigstore integration time:
-
Permalink:
OCWC22/inferrouter@b8978e1fda5f3b9b6918df854fe68df186efe027 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/OCWC22
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b8978e1fda5f3b9b6918df854fe68df186efe027 -
Trigger Event:
workflow_dispatch
-
Statement type: