Moved from prompt-based output validation to schema-enforced execution — the reliability numbers are significant
r/LocalLLaMA
•
Generative AI
Been testing two approaches systematically for consistent structured outputs from Claude: Approach A (most common): Detailed prompt instructions → post-generation regex/JSON parsing → retry on failure Approach B: tool_use with explicit typed schemas, enum constraints on known values, chain execution with validation at each step First-pass parse rates on identical tasks: - Approach A: 65-70% - Approach B: 90-95%+ The mechanism is simple: Approach A asks the model to infer output structure from instructions. Approach B enforces structure at the API level before the model generates.