Skip to main content
To start using TrustTest, you need to install the package in your python environment:
For this quickstart, we are going to run a basic functional test against a dummy API and save the test locally.
If you want to go straigth to the point go directly to the Complete Example section.
In trusttest we have defined a set of dummy Models to easaly test the library.
This dummy model just have a fix set of responses for a fix set of inputs. Else it returns “I don’t know the answer to that question.
When our model is ready, we can choose the probe that will generate the test cases to evaluate the target. In this case we are going to use DatasetProbe to generate test cases from a dataset.
The generated test_set has two test cases. A test case is a set of questions and model responses with other metadata for evaluation.
When the our test_set read, we can define which evaluation metrics and criteria we want to use to evaluate the target.
In this Evaluation Scenario we are using the BleuEvaluator and the ExpectedLanguageEvaluator, with the criteria any_fail to evaluate the target. So if any of the evaluators fails, the scenario will fail.
Now that we have defined our model and the way to evaluate it, we are ready to get the evaluation results.
If everything is working as expected, the results should be displayed in the console.And that’s it! 🎉 You have just created your first functional test with TrustTest. Continue with the local LLM tutorial to explore more of what TrustTest can do.