
Define the record schema and the validator that keeps junk out of the database.
Clean fenced, comma broken model responses into parseable JSON.
Feed validation errors back to the model until its output passes.
Recover every complete field from JSON cut off mid stream.
Run your full extraction stack on real documents against a live model.