Set up Monitoring
In this guide, we will demonstrate how to create and use online evaluators to observe the performance of your models.
Paid Feature
This feature is not available for the Free tier. Please contact us if you wish to learn more about our Enterprise plan
Create an online evaluator
Prerequisites
- You need to have access to evaluations.
- You also need to have a Prompt – if not, please follow our Prompt creation guide.
- Finally, you need at least a few logs in your project. Use the Editor to generate some logs if you don’t have any yet.
To set up an online Python evaluator:
From the library of presets on the left-hand side, we’ll choose Valid JSON for this guide. You’ll see a pre-populated evaluator with Python code that checks the output of our model is valid JSON grammar.
![The evaluator editor after selecting **Valid JSON** preset](https://fdr-prod-docs-files-public.s3.amazonaws.com/https://humanloop.docs.buildwithfern.com/docs/2024-09-06T09:30:14.003Z/assets/images/4235b31-image.png)
In the debug console at the bottom of the dialog, click Random logs from project. The console will be populated with five datapoints from your project.
![The debug console (you can resize this area to make it easier to view the logs)](https://fdr-prod-docs-files-public.s3.amazonaws.com/https://humanloop.docs.buildwithfern.com/docs/2024-09-06T09:30:14.003Z/assets/images/7330b9d-image.png)
Click the Run button at the far right of one of the log rows. After a moment, you’ll see the Result column populated with a True or False.
![The **Valid JSON** evaluator returned `True` for this particular log, indicating the text output by the model was grammatically correct JSON.](https://fdr-prod-docs-files-public.s3.amazonaws.com/https://humanloop.docs.buildwithfern.com/docs/2024-09-06T09:30:14.003Z/assets/images/c3d9b08-image.png)
Activate an evaluator for a project
Track the performance of models
Prerequisites
- A Humanloop project with a reasonable amount of data.
- An Evaluator activated in that project.
To track the performance of different model configs in your project:
Go to the Dashboard tab.
In the table of model configs at the bottom, choose a subset of the project’s model configs.
![](https://fdr-prod-docs-files-public.s3.amazonaws.com/https://humanloop.docs.buildwithfern.com/docs/2024-09-06T09:30:14.003Z/assets/images/da76734-image.png)
Available Modules
The following Python modules are available to be imported in your code evaluators:
re
math
random
datetime
json
(useful for validating JSON grammar as per the example above)jsonschema
(useful for more fine-grained validation of JSON output - see the in-app example)sqlglot
(useful for validating SQL query grammar)requests
(useful to make further LLM calls as part of your evaluation - see the in-app example for a suggestion of how to get started).