Skip to main content
Reference for the parameters, result formats, and templates used by the evaluations API. For concepts, see Evaluations; for the full request schema, see the create evaluation API reference.

Judge configuration

The judge object configures the model that assesses each input. It is required for every evaluation type. During execution, the service appends its own output-format instruction to the judge’s prompt, requiring a JSON response with a feedback field and the verdict (a label, score, or choice). Judge responses that don’t parse into a valid verdict are counted in invalid_label_count or invalid_score_count in the results.

Model configuration

model_to_evaluate, model_a, and model_b each accept either a string naming a dataset column that already holds responses, or a model configuration object that generates fresh responses. The object uses these fields.

Evaluation type parameters

Every type also requires input_data_file_path, the file ID of the uploaded dataset.

Classify

Score

Compare

When both model_a and model_b are configuration objects, their inference runs execute in parallel. Under the default two-pass correction, the winner is declared only when both passes agree; disagreement is recorded as a tie. If only one pass produces a parseable verdict, that verdict decides, and the row is flagged with is_invalid_judge_output in the result file.

Dataset columns

Every column in the input dataset must be used by the job. A column counts as used when it is one of the following:
  • Template-referenced: Injected with a {{column_name}} placeholder in any model or judge system_template or input_template. A nested reference like {{info.question}} counts for its top-level column, info.
  • A pre-generated response column: Named as the string value of model_to_evaluate, model_a, or model_b.
  • The image column: image_data_urls, for vision evaluations.
A dataset with any other column fails validation shortly after the job starts running, ending in user_error status with the offending columns listed in results.error:
Text
Strip metadata columns such as id or category before uploading, or keep a column by referencing it in a template, for example passing {{ground_truth}} to the judge as a reference answer.

Job lifecycle

Creating a job returns a workflow_id and a pending status. The job then moves through queued and running before reaching completed. A job that fails ends in error (an internal failure) or user_error (a problem with the request or dataset), with the failure reason in results.error. Retrieving the job returns the current status, a timestamped status_updates entry for each transition, the request parameters, and, once the job completes, the aggregated results:
JSON

Result formats

A completed job returns aggregated results and a result_file_id. The aggregated fields depend on the evaluation type.

Classify

Score

Compare

Result files

Pass the result_file_id to the Files API to download the full report. Each line holds the original input, any generated responses, the judge’s decision and feedback, and an evaluation_successful field (true or false) indicating whether the row was processed successfully. The result file retains every input row; if more than 30% of rows fail generation or judging, the job itself fails instead. For large result files, stream the download line by line instead of buffering it:
Python
For a compare evaluation with generated responses, a result line looks like this:
JSON
The two choice_* and judge_feedback_* pairs come from the two position-bias-correction passes; choice_flipped is expressed in original-order terms, so the flipped pass’s raw "A" above records the same winner. With disable_position_bias_correction: true, only the original-order fields are present. Classify and score result lines follow the same pattern, with the judge’s label or score and feedback in place of the pairwise fields.

Templates

Both system_template and input_template support Jinja2 syntax. Reference a dataset column by wrapping its name in double braces to inject its value into the prompt. Given this dataset row:
JSON
And this template:
Python
The rendered input becomes:
Text
Reference nested fields with dot notation. Given:
JSON
Access the nested field with:
Python
Common uses include passing a reference answer to the judge, giving per-row generation instructions, and selecting which columns to send to the model being evaluated. For more Jinja2 functionality, see the interactive template playground and the Hugging Face templates guide.