onrup

Serving

Structured output

What is structured output?

Structured output constrains a model to produce responses conforming to a schema, typically JSON. It can be enforced during decoding, learned through fine-tuning, or both — the two address different parts of the problem.

Constrained decoding guarantees the shape by restricting which tokens are permissible at each position. It cannot make the values correct, and heavy constraint can push the model toward technically valid but unhelpful answers.

Fine-tuning improves both shape and values, because the model learns what a good answer looks like rather than being prevented from producing a bad-shaped one. Using both is reasonable, with the constraint rarely binding.

Related terms

All terms in the glossary →

Start with the free tier

A magic link creates your account, your tenant and your first API key. No card until you ask for compute.