BionicShift
If you're already using constrained decoding, the cleanest approach is to define your JSON schema with precision and allow the grammar itself to indicate when you're finished once the closing brace of the parameters object becomes the sole valid next token based on your schema, the model must emit it, and you'll know the response is complete without requiring any special token. Both Outlines and lm-format-enforcer work great for this with Qwen models 😊
