tropos · walkthrough

Route AI models by their track record, not their word.

A calibration-robust router for multi-model AI.

You have several models, cheap to expensive. Tropos sends each task to the cheapest one that is actually reliable, using what it has learned rather than what the model claims about itself. Here is the whole loop, in real code, with the real output.

What you plug in, and what Tropos does:
you provide
each model's confidence, and the outcome of each run
Tropos does
correct the confidence by the track record, route to the cheapest reliable model, then learn from the outcome

It does not call your models or grade results for you. You wire those up; Tropos makes the calibrated decision and remembers what happened.

1Define your fleet

Cheapest-first, each model on a price tier.

$ pip install tropos

from tropos import Fleet, Model

fleet = Fleet(models=[
    Model("haiku",  "economy"),
    Model("sonnet", "standard"),
    Model("opus",   "premium"),
])

2Route a task

You pass each model's confidence bid. On a cold start there is no track record yet, so Tropos plays safe and escalates to the strongest model.

from tropos import route

bids = {"haiku": 0.9, "sonnet": 0.9, "opus": 0.95}
route("parse", bids, fleet).model
output
routed to : opus
reason    : no model cleared the barrier; escalated to the highest corrected bid

3Report outcomes, and it learns

After each run, tell Tropos what actually happened. This is the whole point: the routing sharpens from real outcomes, with no privileged information.

# haiku got 'parse' wrong; sonnet got it right, twice
fleet.record("haiku",  "parse", passed=False)
fleet.record("sonnet", "parse", passed=True)
fleet.record("sonnet", "parse", passed=True)
output
haiku  'parse' reliability : 0.42
sonnet 'parse' reliability : 0.80

4Route again, routing has improved

Same bids as before. But now Tropos knows haiku is unreliable on parse, so it routes to the cheaper reliable model instead of the frontier.

route("parse", bids, fleet).model
output
routed to : sonnet
reason    : cheapest model clearing the barrier (0.70)

Run the whole thing yourself

Two commands. The output below is exactly what you will see.

$ pip install tropos
$ python -m examples.walkthrough
python -m examples.walkthrough
=== 1. Fleet defined: haiku (economy) < sonnet (standard) < opus (premium) ===

=== 2. Route 'parse' at cold start (no track record yet) ===
   bids        : {'haiku': 0.9, 'sonnet': 0.9, 'opus': 0.95}
   routed to   : opus
   reason      : no model cleared the barrier; escalated to the highest corrected bid

=== 3. Report real outcomes ===
   haiku  'parse' reliability : 0.42
   sonnet 'parse' reliability : 0.80

=== 4. Route 'parse' again, routing has improved ===
   routed to   : sonnet
   reason      : cheapest model clearing the barrier (0.70)

honest caveatTropos helps most on a fleet of cheap, often overconfident models, where a confidently-wrong cheap answer is expensive (rework, failed tests, lost trust). Where the cheap model is already reliable, it is a no-op with no regression, a safety net rather than a generic booster.

Open source, Apache-2.0. Code and the research paper are on GitHub. Built by Teo Qing Cong Eugene.