Settings: models and decision engines
Models
A model route is one model on one server, with the credential and settings the gateway uses to call it. People pick a route by its display name when they start or continue a task.
A change applies to new tasks, and to open tasks from their next message; a message already running keeps its route. A rotated key or a changed server address applies to the next model request at once.
The list
The Model routes table shows, for each route:
| Column | Meaning |
|---|---|
| Route | The display name (or the route name, when it has none) |
| Model | The model name. When the routes don't all use the same protocol, it is under each model: Chat Completions, Responses or Messages. A route's own page always names it, on its "Connects to" line and under Advanced › Connection |
| Key | The name of the shared key the route sends (as Keys › Shared names it; the full secrets/<name> reference on hover), No key, Key missing when the named secret does not exist yet (with a link to Add it under Keys › Shared), or Key needed when the route has no usable key (use Paste key in the route's menu) |
| Source | Configuration file, No longer in the configuration file or Added here (see Files and the settings pages). Shown once any route comes from the configuration file; when every route was added on the page, it is left out |
Each route has Edit and a menu (the three dots) with Check, Paste key when its key is needed, and Delete. A Delete that isn't possible says why in the menu.
With no route yet, the page says "No model routes yet. Add one so people can start tasks.": nobody can start a task until there is one.
Download models.toml saves every route in the file format the installation starts from, so the current routes can be kept, reviewed or copied to another installation. The file names each route's key but never holds its value, as the line under the button says.
Check a route
Check, in a route's menu, opens a dialog that tests the stored route the way a task will use it: a short
streamed request with one tool call and its result. Nothing runs until you choose Run check, because a check uses
a few tokens; it can take up to a minute. A local model (on this computer or your network: a loopback address,
localhost, the container host, a single-label name such as a compose service like ollama, a .local or
.internal name, or a private, link-local or Tailscale address; or a route without a key) is checked by its
progress instead: each answer may take 2 minutes to start ([relay] local_check_timeout in gateway.toml, 1-600
seconds), and then the check waits as long as the model keeps answering, with no pause longer than a minute (or [relay] idle_timeout
when that is lower), for up to 10 minutes in all. A model on a computer without a suitable GPU can
take minutes: the dialog says "Checking… local models can take a minute or two.", and after the first minute how long
it has waited. A check that runs out of time says what to do next: for a local model, that it may be busy with another
task or slow on this computer, to try again when it's idle, and that setting; for another route, to try again in a
moment.
A local model that works but answers slowly (under 15 tokens a second) passes with its speed in place of the "…": "Verified, but slowly: this model answers at about … tokens a second here, so a task's step can take minutes, and helpers or a Desktop task far longer. A computer with a suitable GPU, or a hosted model, is much faster. See the user guide's Running without a GPU section." The check's details show the speed of every check that had usage. A local model that answered the tool call and the round trip and was still answering when the check's time ran out in the last step, the two-line test value, passes the same way, with that step's warning: it works for tasks, slowly. A model that stops answering for longer than the relay's idle limit fails the check in any step, as its tasks would.
The result starts with a verdict, "Verified: this route works for tasks." or "The check failed." with the reason, and the button then reads Run again. What was observed is folded under Details: Streaming, Tool call, Tool result round trip, Strict tools keep line breaks, Usage reported, Reasoning level accepted, First response, Total time and Tokens used. When the server answered with an error, its status and a short, redacted excerpt appear under What the server answered, as plain text.
The route's row then shows the latest result: Verified, Check failed, or Check out of date once the route's settings have changed since. Check failed opens the route's check and runs it again, so the reason is one click away; New task's Check it does the same. A check describes the route's settings when it ran, not its key: after changing a key, check again.
| Message | What to do |
|---|---|
| This route has no key yet. | Add the shared key the route names (the dialog links to Keys, Shared) |
| A check of this route is already running. | Wait for it to finish |
| Checked too recently. Try again in … s. | A route can be checked once every 30 seconds, and each administrator can run 10 checks a minute. When the route's last check is only moments old, as right after the installer checks it, the dialog shows that check's result and the time it ran instead, with the wait before a new one |
| The check ran out of time and stopped. Local models can take a minute or two to answer: try again once the model has loaded. | The server may be overloaded, unreachable or still loading the model; try again later |
| With strict tools the server dropped the line break from a tool’s text, and without strict it kept it; multi-line edits would fail. | Set Strict tool schemas to Never (see below) and check again |
| The model didn’t write the two-line test value, so whether strict tools keep line breaks wasn’t checked. | A warning, not a failure; check again, or try another model |
| The server held part of the answer back: its own tool-call parser takes calls the model writes in its native format. Tasks recover by asking again with the tools declared, but this route works better with Tool calls on. | A warning on a route with Tool calls off: turn Tool calls on for it, or serve the route without the server's own tool-call parsing (below) |
Some failures say what to try next:
- A route at
localhost(or127.x,::1) that the check can't reach: inside the gateway's container, localhost is the container itself, never the computer a model server runs on. The result says so. Where the gateway can reachhost.docker.internal(Docker Desktop on a Mac or Windows, or a host entry for it), it names the address that works, such ashttp://host.docker.internal:11434/v1. Use host.docker.internal then opens the route with that address, unsaved: save it, then check again. Where the name doesn't resolve (most Linux installs), it says to use the computer's network address with the same port, and offers no click. - A server on this computer or your network that the check can't reach: the result asks "Is the server running, and
listening on that address? Ollama listens on 127.0.0.1 only unless it is started with OLLAMA_HOST=0.0.0.0:11434." A
server that listens on 127.0.0.1 only can't be reached from any container, at the computer's network address either.
Setting
OLLAMA_HOSTalso opens Ollama to your network: keep that network to people you trust, or run Ollama as a container on the stack's network instead (the install guide's model endpoint). - No endpoint for the route's protocol (a 404 or 405 on the check's own request, not a model the server doesn't
know): "The server has no endpoint for this route's protocol at this address." It names the protocol the route
speaks and the two others to try under Advanced › Connection, and says the address often ends in
/v1. A model name the server doesn't know still reads "The server does not know this model or address." - A server that refuses usage reporting: the rest of the check worked without it, and Edit the route with this setting opens the route with Ask the server for token usage unticked and focused, unsaved.
When the provider refused the route's tool settings, the result suggests a change, such as "The provider refused a tool schema in strict mode." with "Try Strict tool schemas: Never", or "Try Schema keywords: Basic only". Edit the route with this setting opens the route's form with that change made, unsaved: save it, then check again.
Local models need room
A task's requests are large from the start: the agent's instructions and its tools come to about 2,300 tokens before the person's first message, and each file the agent reads adds up to about 2,000 more. A model server that gives the model less context than that doesn't refuse a request that's too long: Ollama, for one, quietly drops the oldest messages, the person's request first, and the agent carries on without knowing what it was asked to do.
Ollama chooses the context itself unless told otherwise: 4,096 tokens when the GPU memory it detects is under 23 GiB,
too little for tasks; 32,768 from 23 GiB, and 262,144 from 47 GiB. Its log says which it chose at start ("vram-based
default context"). So when a local route's server is Ollama, the check also
asks it how much context the model it just answered with has (the CONTEXT column of ollama ps):
- below 16,384 tokens, the check fails, names both numbers and says how to raise the server's context; matching the route's Context window to it wouldn't make tasks work, so it isn't offered;
- at 16,384 or more, the check passes, with a note when the route's Context window is empty or says otherwise, and one click to set it to the server's number.
Raise Ollama's context to 32,768 tokens (more if the computer has the memory; a larger context takes more), then check again:
- On a Mac with the Ollama app: run
launchctl setenv OLLAMA_CONTEXT_LENGTH 32768, then quit and reopen Ollama; or set the context length in the Ollama app's settings. - On Windows: quit Ollama, add the user environment variable
OLLAMA_CONTEXT_LENGTHwith the value32768, then open Ollama again; or set the context length in the Ollama app's settings. - On Linux with Ollama as a service: run
systemctl edit ollama.service, addEnvironment="OLLAMA_CONTEXT_LENGTH=32768"under[Service], thensystemctl restart ollama. - In a container: start it with
-e OLLAMA_CONTEXT_LENGTH=32768.
ollama ps then shows 32768 under CONTEXT once the model is loaded. Set the route's Context window to the same
number: left empty, a task plans with 32,768 tokens as a guess, and only three quarters of it. Other local servers
(LM Studio, llama.cpp) aren't asked; set their context and the route's Context window to the same number by hand.
List a route's models (API)
GET /api/v1/admin/routes/{name}/models, with an administrator's session or token, lists the models the route's
server offers, using the route's stored key, which never leaves the gateway. Only ids and display names come back, at
most 500 (truncated says there were more). When the server refuses, failure names it as a check does, with a
redacted excerpt; many proxies have no model list and answer not_found. A route can be listed once every 30
seconds, and each listing is audited. The route's page offers it as List models (below).
Add a route through the API
PUT /api/v1/admin/routes/{name} adds a route as the form does, but it doesn't bind the route to its key. A route may
read a shared key only once the key names it among its consumers. Until then, the PUT answers 409 secret_not_allowed. So set the key's consumers first, with PUT /api/v1/admin/secrets/{key name}/consumers, its
list including {"kind": "route", "name": "<the route>"}, at the version read. This call needs an administrator's signed-in session, not an API token. The form's
Key and Paste key do this for you.
Add or edit a route
Choose Add route, or Edit on a route: it opens on a page of its own, with Models at the top to go back and Save and Cancel at the bottom; leaving with unsaved changes asks first. Adding starts with Where does the model run?: A hosted service (its address and a key), A server on your network (its address, and a key only when It needs a key is ticked) or Something else (every setting, with Advanced open). What most routes need comes first; the rest waits under Advanced, closed until you open it (it opens by itself for a check's suggestion or a problem inside):
| Part | Fields |
|---|---|
| Route | Display name (required: it is what people pick), Description (optional: one line on what it is good for, shown under its name where people pick a model), Address (its hint gives an example that fits the answer to Where does the model run?, such as https://api.openai.com/v1, or http://ollama:11434/v1 and "Not localhost"), Model (the name the server expects; when adding, its hint says List models comes once the route is saved) |
| Key | Adding: the Key itself, stored as a shared key named after the route when you save (numbered if the name is taken; a shared key is never overwritten), or Use an existing shared key for the Shared key field with Paste key. A route that sends no key says so |
| Advanced | Route name when adding (made from the display name until you type one; fixed once created, because tasks store it; new is reserved, in the page and in models.toml), Connection (Protocol; Send the key: No key, As a bearer token, In a header with a Header name, or In a query parameter with a Parameter name), Limits, Capabilities, Fallbacks, in order, Reasoning, and Tool calls and instructions with Extra headers and Extra body |
Saving a new route goes back to the list, which says it was saved and to check it before people pick it (a minute and a few tokens), with Check … now, which opens its check.
When you edit a route, its connection reads as one line, "Connects to … · …", with Change, and its key as "Uses the shared key …" with Replace key, which stores a new key for this route and never changes a shared key other routes use, and Use another shared key.
Under Limits, Context window left empty makes a task plan with 32,768 tokens as a guess, three quarters of it
usable: set it to the model server's real context (see Local models need room).
Max output left empty uses the server's own: with no Max output, a task's
requests name no output limit on Chat Completions and Responses, so the model server's own applies (the task plans its
context with 4096 tokens for the answer). Anthropic Messages requires a Max output, so the form asks for one there. A
set Max output is a cap: when the conversation leaves less room in the context window, a request asks for what's left,
down to 4096. When a model spends its whole limit thinking and writes nothing else, the task stops saying so; sending
the message again often gets an answer, and if it keeps happening, raise Max output above the limit it hit, or give
the model a thinking budget below Max output in Extra body, if its model server takes one. On vLLM (with a
reasoning parser, such as --reasoning-parser qwen3) that is {"thinking_token_budget": 12288} with a Max output of
16384: at the budget the server ends the thinking and the model answers in what is left. An empty
Max output is no fix: it lets a model that keeps thinking run to the context window. Some local models (qwen3 on
Ollama, for one) think before every answer and can't be told not to; Check says so when the route's Max output is
lower than 16384, and offers a button that sets Max output to 16384 (or to half a smaller Context window), filling it
in for you to save.
Concurrency and
Requests per minute left empty set no limit. First response within is how many seconds to wait for the model's
first answer (5 to 900). Left empty, it is 300 for a model on this computer (no key, or an address on this computer or
the container host), which may read a long prompt for minutes on CPU, and 60 otherwise; while a task waits past 10
seconds, the page says "Waiting for the model to start answering…". Capabilities are Tool calls, Parallel tool calls,
Image input, Ask the server for token usage and Caching (None, Prefix or Cache control blocks).
Ask the server for token usage is on by default: tasks ask the model server to report the tokens each reply used, which budgets and the
usage pages count. Turn it off only for a server that refuses the request: the route's check then fails and offers to
turn it off for you.
Fallbacks, in order are up to three other routes the gateway switches to when this one is unavailable, shown and
chosen by their display names; Up, Down and Remove reorder them. Reasoning, when This route accepts a reasoning level is on, sets the
Request field, the Allowed levels, the Default level and optional Token budgets per level.
Tool calls and instructions adjusts how the gateway sends tools and instructions, for providers that differ:
- Strict tool schemas: Every tool, Only schemas that qualify or Never. Some providers refuse strict schemas; if a check says so, choose Never.
- Schema keywords: All, or Basic only, which keeps the JSON Schema keywords most providers accept.
- Instructions go as: The protocol's default, A system message, A developer message or The instructions field. Messages routes always send them as the instructions field.
A route with Tool calls off has the model write its calls as text. Some model servers parse tool calls themselves (an inference server with automatic tool choice turned on, for example): when the model writes a call in its own native format, the server takes it, and on such a route, which declares no tools, the call never arrives. Serve these routes without the server's own tool-call parsing, or turn Tool calls on for them. A task recovers either way: a reply the server held back is asked again once with the tools declared, and the transcript says "The model server hid a tool call". After that, the task declares the tools on every request. A route whose server refuses declared tools stays text-only for that task.
List models, under Model when you edit a saved route, asks the route's server which models it offers, using the route's saved address and key, and lists them with a Filter models box. Pick one to fill Model; nothing is saved until Save. It works only on what is saved: after changing the address, protocol, key or headers, save first ("Save the route first: the list uses its saved address and key."). It lists at most 500 models, says when there are more, and names a refusal as the check does, with what the server answered. A route can be listed once every 30 seconds; within that wait, the page shows the last list it got and says when you can list again.
Keys never go in the form's fields. Store the key as a shared key (see Shared keys) and choose it under
Shared key, or use Paste key: it stores what you paste as a new secret, with a Secret name (the route's name and
-key by default) and the Key, then Store key. The secret is allowed for this route (if that step fails, saving
offers to allow it), and the form picks it; save the route to use it. A name already taken is refused, and nothing is
overwritten. A route whose key is deleted later, or one the configuration file gives a key not stored yet, is shown as
Key missing, and its model requests fail until the key is added; it can still be edited and saved. Shared key takes the name of a key listed there, as Keys › Shared shows it (or its secrets/<name> reference, as
configuration files write it); store a new key first, with Paste key or under Keys › Shared. Anything else, such
as a pasted key, is refused and never saved. A route whose key was pasted there by an earlier version has had that key
removed; it is shown as needing its key again and is not used until you enter one. Rotate such a key with its provider,
since it was stored in plain text.
The gateway checks a route the same way it checks models.toml, so the page refuses what the file would refuse. The
common refusals:
| Message | What to do |
|---|---|
| Use letters, digits, '.', '-' and '_', up to 64 characters. | Shorten or simplify the route name |
| Use the server's http:// or https:// address, without a name or password. | Remove any user:password@ part; put the key in a secret |
| Choose the secret that holds the key, or send no key. | Pick a shared key, or choose No key |
| Paste the service's key, or use an existing shared key. | Adding a route with its key typed in: paste the key, or Use an existing shared key |
| Enter the name of a shared key, or use Paste key to store one. | Shared key holds something that isn't a listed key's name (a key pasted there, say): pick a listed key, or store the key with Paste key |
| Put credentials in a secret, not in a header. | Remove the header from Extra headers; use Send the key instead |
| That header is set by the gateway. / These body fields are set by the gateway and cannot be overridden. | Remove the field; the gateway sets it for every request |
| Fallbacks must be other routes, at most 3, without loops. | Remove the route itself, extra entries, or a fallback that falls back to this route |
| Name the request field, and make the default one of the allowed levels. | Complete the Reasoning part |
Delete a route
Delete asks for confirmation. Tasks on a deleted route fail their next model request until the person picks another model, so move people to another route first. A route that other routes use as a fallback cannot be deleted; the page names those routes ("Other routes fall back to it: …"). Remove it from their fallbacks first. A route from the configuration file stays deleted after a restart unless its entry in the file changes, and the confirmation says so.
Decision engines
A decision engine is a service that a task consults at each step, to choose the model, narrow the tools or stop the step: your own, or an outside multiple-choice service that picks the model route before each step (see Decision engines). A task uses one only when its profile names it. The installation keeps the engine's key; the agent never sees it.
The list
| Column | Meaning |
|---|---|
| Engine | The display name, with the engine's host under it (and From the configuration file for an engine from there) |
| Sees | Tool names only, Names and arguments or Full conversation |
| Status | On or Off, and Key missing (with Add it under Keys › Shared) when the key's secret does not exist |
Each row has Edit, and a … menu with Turn off (or Turn on) and Delete.
Add or edit an engine
Add decision engine first asks What kind of engine is it?:
- Your own engine: a service of yours that speaks this product's decision protocol, asked before each step and after each answer;
- A multiple-choice service: an outside service that answers multiple-choice questions and picks the model route before each step.
Continue opens the form for that kind; Change beside the kind goes back to it and keeps what you typed. An engine keeps its kind, so Edit opens the form directly. The form asks for:
- Display name, what people see here and in profiles;
- Engine address, the engine's
https://address; - Key: a shared key (Keys › Shared) that is allowed for this engine, never a value, or None: the engine needs no key. There is no default: an engine is never saved without a key by mistake;
- Model, for a multiple-choice service only: the model identifier the service expects, as its documentation gives it;
- The engine sees: Tool names only (the default), Names and arguments, or The full conversation;
- the budget: No budget until you choose Set a budget. Then Calls, Tokens (a multiple-choice service only) and Per: In total or Each month (UTC). In total counts from when the budget was saved, and saving a new budget starts a new count; each month counts the whole month, even after you change the budget in it. Once the budget is used up, the agent decides on its own until the period ends, and the task's owner is told. A line under the row reads the budget back with big numbers grouped. Remove the budget goes back to none.
More options holds the rest, with good defaults:
- Identifier, made from the display name and fixed once the engine is added;
- Send the key: As a bearer token (the default) or In a header with a Header name;
- Time to answer (seconds): up to 10 seconds, 2 by default;
- for a multiple-choice service, Confidence needed to switch routes (0 to 1, 0.6 by default; below it the task keeps its own route for that step) and Route descriptions: one optional line for each model route, saying when it suits a step, up to 200 characters and 16 routes. A description of a route that no longer exists is kept, marked as no longer a model route, until you empty it.
Choosing an option that lets the engine see more asks you to confirm first, and the change is recorded in the administration audit. A task already running keeps what the engine saw when it started; after you narrow an engine, such a task decides on its own until it next runs.
Turn off asks first and says what it does: tasks whose profile uses the engine are refused, and told why, until it is on again, and then their owners send a message to continue. Turn on applies at once. An engine that profiles or open tasks use can't be deleted: turn it off instead, or change those profiles first.
| Message | What to do |
|---|---|
| Choose the engine's key, or None if it needs none. | Pick the key's secret, or None for an engine without one |
| Enter the model the service expects. | Copy the model identifier from the service's documentation into Model |
| Keep this description to one line of up to 200 characters. | Shorten that route's description |
| Calls must be 1 or more, or left empty. | A limit of 0 isn't allowed: leave the field empty for no limit on it (the same for Tokens) |
| Use the engine's https:// address, without a name, password or fragment. | Remove any user:password@ part and any #… |
| … isn't allowed for this engine. Allow it first. | Choose Allow it for …, then save again; or tick the engine under the secret's Who may use |
| … use this engine. Turn it off instead, or change those agent profiles first. | Choose Turn off in the engine's … menu, or choose another engine in those profiles |
| An installation holds at most 16 decision engines. Delete one first. | Delete an engine nothing uses |