Validating LLM JSON with Pydantic: repair fixed 26 of 51 bad outputs, 2 silently wrong
Strict Pydantic accepted 2 of 51 malformed LLM outputs; a 40-line repair step plus lax mode recovered 26 and returned 2 wrong values without an error.
18 Nov 2026 · pydantic · structured-output