Skip to content

models.route

Decide which declared model a stated need selects: the first in declaration order satisfying every requirement, the qualifying rest as the fallback chain, and every excluded model with the first check it failed. Pure over the catalogue and the input — the same question gets the same answer, and 'why' is in the answer itself.

Decide which declared model a stated need selects: the first in declaration order satisfying every requirement, the qualifying rest as the fallback chain, and every excluded model with the first check it failed. Pure over the catalogue and the input — the same question gets the same answer, and 'why' is in the answer itself.

Exposure

Where this one definition is reachable. Absence is explicit: a surface not listed does not carry it.

surfaceas
MCPtool majordomus_models_route
HTTPGET /api/v1/models/route operationId models.route
command linemajordomus models route

Schemas

The canonical input and output, from the Rust types; the MCP tool schema and the OpenAPI parameters and responses are derived from these.

input · RouteInput

The input of models.route: what the task needs, in transport-friendly scalars (require is comma-separated so a GET query string can carry it).
propertytyperequireddescription
local_only boolean | null no Only local inference.
min_context integer | null no The least context window, tokens.
model string | null no A model named outright, by canonical id or alias — still checked against the other requirements.
require string | null no Capability words the model must declare, comma-separated: vision,tools.
vendor string | null no Only this vendor.
JSON Schema
{
  "additionalProperties": false,
  "description": "The input of `models.route`: what the task needs, in transport-friendly scalars\n(`require` is comma-separated so a GET query string can carry it).",
  "properties": {
    "local_only": {
      "description": "Only local inference.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "min_context": {
      "description": "The least context window, tokens.",
      "format": "uint64",
      "minimum": 0,
      "type": [
        "integer",
        "null"
      ]
    },
    "model": {
      "description": "A model named outright, by canonical id or alias — still checked against the\nother requirements.",
      "type": [
        "string",
        "null"
      ]
    },
    "require": {
      "description": "Capability words the model must declare, comma-separated: `vision,tools`.",
      "type": [
        "string",
        "null"
      ]
    },
    "vendor": {
      "description": "Only this vendor.",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "title": "RouteInput",
  "type": "object"
}

output · RoutingDecision

The routing answer: what was selected, what stands behind it, who fell out and why. The whole decision is derived from the catalogue and the requirements — run it twice, get it twice; there is no state to consult and no health to guess.
propertytyperequireddescription
excluded array no Every model that did not qualify, with its reason.
fallbacks array no The models that also qualify, in preference order: the fallback chain.
reason string | null no Why the selected model was selected.
selected string | null no The selected model's canonical id; None when nothing qualifies.
JSON Schema
{
  "$defs": {
    "ExcludedModel": {
      "description": "One model that did not qualify, and exactly why.",
      "properties": {
        "model": {
          "description": "The canonical id.",
          "type": "string"
        },
        "reason": {
          "description": "The first reason it fell out, in the order the checks run.",
          "type": "string"
        }
      },
      "required": [
        "model",
        "reason"
      ],
      "type": "object"
    }
  },
  "description": "The routing answer: what was selected, what stands behind it, who fell out and why.\nThe whole decision is derived from the catalogue and the requirements — run it\ntwice, get it twice; there is no state to consult and no health to guess.",
  "properties": {
    "excluded": {
      "description": "Every model that did not qualify, with its reason.",
      "items": {
        "$ref": "#/$defs/ExcludedModel"
      },
      "type": "array"
    },
    "fallbacks": {
      "description": "The models that also qualify, in preference order: the fallback chain.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "reason": {
      "description": "Why the selected model was selected.",
      "type": [
        "string",
        "null"
      ]
    },
    "selected": {
      "description": "The selected model's canonical id; `None` when nothing qualifies.",
      "type": [
        "string",
        "null"
      ]
    }
  },
  "title": "RoutingDecision",
  "type": "object"
}

Policies

benchmark
required — a target on every transport the exposure declares; the cases are the input type's
cache
disabled — every call runs the handler

Benchmark targets

Derived from the registry for this repository: one requirement per transport, and the cases the input type provides. The whole matrix is on the benchmarks page.

transportstatecasestargets
directcovered1default
mcpcovered1default
httpcovered1default

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