I’m using a language model to extract a few fields from customer messages, then passing the result to an API. Most responses are usable, but occasionally the model adds an explanation before the JSON, omits a field, or returns a value in the wrong format.
What has worked for getting reliable structured JSON output in this kind of workflow? I’d like to know whether the main fix is a stricter schema, constrained decoding, validation with retries, or some combination—and how people handle failures without silently dropping records.