JSON Mode vs Structured Output
People think JSON mode makes a model's reply fit their schema, and it does not. JSON mode only makes sure the reply is valid JSON, so a program can open it. The fields can still be missing or named in another way. Structured output checks the reply against the schema you give, so every field you asked for is there. Neither one checks that the values are true.
JSON Mode
A switch so the model only replies with JSON that will load.
JSON mode is a setting that makes a model reply only with valid JSON. The reply will parse, so a program will not crash on stray words. But JSON mode does not check the shape, so fields can be missing or named in other ways. Structured output with a schema is the stricter, newer option. JSON mode still helps where no schema is set or the API offers nothing else.
Structured Output (LLM)
The model's answer must fit a set shape, like JSON with set fields.
Structured output makes a model's answer follow a fixed shape, most often JSON that matches a schema you give. A schema lists the fields, their types and which ones are needed. Many model APIs can enforce it, so the reply always fits. That lets a program read the answer with no guessing. Without it, a model may add chatty text or drop a field, and the program breaks.
In one line
- JSON Mode
- A switch so the model only replies with JSON that will load.
- Structured Output (LLM)
- The model's answer must fit a set shape, like JSON with set fields.