ModelSaar

Release candidate: decision models

Two opt-in, experimental features merged into main on 2026-10-28 let ModelSaar use decision models — small models that answer typed questions with probabilities instead of generating text. They are available for testing as the GitHub pre-release v0.1.0-rc.2 (tag on commit 7e7579825a2d), which adds the continuation probe and a corrected 422 remedy on top of v0.1.0-rc.1 (commit 5b947f2859a7, still available unchanged). This is a release candidate for testing, not a stable release: no package, no container image, and the default installer and the stable installation path are unchanged.

Status: GitHub-only release candidate (release notes). Both features are fixture-tested in CI (fake backend speaking Ollama's documented decision API), and one bounded live smoke test — three requests against a real decision model — succeeded on 2026-10-28 (details below). Nothing here has been benchmarked: no claim is made about answer quality or about the classifier improving routing.

What the two features do

POST /v1/decisions

Ask a decision model typed questions about a state (a string, or any JSON object/array) and get back per-option probabilities. The request and answer are Ollama's documented System One contract (POST /v1/systemone, Ollama ≥ 0.35.0), carried through the gateway's usual API-key authentication, model resolution, admission, locality policy and decision record:

routing.classifier.mode: decision

The optional routing classifier — consulted only when the deterministic task signals are ambiguous — can now be a decision model instead of a small chat model. It is asked one choice question over the closed task-label set and the arg-max label (with its probability as confidence) refines the task label. Any timeout, error or out-of-contract answer falls back to the deterministic label, exactly as before. Default: mode: chat, classifier enabled: false — nothing changes unless you turn it on.

Prerequisites and limits

Full contract: Routing → Decisions (docs/routing.md) and Extending → Optional classifier.

Try it from GitHub (pinned to the pre-release tag)

The candidate uses the ordinary development install at the tag v0.1.0-rc.2 (commit 7e7579825a2d; GitHub pre-release), in its own directory and with its own MODELSAAR_HOME, so an existing stable installation (installer-managed environment, launcher, config, keys, service) is not touched. modelsaar --version still prints 0.1.0: a candidate does not bump the package version. The one-line installer still pins cf56cdd3416d, which does not contain these features; do not point it at the candidate, because it would replace your stable installation.

Terminal
git clone https://github.com/gopalasubramanium/modelsaar.git modelsaar-preview && cd modelsaar-preview
git checkout v0.1.0-rc.2                                               # the pre-release tag = commit 7e7579825a2d
python3 -m venv .venv && . .venv/bin/activate && pip install -e .     # or: uv venv && . .venv/bin/activate && uv pip install -e .
export MODELSAAR_HOME=~/.modelsaar-preview                           # separate config, keys and state: your normal install is untouched
modelsaar init --port 8485                                            # or: --endpoint http://host:11434 --type ollama
modelsaar discover                                                    # a decision model shows role "decision"
modelsaar serve

First decision request (the same body the live smoke test used; the API key is the first line of the preview home's keys/api_keys):

Terminal
curl -s http://127.0.0.1:8485/v1/decisions \
  -H "Authorization: Bearer $(head -1 ~/.modelsaar-preview/keys/api_keys)" -H 'Content-Type: application/json' \
  -d '{"model": "auto", "state": "Our checkout has returned 500 errors since 9am.",
       "questions": {"label": {"type": "choice", "instructions": "Which label fits this ticket?",
                                "criteria": {"bug": "Software errors", "billing": "Payments and refunds", "account": "Login and account access"}},
                      "urgent": {"type": "noul", "instructions": "Is the ticket urgent?"}}}'

Expected shape: {"model": "auto", "answers": {"label": {"type": "choice", "choice": …, "probabilities": {…}, "confidence": …}, "urgent": {"type": "noul", "noul": …}}, "usage": {…}}, with headers X-ModelSaar-Request-Id and X-ModelSaar-Deployment; modelsaar decisions shows the record with endpoint: decisions.

To try the classifier in decision mode, add this to ~/.modelsaar-preview/config.yaml, run modelsaar doctor (it checks the role/mode pairing) and restart modelsaar serve; then send an ambiguous chat request such as thoughts? to auto and look at classifier in its decision record:

yaml
routing:
  classifier:
    enabled: true
    mode: decision
    backend: ollama
    model: nimble            # a deployment with role decision (modelsaar discover)
    only_when_ambiguous: true
    timeout_s: 2.0

To remove the candidate: delete the modelsaar-preview directory and ~/.modelsaar-preview. Nothing else was written. Problems or feedback: GitHub issues.

Agentic clients that replay reasoning (new in v0.1.0-rc.2)

Clients such as Odysseus send every follow-up turn with the previous assistant message and its reasoning_content. The gateway marks such requests as needing continuation, and a deployment is eligible only when its continuation capability is supported. No runtime reports that capability, so on a fresh installation every follow-up turn of this kind answers 422 no_eligible_deployment with capability continuation is unknown on each deployment — this is exactly what the real-client Odysseus test against the stable gateway produced, and what v0.1.0-rc.1 could only pass with a hand-written override. v0.1.0-rc.2 adds a probe for it and corrects the remedy text:

Terminal
# in a second shell, same MODELSAAR_HOME, while `modelsaar serve` is running (the probe goes through the gateway admission control)
export MODELSAAR_HOME=~/.modelsaar-preview
modelsaar probe ollama/<model> --which continuation          # one bounded two-turn request; uses local compute
# the report prints continuation: supported | unsupported | unknown with the reason; re-run on unknown
yaml
deployments:
  - backend: ollama
    model: <model>           # e.g. qwen3.8:latest
    capabilities: { continuation: supported }   # operator provenance; no probe needed

A context-length exclusion on the same deployment is separate: raising context_length/num_ctx does not establish continuation, and probing continuation does not change the context limit. The remedy printed by the gateway now says both. Unprobed, undeclared deployments behave exactly as before (excluded).

Live smoke test — 2026-10-28, completed

isolated preview checkout + home on the owner's MacBook Air (in-process gateway on 127.0.0.1:50826); backend the GX10's Ollama over Tailscale; production modelsaar.service, ~/.modelsaar, the Stage A home and the Pass 1 checkout untouched. Ollama 0.40.5; decision models discovered: ollama/nimble-v3:latest, ollama/d1:latest; the configured one, nimble-v3 (9.0B, Q8_0, capabilities ['decision']). Exactly three requests were made; every number below is read from the recorded result at build time.

#requestHTTPtimedeploymentresult
1POST /v1/decisions, model: ollama/nimble-v3:latest — includes the model's first load20013 sollama/nimble-v3:latestlabel → billing (bug 0.246, billing 0.753, account 0.001), confidence 0.63; urgent noul 0.933
2POST /v1/decisions, model: auto2003 sollama/d1:latestlabel → bug (bug 0.715, billing 0.267, account 0.018), confidence 0.573; urgent noul 0.927
3POST /v1/chat/completions, model: auto — ambiguous prompt; routing.classifier.mode: decision with nimble-v32009 sollama/qwen3.8:latestclassifier used, status ok: task conversation, probability 0.997, 255.3 ms; then routed to the chat model shown

What it establishes: the wire contract works end to end against a real decision model on this one machine — authentication, discovery of decision-role models, explicit and auto selection, schema-valid answers, and the classifier in decision mode consulting the model and refining an ambiguous label. What it does not establish: answer quality, latency distributions, the classifier decision rule (one consultation), behaviour under load; this is a wire-contract and routing smoke test with three requests.

Record: docs/live-runs/2026-10-28-decision-preview-smoke/ (summary, responses, headers, decision records, discovery, launcher console; no prompts beyond the two synthetic inputs, no keys).

What this release candidate is not