AI 101

JSON mode

Also known as: JSON mode

Inference

JSON mode is a setting (available in many LLM APIs) that forces the model’s response to be a single valid JSON document.

It’s the entry point to structured output:

  • On: the model is constrained to emit valid JSON.
  • Off: it might emit JSON or prose, with apologies and asides.

Combine it with a clear schema description in the prompt for best results.

Upgrade path: JSON mode = "valid JSON". Schema-constrained / function-calling = "valid JSON *in the exact shape I asked for*". Start with JSON mode, graduate to the stricter one.