Skip to content

Case schema

This page lists every key a case YAML file may hold, with one example for each evaluator. evalkit lint checks a file against this schema. The machine-readable form is cases-v1.json, written by evalkit contracts export.

File shapes

A case file is one of:

  • a single case (a mapping with id)
  • a list of cases and overlays (an overlay is an entry with extends)
  • a mapping with any of defaults, cases and overlays
defaults:
  tags: [balance-sheet]
  input: {company: acme}
  max_response_time: 90
cases:
  - id: acme-total-assets-fy2024
    input:
      question: What were Acme's total assets as of 31 March 2024?
    evaluators:
      output:
        answer_rubrics:
          rubrics:
            - rubric: Total assets as of 31 March 2024 are $4.2 billion.
              type: factual_retrieval

defaults takes only input, tags, max_response_time and agents (for overlays). A case's own input keys and max_response_time win over the defaults; tags are merged.

In the mapping shape, a top-level key starting with x- (for example x-shared) is ignored. Use it to hold YAML anchors that several cases reuse with *name.

Case keys

Key Type Meaning
id string, required The case's identity, shared by every workspace.
tags list of strings Labels for evalkit run --tag. The case's folder in the suite is added as a tag too.
input mapping Sent to the agent as is. It must pass the agent's input schema; see Input schema.
fixtures list of strings Keys from fixtures.yaml to attach as files.
expected mapping Free-form ground truth, passed to custom evaluators.
evaluators mapping Which evaluators score this case. See below.

Input schema

Every agent has an input schema, a JSON Schema each case's input must pass. evalkit run, run_experiment (dry runs too) and evalkit lint --agent refuse inputs that fail it. When the agent sets none, the default applies:

{"type": "object", "required": ["question"], "properties": {"question": {"type": "string"}}}

A harness declares its own input_schema in GET /capabilities (Harness API). A code-driven agent stores one on the agent: evalkit agents create <name> --input-schema schema.json, or evalkit agents edit <name> --input-schema schema.json; --clear-input-schema goes back to the default. evalkit agents show prints it. For a multi-turn agent:

{"type": "object", "required": ["turns"], "properties": {"turns": {"type": "array", "items": {"type": "string"}}}}

Evaluators

Evaluators sit under evaluators.output, evaluators.trajectory or evaluators.custom. The scorecard groups their scores into buckets, but the bucket names are not YAML keys:

Scorecard bucket YAML key
content evaluators.output.answer_rubrics
presentation evaluators.output.presentation_judge
efficiency evaluators.output.max_response_time
trajectory evaluators.trajectory.trajectory_rubrics, evaluators.trajectory.tool_trajectory_match, evaluators.trajectory.required_tools_called
custom evaluators.custom.<name>

answer_rubrics

What a correct answer contains. The judge marks each rubric satisfied, incorrect or absent.

evaluators:
  output:
    answer_rubrics:
      rubrics:
        - rubric: Revenue for FY2024 is $3.52 billion.
          type: factual_retrieval        # or derived_computation, analysis_interpretation
          source: the FY2024 annual report  # optional, factual_retrieval only
        - rubric: Revenue grew 12% from FY2023 to FY2024.
          type: derived_computation

Write one assertion per rubric. A rubric that bundles two ("states $300/month and explains why") fails as a whole when the answer gets only one part right, so a correct answer can be marked wrong. Split it into two rubrics.

presentation_judge

How the answer shows its content: units, columns, an artifact relayed rather than restated. Each entry has exactly one of rubric (a property the answer must have) or forbid (a property it must not have). At least one entry must be a rubric.

evaluators:
  output:
    presentation_judge:
      rubrics:
        - rubric: A store count for each fiscal year FY2021–FY2025, as a table or a labelled list.
          points: 2      # optional weight, 1–10, default 1
        - forbid: Figures given without a currency unit.
          note: Rupee or dollar both fine.   # optional, shown to the judge

max_response_time

A cap on the run's wall-clock time, in seconds. The value is a mapping, not a bare number. Only defaults.max_response_time also takes a bare number.

evaluators:
  output:
    max_response_time:
      max_seconds: 90

trajectory_rubrics

Checkpoints the trajectory must show, one sentence each. Order is not graded.

evaluators:
  trajectory:
    trajectory_rubrics:
      rubrics:
        - Retrieves FY2024 Platform revenue as $3,522,776,000.
        - Rounds the final figure to the nearest basis point.

tool_trajectory_match

Expected tool calls, matched by name and args. Tool names must match the trajectory exactly. The score is the share of expected calls found; ordered: true also requires them in this order.

evaluators:
  trajectory:
    tool_trajectory_match:
      ordered: false
      expected:
        - name: get_financials
          args: {ticker: ACME, period: FY2024}
          args_mode: subset    # subset, exact, ignore or substring
          match_overrides:     # optional, per arg: equals or substring
            period: substring

required_tools_called

Tools the agent must call at least once. The score is the share called.

evaluators:
  trajectory:
    required_tools_called:
      tools: [get_financials, search_filings]

custom

Remote evaluators and Python evaluators, keyed by their name. The block is passed to the evaluator as config, untouched.

evaluators:
  custom:
    sql_matches:
      table: revenue

Python evaluators

A Python evaluator receives an EvalCase and an EvalRun and returns a float, a ScoreItem or a list of them. All three import from evalkit.sdk.

from evalkit.sdk import EvalCase, EvalRun, ScoreItem, evaluator


@evaluator(name="sql_matches")
def sql_matches(case: EvalCase, run: EvalRun) -> ScoreItem:
    table = case.config["table"]
    return ScoreItem(name="sql_matches", score=float(table in run.answer))
EvalCase field Meaning
id Case id.
input Case input, verbatim.
expected The case's expected block, or None.
config This evaluator's block from evaluators.custom.
EvalRun field Meaning
answer The final answer. A structured output as JSON text when the agent returned only that.
output The structured output, or None.
trajectory The ATIF trajectory as a dict.

ScoreItem has name, score (None means no reading), label and explanation.

Overlays

An overlay adds evaluators to a case in another suite, for the agents it names. It may add tags, evaluators.custom and the tool_trajectory_match and required_tools_called trajectory evaluators.

overlays:
  - extends: acme-total-assets-fy2024
    agents: [support-bot]
    evaluators:
      trajectory:
        required_tools_called:
          tools: [get_financials]

Dataset README

A README.md at the root of a dataset folder describes the dataset. evalkit sync uploads it, and the dataset page shows it.

  • The YAML frontmatter is the dataset's metadata. The rest of the file is its README, shown on a README tab.
  • Syncing the whole dataset mirrors the file. Delete README.md and sync, and the dataset has neither. Syncing one file or folder of the dataset leaves both as they are.
  • evalkit lint checks the frontmatter.
---
description: Questions about quarterly filings.
license:
  name: MIT
  url: https://opensource.org/license/mit
attribution: Written by the finance team.
links:
  - label: Wiki
    url: https://example.com/wiki
owner: finance
---

# Filings

How these cases were written, and what a good answer looks like.
Key Value Where it shows
description One line of text. Under the dataset's name in the list and on its page; in evalkit datasets list.
license name, and optionally url. A badge on the dataset page.
attribution Text. A credit line on the dataset page.
links A list of label and url. A row of links on the dataset page. A url is http, https or a path in the evalkit UI.
any other key Text. Listed as key and value on the dataset page.

evalkit datasets show <dataset> prints the metadata and the README.