---
title: EvaluatorProtocol
framework: evaluations
role: symbol
role_heading: Protocol
path: evaluations/evaluatorprotocol
---

# EvaluatorProtocol

A type that evaluates subjects and produces metrics.

## Declaration

```swift
protocol EvaluatorProtocol<Input, Subject> : Sendable
```

## Overview

Overview Conform to EvaluatorProtocol to create custom evaluators that measure the system’s output against expected criteria. Each evaluator returns an array of Metric values — one per DataFrame column produced. The protocol is parameterized by Input (the sample type). Subject is an associated type constrained to EvaluationSubject, ensuring the subject’s value type matches the sample’s expected value type. Conforming types must be Sendable. struct MyEvaluator<Input: SampleProtocol>: EvaluatorProtocol where Input.ExpectedValue: Sendable & Codable {     let metric = Metric("Quality")

func metrics(         subject: ModelSubject<Input.ExpectedValue>,         input: Input     ) async throws -> [Metric] {         return [metric.scoring(1.0)]     } }

## Topics

### Associated Types

- [Input](evaluations/evaluatorprotocol/input.md)
- [Subject](evaluations/evaluatorprotocol/subject.md)

### Instance Methods

- [metrics(subject:input:)](evaluations/evaluatorprotocol/metrics(subject:input:).md)

## Relationships

### Inherits From

- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

### Conforming Types

- [Evaluator](evaluations/evaluator.md)
- [ModelJudgeEvaluator](evaluations/modeljudgeevaluator.md)
- [ToolCallEvaluator](evaluations/toolcallevaluator.md)

## See Also

### Scoring results

- [evaluators](evaluations/evaluation/evaluators-swift.property.md)
- [Evaluation.Evaluators](evaluations/evaluation/evaluators-swift.typealias.md)
- [EvaluatorsBuilder](evaluations/evaluatorsbuilder.md)
- [aggregateMetrics(using:)](evaluations/evaluation/aggregatemetrics(using:).md)
