Foundations · The determinism problem
Run it again. Different answer.Same input. No promises.
A single LLM call is a dice roll — feed it the same invoice twice and one run is clean JSON, the next is broken, and nothing tells them apart. The console below is the real thing. Run it, then add the check.
Live run console
Input · invoice.txt
Target schema
Model output
// press Run to sample this modeidle
It works, then it doesn't
The demo passed, so it shipped. Then the same input returns something broken and production fails on a Tuesday.
The rules live in the prose
The schema sits in the prompt, so the model re-decides it on every call — and nothing downstream checks the result.
Check it, retry, then ship.
You can’t make the dice deterministic — so stop trusting a single roll. Flip the console above to “+ Validator & retry” and run again: every invalid roll is caught and re-prompted, and the rate climbs to 100%. Here is that loop, one request at a time.
This is not a multi-agent system. The check is a few lines of deterministic code — no second model, no agents, no handoffs. It's simply the smallest thing that turns an unreliable model into a reliable result: generate, verify, retry.
The principle