Skip to content

A routing decision names why the selected model was selected and, for every excluded model, the first check it failed — the same answer for the same question, with no hidden state

Ask models.route which model satisfies a need — required capability words, a minimum

declared statusdeclared status: guaranteed Declared deterministic and blocking, implemented, and naming the behavioural test that is to prove it. Whether a recorded run supports it is the evidence verdict, shown beside it.

recorded evidencerecorded evidence: not run Declared guaranteed, and not supported by a recorded run: the test is named, and no passing run of the current inputs is recorded. how evidence is recorded

Routing is a pure function over the declared catalogue and the stated need; the unit tests prove the preference order, the fixed check order behind every exclusion reason, and that a model named outright is still checked against the requirements.

What it means

Ask models.route which model satisfies a need — required capability words, a minimum context window, a vendor, local-only inference, or a model named outright — and the answer carries its own explanation: the selected model with the reason, the qualifying rest in order as the fallback chain, and every excluded model with the first check it failed, in a fixed check order. There is no health guess, no load estimate, no hidden score: routing is a pure function over the declared catalogue, so the same question gets the same answer, and "why did this pick X" or "why was Z excluded" is read off the decision instead of asked of a black box.

How it works

models::route (apps/majordomus-cli/src/models/mod.rs) walks the catalogue in declaration order; disqualify applies the checks — named-outright, lifecycle, vendor, locality, capabilities, context — and returns the first failure as the exclusion reason. A model named outright is still checked, so an override that cannot do the work is an exclusion with a reason, never a silent selection; deprecated and retired models qualify only when named. The unit tests prove the preference order, every reason string, the override semantics and the empty-catalogue answer; test/cases/131_models.sh proves the same through the command line in text and JSON.

How to see it

majordomus models route --require vision --min-context 500000
majordomus models route --model haiku --require vision      # a refused override, with the reason
curl 'http://127.0.0.1:8741/api/v1/models/route?require=vision'
bash test/run.sh 131_models

What it does not cover

The decision does not consider health, load or price — facts this tool cannot verify have no seat at the table, and a caller who knows better simply names the model outright (and is still checked). Recording which model actually executed a session's work is the capture adapters' follow-up, not this function's promise.

Why it exists

An unexplainable router is a black box somebody eventually distrusts and routes around, at which point there are two routers. A pure function whose answer carries its own reasons can be read, tested and argued with — which is what keeps it the only one (ADR 0049).

Detail rendered from docs/claims/models-routing-explains-itself.md.

From the statement to the proof

  1. 1 · the public statement

    A routing decision names why the selected model was selected and, for every excluded model, the first check it failed — the same answer for the same question, with no hidden state

    Made on Models.

  2. 2 · the canonical claim

    models-routing-explains-itselfdeclared status: guaranteed in docs/CLAIMS.yaml

    Defined in read it on this site · docs/MODELS.md

  3. 3 · the implementation

    apps/majordomus-cli/src/models/mod.rs

  4. 4 · the test and the scenarios

    Test: test/cases/131_models.sh

  5. 5 · the recorded runs

    recorded evidence: not run how evidence is recorded

Verify it yourself

The test runs in a disposable temporary repository and asserts the behaviour, not a string in the source.

from a clone of the repository
bash test/run.sh 131_models

Related claims same implementation

Searches the titles and descriptions of every page this site publishes.