Earlier this month, on November 4, I wrote about why structured chat outputs break down as soon as you use them for control flow. Asking a generative model to emit {"urgent": true} hides the odds behind sampled text, so an obvious yes and a coin flip look identical to downstream code.

Decisions, decisions, decisions
Notes on decision models as native engineering primitives, the SystemOne and OpenAI Decisions wires, and margin-gated routing.

Local runtimes have caught up with those wires too. Liquid AI published LFM3 d1 checkpoints on Hugging Face, Ollama v0.35.0 and Lemonade Server added /v1/systemone, and LM Studio exposed both /v1/systemone and /v1/decisions. What was still missing was a thin client that any terminal script or agent host could drop in front of those servers without writing another custom wrapper around curl. That is why I built what-if, an Apache-2.0 Go binary and Model Context Protocol server whose v0.1.0 release is now public.

what-if: A Roundhouse project
Single static Go binary exposing an omni-modal MCP server and CLI over standard /v1/systemone, /v1/decisions, and /v1/rerank endpoints.

The problem in code

Decisions as sensors, not chat tricks

If you have never used a decision model, think of it as a specialized classifier with calibrated probabilities rather than a chatbot following a JSON schema. Instead of sampling words one token at a time, a decision engine scores a fixed rubric against your state and returns probability mass over explicit answers. Every check acts as a sensor reading with an abstention flag rather than a guess your if statement has to trust blindly.

What abstention means here

Instead of forcing a guess when an input is ambiguous, abstention lets a model report that it is not confident enough to call it. Those low-confidence answers carry uncertain: true, giving your code a direct signal to gather more context or retry with a stronger model.

what-if wraps three core question kinds (noul for yes/no, choice for mutually exclusive classes, and score for ordered scales) and keeps raw upstream probabilities intact while adding sensor signals on top. On noul, probability 0.50 is a coin flip with confidence = 0 (|2p - 1|), whereas 0.94 or 0.06 both yield 0.88. On choice, top2_margin = p1 - p2 separates a landslide from a 0.45 vs 0.42 near-tie, while score returns a weighted numeric float across levels listed lowest first (0 to L - 1, so 0 to 1 on two levels or 0 to 2 on three). That saves you from writing one more regex around "yes, probably".

what-if architecture from callers through sensor enrichment to local and remote endpoints
Request flow from MCP hosts and shell scripts through sensor enrichment and workspace media guards to local or hosted endpoints.

By default, min_confidence starts at 0, so uncertain: true triggers only when an upstream server refuses a check. Setting a floor such as 0.70 via --min-confidence, WHAT_IF_MIN_CONFIDENCE, a specific question, or a semantic tier (fast, accurate, and omni separate lightweight checks from heavier reasoning or media backends) flags weaker answers as uncertain: true, and --fail-uncertain exits with code 2 so scripts or CI jobs escalate instead of guessing.

what-if confidence gating and workspace media boundary steps
Opt-in min_confidence gating and workspace-scoped media validation keep raw file bytes and low-confidence guesses out of agent control flow.

Media paths follow the same containment discipline. When what-if runs next to your workspace or shares a mounted directory, callers pass a path inside media_roots instead of raw bytes, and what-if verifies symlink boundaries, sniffs magic bytes, runs ffmpeg when compressed audio needs conversion to 16 kHz mono 16-bit PCM WAV, and base64-encodes payloads only on outbound HTTP egress. Remote HTTP deployments can also opt into allowlisted HTTPS fetches or authenticated POST /_/media uploads (media://<id>) kept in a scoped temporary directory. Nothing bloats agent context.

Surface area

Four tools and a plain CLI

Every MCP capability mirrors a subcommand you can run from a shell, which makes prompt rubrics easy to test before an agent calls them.

TableCore MCP tools and CLI equivalents
MCP toolCLI commandWhat it takesProtocol path
decidewhat-if ask1 to 400 checks over state, media, or MCP batch itemsPOST /v1/systemone or /v1/decisions
what_ifwhat-if comparebase_state plus 2 to 16 candidate scenariosParallel decide calls + comparison matrix
rerankwhat-if rerankquery plus 1 to 256 documentsPOST /v1/rerank, falls back to 64-doc noul chunks on 404/405/501
list_deciderswhat-if modelsOptional include_upstream toggle (CLI --no-upstream)Configured tiers plus GET /v1/models capability discovery
Batch limits, standard HTTP targets, and built-in fallback rules in v0.1.0.

If you already run the Roundhouse model gateway, or any other OpenAI-compatible gateway exposing decision capability metadata on /v1/models, pointing WHAT_IF_BASE_URL and WHAT_IF_API_KEY at it enables capability filtering and calibration warnings with zero custom request headers. The same MCP and CLI workflow works directly against local model servers (sending Authorization: Bearer only when an API key is set), while what-if serve exposes Streamable HTTP at /_/mcp with optional static bearer tokens or OAuth 2.1 validation.

Local walkthrough

Local decision models run with no API key

Any decision model served over /v1/systemone or /v1/decisions works here, including Clef, Nimble, and Liquid AI's LFM3 d1 checkpoints. Running go install github.com/roundhouse-is/what-if/cmd/what-if@latest builds the binary from source across Linux, macOS, and Windows alongside GitHub release archives (tar.gz and Windows .zip, plus the < 11 MB container image at ghcr.io/roundhouse-is/what-if:latest).

Liquid AI's LFM3 d1 release is a useful small starting point on hardware you already own, fitting comfortably on consumer GPUs, AMD APUs such as Strix Point and Strix Halo, or Apple Silicon Macs. LiquidAI/d1-2B (1.92B parameters) judges text alongside pictures and video, while LiquidAI/d1-Omni-2B (2.17B parameters) covers audio alongside text and pictures, both with 128K context under LFM Open License v1.0. With llama.cpp (b11960 or newer), one command pulls the GGUF checkpoint and serves POST /v1/systemone on port 8080. Passing -b 8192 -ub 8192 keeps the physical and logical batch sizes large enough for text rubrics alongside image or audio tokens in one forward pass. Run what-if doctor next to confirm the six runtime checks (api_key warning on localhost and ffmpeg warning if you only pass images or WAV are both non-fatal).

bash
# Terminal 1: start the local SystemOne server
❯llama-server -hf LiquidAI/d1-Omni-2B-GGUF:Q8_0 -b 8192 -ub 8192
# Terminal 2: point what-if at localhost and check wiring
❯export WHAT_IF_BASE_URL="http://127.0.0.1:8080"
❯export WHAT_IF_WIRE="systemone"
❯export WHAT_IF_MODEL="d1-omni"
❯what-if doctor
CHECK STATUS DETAIL
config ok source=defaults/env wire=systemone base_url=http://127.0.0.1:8080
api_key warn not set (sending unauthenticated upstream requests)
auth ok none (unauthenticated HTTP MCP if served)
media_roots ok 1 root(s) verified
ffmpeg ok /usr/bin/ffmpeg
upstream ok http://127.0.0.1:8080 reachable (1 decision model(s))

llama-server runs one checkpoint at a time and accepts "d1-omni" directly, though what-if requires a non-empty WHAT_IF_MODEL or tier so callers never hit an unintended default. Leaving WHAT_IF_API_KEY empty keeps any Authorization header off localhost wire traffic, and WHAT_IF_WIRE defaults to auto (/v1/systemone unless cache_key routes to /v1/decisions). To wire what-if into MCP hosts such as Claude Desktop or Cursor over stdio, add the entry below with your workspace path (which what-if helps if GUI apps miss ~/go/bin, and OpenCode users place the command array under "mcp" with "environment" in opencode.json).

JSONmcpServers entry
{
  "mcpServers": {
    "what-if": {
      "command": "what-if",
      "args": ["mcp"],
      "env": {
        "WHAT_IF_BASE_URL": "http://127.0.0.1:8080",
        "WHAT_IF_WIRE": "systemone",
        "WHAT_IF_MODEL": "d1-omni",
        "WHAT_IF_MIN_CONFIDENCE": "0.70",
        "WHAT_IF_MEDIA_ROOTS": "/path/to/workspace"
      }
    }
  }
}
Local stdio MCP wiring against llama-server; point WHAT_IF_MEDIA_ROOTS at the directory holding your media files.

Three managed local runtimes also work out of the box. In Ollama (v0.35.0+ for /v1/systemone, clef, clef-flash on v0.35.1+, and nimble alongside d1 and d1-omni), you can pull ollama pull clef-flash or ollama pull d1-omni:2b, set WHAT_IF_BASE_URL="http://127.0.0.1:11434", and point WHAT_IF_MODEL at the pulled tag (note that d1:latest points to 3b and d1-omni:latest points to 600m, so ask for :2b explicitly when targeting those checkpoints). In LM Studio (http://127.0.0.1:1234), loading a decision checkpoint turns on both /v1/systemone and /v1/decisions; run what-if models to copy the exact loaded ID into WHAT_IF_MODEL. In Lemonade Server (http://127.0.0.1:13305), /v1/systemone serves llama.cpp GGUF deciders such as Laya-GGUF alongside FastFlowLM d3 models such as d3-lite-FLM on Ryzen AI NPUs, and /v1/rerank serves native reranker models on the same port.

Queries and use cases

Triage, counterfactuals, and reranking over one wire

Once what-if doctor reports green checks, scripts can pack several typed questions and an image or audio path into a single ask call. Setting --fail-uncertain returns exit code 2 whenever confidence drops below 0.70.

SHELLSCRIPTMultimodal triage check
what-if ask \
  --state "Card charged twice for March invoice." \
  --media invoice-err.png \
  --noul "urgent=Does the customer need a response today?" \
  --choice "team=Route the ticket|billing:Invoices and charges,support:Product help,other:Anything else" \
  --score "tone=Assess frustration|calm,annoyed,angry" \
  --min-confidence 0.70 \
  --fail-uncertain \
  --json
Score urgency, team routing, and tone alongside a screenshot, failing with exit code 2 if confidence falls below 0.70.

Passing --json returns both the selected value and the margin metadata your caller needs for branching, while an MCP client invoking decide passes the same question map and "media": ["voicemail.mp3"] over JSON-RPC.

JSONIllustrative ask response
{
  "model": "d1-omni",
  "calibrated": true,
  "answers": {
    "urgent": { "type": "noul", "noul": 0.94, "confidence": 0.88, "uncertain": false },
    "team": { "type": "choice", "choice": "billing", "confidence": 0.76, "top2_margin": 0.70, "uncertain": false },
    "tone": { "type": "score", "score": 1.65, "uncertain": false }
  }
}
Calibrated fields added on top of raw probabilities (values shown illustrate output structure).

Single-item checks solve gating at the point of entry. The second workflow tests a decision before you send an awkward reply or ship a borderline change. In what-if compare or MCP what_if, passing a plain string scenario replaces base_state completely, so use a JSON object for --base-state and patch wrapper objects in --scenario to RFC 7396 merge each candidate variant onto the shared ticket.

SHELLSCRIPTCounterfactual CLI check
what-if compare \
  --base-state '{"ticket":"Customer reports duplicate March charge and asks for help."}' \
  --scenario 'draft_a={"patch":{"reply":"Wait until next month'\''s statement clears."}}' \
  --scenario 'draft_b={"patch":{"reply":"Refund queued; receipt sent by email."}}' \
  --noul "urgent=Does this need immediate action?" \
  --choice "team=Route reply|billing:Charges and refunds,support:General product help" \
  --score "tone=Assess helpfulness|dismissive,helpful" \
  --min-confidence 0.70 \
  --json
RFC 7396 JSON patches merge candidate replies onto base_state and compare flipping, margins, and deltas.

If an agent compares those two replies, scenarios.draft_a.uncertain_count hits 2 because both urgent (conf = 0.16) and the two-way team choice (top2_margin = 0.07, confidence 0.07) fall below 0.70, while comparison.team.flipped is true against draft_b.

what_if counterfactual comparison output showing draft_a uncertain_count 2 and draft_b routing to billing
Comparing two candidate reply patches under one shared rubric surfaces uncertainty counts and routing flips.

Reranking works over the exact same connection when your local server implements /v1/systemone without /v1/rerank. With --return-documents left at false (matching MCP return_documents: false to keep context windows light), fallback chunks candidate strings into 64-doc batches over decide using noul relevance checks under auto or systemone.

SHELLSCRIPTRerank over SystemOne
what-if rerank \
  --query "duplicate card billing escalation policy" \
  --docs-file runbooks.txt \
  --top-n 3 \
  --json
Rank up to 256 documents from a candidate file or repeated flags, returning top indices and scores.

Agent guidance

Why the binary also speaks Skills over MCP

Strict MCP schemas prevent invalid arguments, yet LLMs still make poor operational calls with valid JSON. They specify accurate on trivial lookups, inline raw base64 media instead of workspace file paths, or branch silently on uncertain: true answers instead of escalating.

To keep caller guidance pinned to the running server build, what-if compiles its own SKILL.md into the Go binary and exposes it through the Skills over MCP extension (io.modelcontextprotocol/skills, SEP-2640, at skill://what-if/SKILL.md with SHA-256 digests). Compatible clients pull rules like escalating uncertain: true or narrow < 0.15 choice margins automatically, and clients without extension support still get the core usage summary in the MCP instructions string during initialization.

what-if does not bundle an inference runtime or act as a hosted model router. Inference stays in llama.cpp, Ollama, LM Studio, Lemonade Server, or Roundhouse, while orchestration stays in your script or MCP client so the compiled binary stays small and vendor-neutral.

Decision models do not replace deterministic checks like regexes or exact arithmetic, and any min_confidence cutoff is only as trustworthy as the labeled edge cases you test it against before putting it in front of users.

References

Sources

  1. what-if Documentation and roundhouse-is/what-if on GitHub (Apache-2.0, v0.1.0)
  2. Arun Babu, Decisions, decisions, decisions (abn.is/void, November 2026)
  3. Liquid AI, d1-2B and d1-Omni-2B model cards on Hugging Face (LFM3-VL-2B and LFM3-Omni-2B, LFM Open License v1.0)
  4. Ollama documentation, Decision models, SystemOne API, Clef, Nimble, and d1 / d1-omni libraries (v0.35.0+)
  5. LM Studio developer documentation, SystemOne compatibility and OpenAI Decisions compatibility
  6. Lemonade Server API reference, POST /v1/systemone and POST /v1/rerank
  7. Model Context Protocol Working Groups, Skills over MCP (io.modelcontextprotocol/skills, SEP-2640)

Disclosure

In case you were wondering

I designed and built what-if with the assistance of several coding agents, chose the examples here, and reviewed the final version. A coding assistant checked flag names and endpoint schemas against the repository and live documentation, created and rendered the three diagrams; and collaborated on the prose. Numbers shown in the sample JSON and counterfactual diagram illustrate structure rather than benchmark measurements.