Developers

Routing rules

A rule says where a task may go, how its result is checked, and how much it may spend. Set once, applied to every task it covers.

An example rule

yaml
# Example. A routing rule for one product.
rule: northwick-store
prefer: sponsored            # use sponsored models when they do the task well
data_location: [us, ca]      # providers that keep data in the US or Canada
check:
  code: tests + review       # tests must pass, a second model reviews
  copy: review
on_fail: next_model_up       # re-route only the failed task
max_cost_per_task: auto      # set by the balance
pin:
  images: gemini             # always use this model for images

Fields

FieldWhat it doesValue in the example
ruleThe name of the rule. One rule can cover a product or a whole workspacenorthwick-store
preferWhat Maestro favours when several models do the task wellsponsored
data_locationOnly providers that keep data in these places are used[us, ca]
checkHow each kind of work is checked before it moves oncode: tests + review; copy: review
on_failWhat happens when a check failsnext_model_up: re-route only the failed task
max_cost_per_taskThe most one task may spendauto: set by the balance
pinA model that always does one kind of workimages: gemini

Prefer sponsored models

With prefer: sponsored, a sponsored model takes every task it does well, and costs nothing. When another model does a task better, that one is used, and the record shows the cost.

Keep data in a region

data_location limits tasks to providers that keep data in the places you list. Tasks covered by the rule never go to a provider outside them.

Pin a model

pin sends one kind of work to one model every time. Pin as few as you need: unpinned work keeps getting the best model as the board changes. You can also choose the model yourself on any single task, and Maestro uses the one you chose.

Kinds of work

The kinds of work a rule can name are the ones on the board: specs, drafting and planning, hard planning, code, summaries, testing, review, research, images, translation, extraction, cleanup and tagging.

Was this page helpful?