Max

Finds the maximum value of a score (with the given name) across all samples. Use this to surface best-case performance - for example, the highest judge score across all responses. Pair with Min and Mean for a complete picture of score distribution.

Output

A single metric named {field}_max by default, or the value of name if provided.

Examples

Example: RAG QA. Finds the highest judge score across all samples to identify the best-performing response in the run.

Max Metric
# ...
config_spec:
  - type: "dataset"
    key: "dataset_key"
    display_name: "Dataset"
    description: "The dataset to evaluate against."
  - type: "model"
    key: "judge_model_key"
    display_name: "Judge Model"
    description: "Model used to score the evaluation dimension."
  - type: "categorical"
    key: "evaluation_dimension"
    display_name: "Evaluation Dimension"
    description: "The aspect of the model response to evaluate."
    allowed_values: ["groundedness", "relevance"]
definition:
  # ...
  scorers:
    - type: "model_as_a_judge_scorer"
      model_key: "<< config.judge_model_key >>"
      system_prompt: >
        You are an evaluator assessing the << config.evaluation_dimension >> of a
        model response to a question.
        On a scale from 0 to 100, assign 100 if the response is fully
        << config.evaluation_dimension >> and 0 if it is not at all.
        Return only the numeric score.
      user_prompt: >
        <context>{{ sample.context }}</context>
        <response>{{ trace.get_last_assistant_text() }}</response>
      score_min: 0
      score_max: 100
      metrics:
        - type: "mean"
          field: "score"
          name: "Mean Score"
        - type: "min"
          field: "score"
          name: "Min Score"
        - type: "max"
          field: "score"
          name: "Max Score"

Configuration

Properties


type Literal “max required

The type of the metric.


field string, TemplateValue required

The field over which to compute the max.


name string, TemplateValue

The name given to the metric value. If not specified, it is {field}_max

Default: None


key string

Unique identifier assigned to the entity in AI Platform.

Default: None