Software & Apps

structured-logprobs

structured-logprobs

structured-logprobs is an open-source Python library that develops The structured outputs of OpenAI by providing detailed information about the token log probabilities.

structured-logprobs

This library is designed to provide valuable insights into reliability of structured LLM outputs. It works with OpenAI’s Built-in Outputsa feature that ensures that the model always produces responses that adhere to a given JSON Schema. This eliminates worries about missing required keys or imagining invalid values.

Just install with the pip install structured-logprobs

Then use it this way:

For more details, visit dash.

The module has a function for mapping characters to token indices (map_characters_to_token_indices) and two methods of joining log probabilities:

  1. Add log probabilities as a separate response field (add_logprobs).
  2. Embed the log probabilities inline within the message (add_logprobs_inline).

2025-01-14 15:52:00

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button