Back to the library
software engineering
Reliable LLM JSON Output
One sitting on the failure every LLM feature hits: the model's JSON parses until it does not. Schemas, native structured-output modes, retry loops that actually converge, and the refusals no schema can fix.
Forty-five minutes, four lessons, and a working validation layer at the end of it.
Starts where the bug actually starts: a field that arrives as the wrong type, passes straight through, and surfaces three days later in a report.
Covers the four things that go wrong in order — no contract, a contract the provider will not enforce, a retry loop that repeats the same failure, and a refusal that is not a parsing problem at all.
Who it's for
- Engineers whose feature parses model output and breaks on the tenth call
- Anyone who has written a try/except around json.loads and left it there
- People who need this working today rather than a full course on it