Promptimizer

Routing

Cheapest adequate model. Step up, never down.

Algorithm

  1. 01

    Prefix cache

    Hash system + long context. Hits bill those tokens at 50% input.

  2. 02

    P(quality | small)

    If the cheap model is likely to pass, pick the cheapest selected model in that tier. Never step down.

  3. 03

    Complete

    Call the connected provider with that model id.

  4. 04

    Guard

    If the answer looks degraded, retry one tier higher and mark escalated.

  5. 05

    Price

    Split savings: routing (cheaper model) plus cache (repeat prefixes).

Model hint

model: auto uses the classifier. Any other fleet id is an explicit pin — used for the frontier half of the benchmark.

Metadata

json
{
  "p_small_quality": 0.96,
  "tier": "economy",
  "escalated": false,
  "quality_gate": "pass"
}