Skip to content

Routing policies

Pick the right function for every request.

Routing turns a fleet of pricing functions into one decision. Choose how to pick a candidate, set per-function weights, and fall back through a chain when one fails.

last-price.ai/routing-policies
last-price.ai/routing-policies
Routing policies builder, assign rules and fallbacks per tenant.

What you can do

  • Choose from seven routing strategies, including weighted rollouts and per-rule policies.
  • Add a fallback chain so a single function failure never breaks pricing.
  • Wrap each candidate in a circuit breaker that opens on errors and recovers automatically.
  • Override the policy per request with an explicit function name when you need to.
  • Audit which function actually served each call from the Cost Tracing view.

Seven routing strategies

  • explicit

    Pin to one function. Useful when a tenant wants exact, repeatable behaviour.

  • cheapest

    Lowest expected cost wins. Good for high-volume, latency-tolerant traffic.

  • fastest

    Lowest p95 latency wins. Good for checkout and real-time surfaces.

  • round_robin

    Even split across candidates. Good for warming a new function.

  • weighted

    Per-function weights. Roll out a new model at 5% and ramp it up.

  • policy

    Custom rules per request, segment, geo, product type, anything in context.

  • default

    The tenant's pinned default with a fallback chain behind it.

The runtime list and the RoutingStrategy type both come from ROUTING_STRATEGIES in the router itself, so this page can never drift from what the router actually accepts.

A policy looks like this

POST /api/routing-policies
{
  "name": "checkout-pricing",
  "strategy": "policy",
  "rules": [
    { "when": { "segment": "enterprise" }, "function": "lastprice/jale-advanced" },
    { "when": { "geo": "EU" },             "function": "lastprice/jale-elasticity" }
  ],
  "fallback_chain": [
    "lastprice/jale-optimizer",
    "lastprice/jale-psychological"
  ]
}

Recent changes

All Routing notes
  1. Improved

    Saved guardrails and routing policies apply on the next call

    A guardrail or routing policy you save is used by the very next price, within a second, instead of up to 30 seconds later.

  2. Improved

    Routing picks the same way every time, and policies are checked

    Automatic routing skips experiment assigners, breaks ties the same way on every call, and a routing policy that names a function it could never use is refused when you save it.

  3. Improved

    Choose routing weights by function name

    Choose functions by name and assign relative weights without typing their IDs.

  4. New

    See the item take shape as you describe it

    In the mobile app, the item sheet suggests a name, details and pictures while you type or speak, and sharpens as you add words.

  5. New

    Price an item from a photo on the website

    last-price.ai/price-check now prices one item from photos, a PDF, a link or a few words, with no account. Pick selling or buying and get a price, the range it sells in, its condition, and a listing or an offer to send.

Ready to try it?

Spin up a free playground tenant in under a minute. No credit card.