Why format matters for code
When your program consumes model output, free text is painful. Constrain it:
Free text -> you must parse and clean it
Structured -> you can trust and use it
Always validate before trusting. A model can still add extra text or drop a field.
Making output reliable
Combine techniques for reliable output:
- Ask for JSON only, no prose.
- Describe every field.
- Validate with a parser.
- Retry if it fails.
Constrain -> validate -> retry. Never trust blindly.
The retry is the safety net that makes it production-ready.