structured-logprobs: Boosting OpenAI Structured Output Reliability

2025-01-14

structured-logprobs is an open-source Python library that enhances the reliability of OpenAI's structured outputs by providing detailed token log probability information. It works with OpenAI's Structured Outputs feature, ensuring consistent responses adhering to a supplied JSON Schema, preventing missing keys or invalid values. The library offers two methods for integrating log probabilities: adding them as a separate field or embedding them inline within the message content.