Creating an LLM judge evaluator

Create a custom LLM judge evaluator in Cloudera Agent Studio to score agent output against a Markdown definition and rubric.

An LLM judge evaluator uses a language model to score or classify the output of an agent. You define what the judge measures and how it scores, and you choose whether the judge returns a numeric score or a discrete label. Agent Studio saves the evaluator as a versioned custom evaluator. After you save it, you can select it when you run an evaluation.

The New LLM judge page includes the following sections:

  • Details: The Display name, Name, and Description of the evaluator.
  • Judge components: The Definition, the Rubric, and the optional Expectations guidance (optional). Agent Studio stores the text of these fields as Markdown in the evaluator bundle.
  • Scope and expectations: The evidence that the judge reads and the optional path to the expected result of a test case.
  • Output and pass policy: The Output type and the values that define a passing result.

In Scope and expectations, you select one or both of the following evidence sources:

  • Trace: Single-trace evidence for each test case. This source is selected by default.
  • Session: Full conversation session evidence.

In Output and pass policy, you select one of the following output types:

  • Numeric score: An inclusive range from a minimum score to a maximum score, and a pass threshold.
  • Discrete labels: Named labels, each with a definition. You select one or more labels that count as a pass.
  • Prepare the Definition and Rubric text in Markdown. You can optionally prepare text for the Expectations guidance field. Each text field has the following limits:
    • The text can be up to 64 KiB after Agent Studio normalizes it.
    • The text cannot contain {{ and }} placeholders.
    • The text cannot contain the Jinja control syntax {% or {#.
  • Optional: To use the expectations field of your test cases, create the test set before you run the evaluation. See Creating a test set.
  • To run the evaluator, ensure that a judge model is available. You select the judge model on the New run page. See Running an evaluation and Managing LLM endpoints.
To create an LLM judge evaluator:
  1. Launch the Cloudera Agent Studio console.
  2. In the left navigation pane, click Evaluations.
    The Runs tab is displayed.
  3. Click the Evaluators tab.
    The Built-in evaluators and Custom evaluators sections are displayed. If the LLM-as-a-Judge sub-tab is not selected, click LLM-as-a-Judge.
  4. Click New LLM judge.
    The New LLM judge page opens.
  5. In the Details section, enter the details of the evaluator.
    1. In Display name, enter the name that users see.
    2. In Name, enter the name that identifies the evaluator across versions.
      If you already saved an evaluator with this name, the message You already saved v<number>; changed content saves as v<number>. is displayed, with the current and the next version numbers.
    3. In Description, enter the description of the evaluator.
  6. In the Judge components section, enter the Markdown text of the judge.
    1. In Definition, enter what the judge measures and when teams use it.
    2. In Rubric, enter how the judge scores or classifies agent output.
    3. Optional: In Expectations guidance (optional), enter how the judge uses the expectations that each test case sends. Agent Studio includes this text only when the test case has non-empty expectations.
  7. In the Scope and expectations section, select the evidence and the expectations.
    1. In Evidence scope, click Trace, Session, or both.
      You cannot clear the last selected source.
    2. Optional: In Expectations path (optional), enter a JSON pointer.
      The pointer starts with /. To pass the whole expectations object, leave the field empty.
  8. In the Output and pass policy section, in Output type, click Numeric score or Discrete labels.
    • For Numeric score, set the range and the pass threshold:

      1. In Minimum score, enter the lowest score. The default is 0.
      2. In Maximum score, enter the highest score. The default is 1.
      3. In Pass threshold, enter the lowest score that counts as a pass. The default is 0.8.

      The range is inclusive. Enter a maximum score that is greater than the minimum score, and a pass threshold that is within the range.

    • For Discrete labels, define the labels and the passing labels:

      1. For each label, in Label name, enter the name of the label, and in Definition, enter the definition of the label. By default, the page contains the labels pass (Meets the rubric.) and fail (Does not meet the rubric.).
      2. To add a label, click Add label.
      3. To delete a label, click Remove in the row of the label. The link is unavailable when the evaluator has two labels.
      4. Click Passing labels, and then select each label that counts as a pass. The default is pass.
        • To select every label, click Select all.
        • To reverse the selection, click Invert selection.
        • To clear the selection, click Clear.
  9. Click Save.
    To leave the page without saving, click Cancel, or click Evaluations at the top of the page.
To edit the pass policy of an LLM judge evaluator:
  1. Launch the Cloudera Agent Studio console.
  2. In the left navigation pane, click Evaluations, and then click the Evaluators tab.
  3. In the Custom evaluators section, in the row of the evaluator, click Open, and then click View evaluator.
    The page of the evaluator is displayed.
  4. Click Edit pass policy.
    The option is displayed for a custom LLM judge evaluator when your user has the Builder or Admin role. See User roles and capabilities.
    The Edit pass policy page is displayed.
  5. In the Pass policy section, change the policy.
    • For a numeric evaluator, in Pass threshold, enter a value within the score range of the evaluator.
    • For a label evaluator, in Passing labels, select the labels that count as a pass.
    Changes apply to new runs. Completed runs keep the pass policy they used.
  6. Click Save.
    The message Pass policy updated. New runs use it. is displayed, and the page of the evaluator opens.

After you save the evaluator, the Evaluators tab opens with the LLM-as-a-Judge sub-tab selected, and one of the following messages is displayed:

  • Saved LLM judge v<version>: Agent Studio saved the evaluator as a new version.
  • LLM judge unchanged (v<version>): The content is identical to an existing version, and Agent Studio did not create a new version.
  • Updated the pass policy of LLM judge v<version>. The rest of the judge is unchanged.: The content is identical to an existing version, and only the pass threshold or the passing labels are different. Agent Studio updated the pass policy of that version.

The evaluator is displayed in the Custom evaluators section, and the Origin column displays Custom. To review the evaluator, click View evaluator in the row menu. The page contains the Evaluator details, Versions, and Pass policy sections, and the definition and the rubric. Earlier versions stay available. To create a new version, save the evaluator again with the same name.

If the save fails, the alert Could not save lists each error, and the message Fix the errors listed on this page, then save again. is displayed.