2026-07-16
Determinism lives in the harness, not the model
The principle: a language model is nondeterministic, but a production system that consumes its output directly cannot be. The determinism has to come from the harness around the model, not the model itself. You constrain the output to a fixed structure, validate every result, measure quality on live data, and test the contract. The model is the easy part; making its output safe to consume without a human in the loop is the work.
I built this for a brand-intelligence mobile app. The sentiment layer is a production LLM integration: raw social posts go in, structured JSON metrics come out, and the app consumes them directly, with no human in the loop. That last part is the whole constraint. If a person reviewed every result, a wrong or malformed output would get caught. With nobody in the loop, the output has to be right by construction, at stream scale: one pull processes 3,725 posts across roughly 16.7M in total reach.
Five things make model output safe to consume directly.
Structure, not prose. The model returns structured JSON metrics, not free text. A downstream app can parse a fixed shape; it cannot parse a paragraph that changes every call. Constraining the output to a schema is the first place nondeterminism gets removed.
Validation before trust. Every result is validated before anything downstream uses it. The model is treated as an untrusted input, the same as a user-submitted form, not as a source of truth.
Measurement on live data. You do not assume the output is correct, you measure it. A live probe on the running system put attribution at 97 percent, and the full pipeline attributes posts at 99 percent accuracy. Quality is a number you watch, not a hope.
Tests that guard the contract. About 600 backend tests run green. The structure, the validation, and the edge cases are pinned down so a change cannot silently break the output the app depends on.
Cheap enough to never stop. None of it matters if it is too expensive to run continuously, so the pipeline was built to run on the live stream without draining the budget that feeds it.
The pattern underneath all five: the model is one component in a system, not the system. Treat its output as untrusted, give it a shape, check it, measure it, and test it, and a nondeterministic model becomes something a production app can consume without a human watching.
That is the difference between calling an API and shipping a system: the API returns whatever it returns; the system decides what it is willing to trust, and proves it on live data. Real money, real time, real stakes.