the.ai

Agents / Interface

verified

Constrained Decoding

Asking a model for JSON and hoping is a coin flip at scale. Constrained decoding removes the choice: at each step, tokens that could not continue a valid structure are masked before sampling, so a malformed result is not unlikely — it is unreachable.

Viz primitive · budget-splitlegal-tokens = 400

legal-tokens holds 1% of the budget; rest holds the remaining 99%.

Tokens a grammar still permits at one position against those it has masked out. Drag the number of legal continuations to watch the constraint loosen.

400

Reviewed by opendroid · 2026-08-04