Skip to content

Cap monthly spend on online models

Pro

You’ll get: a route that uses online models while you’re under budget, then moves requests to a local model for the rest of the month. Local models cost nothing.

You need:

  • A Smart Route with at least one online model.
  • A local model for when you’re over budget.
  • Usage tracking on (it’s on by default). Without it, spend isn’t counted and spend rules never run.
  1. Open Smart Routes → Routes and click Edit on your route.
  2. Under Rules, click Over budget to a local model. Nexus adds:
    • a Monthly budget of $100, if the route has none yet;
    • a rule: This route’s spend this month is at least 80%, send to a local model.
  3. Click Set a budget (or the amount) to change the Budget per month, in US dollars.
  4. Change 80% if you want to switch earlier or later.
  5. Check that send to names the local model you want.
  6. Click Save changes.

A monthly budget of $100 with $0.00 spent, and two rules: long prompts go to the fallback, and once the route has spent 80% of its budget, requests go to the fallback

  • Spend is counted on this machine, for paid models only.
  • Months are counted in the route’s time zone. The budget shows when it Resets.
  • Models with no published price aren’t counted. The budget lists them, so you know.
  • A budget changes routing only through your rules. It doesn’t stop a provider from charging you.

Under Check routing, set This route’s spend this month to 90 and try a request. Nexus shows that your rule sends it to the local model.

The budget line shows real spend, such as $12.40 of $100 this month. More in Budgets and guards.