Why use Code Evals?
When your evaluation criteria is deterministic and clear, code-based evaluators provide a consistent and efficient way to assess results. They are useful when you need to check for objective conditions, such as whether a keyword appears, a URL is valid, or a format follows a rule. Arize offers off-the-shelf code evaluators for common evaluation tasks. When you need more control, you can create custom evaluators that align with your unique business logic or quality criteria.Create a Code Eval
To create a code evaluator, choose Code Evaluator when creating a new Evaluation Task. Now, the evaluator can be created in just 3 steps:- Name the task and define the data it will be run on.
More Task Configuration Details
More Task Configuration Details
- Sampling Rate (%): Define the percentage of data the task should run on (0–100).
- Sampling is applied at the highest evaluator scope in the task:
session > trace > span - Lower-level evaluators will run on all matching data within that sampled set
- Sampling is applied at the highest evaluator scope in the task:
- Task Filters allow you to specify the data this task will run on. This matches spans, or traces/sessions that contain matching spans.
- When running on historical data, the maximum number of items is based on the highest eval scope
- Provide a unique Eval Column Name for the evaluator in plaintext. Ensure that this name is distinct from other evaluators across all tasks. Here, you can also set Evaluator Scope and Filters.
- Define any required parameters for the selected Code Evaluator

Arize Managed Code Evals
Arize manages a set of off-the-shelf code evaluators on your behalf. Simply select the evaluator name from a drop-down and the evaluator code will be provided. Users can customize the evaluators by specifying the arguments that should be passed in as parameters. Currently, we support all of the evaluators below and new evaluators can be added upon request.| Evaluator | What it’s Used For | Parameters |
|---|---|---|
| Matches Regex | Checks whether the text matches a specified regex pattern |
|
| Eval | Description | Parameters |
|---|---|---|
| Matches Regex | Checks whether the text matches a specified regex pattern |
|
| JSON Parseable | Checks whether the LLM data is a valid JSON-parsable string |
|
| Contains any Keyword | Checks whether any specified keywords are present in the LLM data |
|
| Contains all Keywords | checks that all keywords are present |
|
Custom Code Evaluators
Custom Code Evaluators are only available in Arize AX Enterprise. Request a demo here.

