You might be struggling with inconsistent output from LLMs. Even if you set parameters like temperature
low, you could
get non-deterministic output from your models. Prediction Guard has built in consistency checks.
Rather than looping over multiple API calls, you can make one API call that will concurrently prompt an LLM multiple times, check for consistent output, and return an error if there is inconsistent output.
Letโs use the following example prompt template to illustrate the feature.
To enforce consistency on any output, itโs as simple as setting consistency
equal to a boolean True
in the output
field/argument to Prediction Guard:
If there is consistency in the calls to the LLM, you get standard output similar to:
But if the LLM isnโt consistent in the output (in this case the classification of the text), you get an error: