How constrained decoding guarantees valid LLM output: grammars, FSAs, token masking, JSON-schema enforcement, and where structured generation breaks in production.
Patterns to make LLM tool calls deterministic in production — JSON schema enforcement, validators, retries, and when constraint decoding actually pays off.