How is this different from generating such things without an LLM? In other words picking random valid tokens from the grammar via fuzzing or similar techniques.
LLMS allows for building systems that take user requests in text: "book the next flight to Egpyt" and convert them into a system message: `{"action": "book_flight", "destination": "Egypt", ... }`
However, anyone who's tried to build a system like this on GPT or other LLM soon learns that they don't always do as they're told, and it can be hard to get them to return valid JSON or correct instructions translation reliably. Sometimes, they make stuff up that has nothing to do with your system.
OpenAI has a solution to this with their new function calling API, by introducing models fine-tuned to return JSON, but they still can't make guarantees.
Outlines seems to be a neat approach to constrain an LLM to return JSON, or any grammar, reliably.