Skip to content

Decision

Decision asks TypeSafe’s Jev model one typed question per message and returns a structured answer your graph can branch on — probabilities, not prose. It ships with Requence as an ordinary external service: it is added once, with its variants, through the normal service UI, and then behaves like any service you wrote yourself.

Variant Mode What it returns
choice Linear The option with the highest probability, its confidence, and every option’s probability
score Linear A score on a scale of 2–10 levels (the probability-weighted level), with probabilities
noul Linear noul: the probability of yes, from 0 to 1 — on the true output when it is 0.5 or more, else on false
box Linear The bounding box of one thing in an image, as fractions of its height and width

noul has no default output: it continues on true or false, and both carry the same noul value, so a stricter line than one half can still be drawn downstream. Each also carries a confidence: the probability that the output taken is right — noul on true, 1 - noul on false. Its node shows two bars, true and false, each as long as its probability.

A choice node shows one bar per option, in the order you configured them, with the picked option highlighted and the confidence below.

Every node asks the current Jev (jev-latest); there is no model to configure. Every variant returns the model that answered — a versioned id such as jev-1.14.0, which is what to compare when results change — and the token usage.

Input
state What Jev decides about: text, a JSON value or an array. Required except for box.
images Optional PNG or JPEG files by name. Point at one by its name, e.g. “the coffee mug in photo”. box needs at least one.
Configuration
apiKey Your TypeSafe API key. Bound to the TYPESAFE_API_KEY variable when you pick the variant.
instructions The question. Required for noul and box.
criteria choice: the options, name → what it means (leave a meaning empty when the name says it all). score: the levels, lowest first. noul: optionally what counts as yes and as no.

Set the key once: create a secret variable TYPESAFE_API_KEY on your organization, and every Decision node in every project finds it. A project that should run on its own key — or its own bill — shadows it with its own variable of the same name.

  • A rate limit (429), an overloaded or unavailable TypeSafe, or no connection: the node tries again after a short delay (the server’s retry-after, at most a minute), and says so on the node.
  • A refused API key, or a request TypeSafe rejects (too long for the model’s context, an unreadable image): the node fails with TypeSafe’s reason. Trying again would not help.

The deployment picks the model, not the node. Three environment variables on the Decision service set it:

Variable
DECISION_MODE JEV or CLEF. When it is not set, the base URL decides: a Workers AI URL (api.cloudflare.com/…/ai/run, or an AI Gateway URL ending in /workers-ai) means CLEF, anything else JEV.
DECISION_BASE_URL A host that serves the System One API (/v1/systemone is added). JEV: default https://api.typesafe.ai; for OpenRouter https://openrouter.ai/api. CLEF: required — a System One host that serves Clef, or https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/ai/run.
DECISION_MODEL The model name the host serves it under. Default jev-latest for JEV, clef for CLEF; a self-hosted Clef may need e.g. Cloudflare/clef.

The node’s apiKey is the key of that provider: an OpenRouter key for OpenRouter, a Cloudflare API token with Workers AI permission for Cloudflare. A project shadows TYPESAFE_API_KEY with it.

With CLEF, the Clef model answers instead of Jev:

  • box fails: Clef has no box question.
  • choice and score need instructions too.
  • At most four images. Clef does not take named images: they go in order, and the state names them in the same order.