Elixir is where I prefer to build software, so it would be creating a custom Credo rule.
https://developers.openai.com/api/docs/guides/structured-out...
Nothing else operates on the logprobs level and literally bans continuations that fail your schema.