> This page is for version 0.7.
> For other versions, use one of these documentation indexes:
> - Latest (default): https://docs.nvidia.com/nemo-helix/latest/llms.txt
> - 0.12: https://docs.nvidia.com/nemo-helix/v0.12/llms.txt
> - 0.11: https://docs.nvidia.com/nemo-helix/v0.11/llms.txt
> - 0.10: https://docs.nvidia.com/nemo-helix/v0.10/llms.txt
> - 0.9: https://docs.nvidia.com/nemo-helix/v0.9/llms.txt
> - 0.8: https://docs.nvidia.com/nemo-helix/v0.8/llms.txt
> - 0.7: https://docs.nvidia.com/nemo-helix/v0.7/llms.txt
> - 0.6: https://docs.nvidia.com/nemo-helix/v0.6/llms.txt
> - 0.5: https://docs.nvidia.com/nemo-helix/v0.5/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo-helix/llms.txt.

# Compare Evaluations

GET http://localhost:8080/apis/intake/v2/workspaces/{workspace}/evaluations/compare

Pair two evaluations per test case and compare them on one metric.

Both runs' attempts are averaged per test case (a failed evaluator result scores
0; an unscored attempt is omitted), the shared test cases are paired, and the
response reports the mean paired difference with a 95% bootstrap interval, the
fraction of resamples favoring the candidate, and the better/same/worse counts.

Reference: https://docs.nvidia.com/nemo-helix/documentation/reference/api-reference/evaluations/compare-evaluations-apis-intake-v-2-workspaces-workspace-evaluations-compare-get

## Request

### Path parameters

- `workspace` (string, required)

### Query parameters

- `baseline` (string, required) — Name of the baseline Evaluation.
- `candidate` (string, required) — Name of the candidate Evaluation.
- `metric` (string, required) — Metric to compare: an evaluator as 'evaluators.\<name>', or one of 'cost\_usd', 'latency\_ms', 'tokens'. Evaluator scores are higher-is-better; the rollup metrics are lower-is-better.

## Response

### 200

Successful Response

- `workspace` (string, required)
- `baseline` (string, required) — Name of the baseline Evaluation.
- `candidate` (string, required) — Name of the candidate Evaluation.
- `metric` (string, required) — The compared metric: 'evaluators.\<name>', 'cost\_usd', 'latency\_ms', or 'tokens'.
- `higher_is_better` (boolean, required) — Direction of the metric: true when a higher value is better (evaluator scores), false when lower is better (cost, latency, tokens).
- `n_pairs` (integer, required) — Test cases present on both sides, i.e. the pairs compared.
- `better` (integer, required) — Paired test cases where the candidate is better.
- `same` (integer, required) — Paired test cases within a 1e-9 absolute difference of the baseline.
- `worse` (integer, required) — Paired test cases where the candidate is worse.
- `mean_paired_difference` (double, optional, nullable) — Mean of the per-test-case differences, signed candidate minus baseline. Null when no test case is shared.
- `interval_low` (double, optional, nullable) — Lower bound of the 95% bootstrap interval of the mean paired difference.
- `interval_high` (double, optional, nullable) — Upper bound of the 95% bootstrap interval of the mean paired difference.
- `p_candidate_better` (double, optional, nullable) — Fraction of bootstrap resamples whose mean paired difference favors the candidate under the metric's direction. Resamples within 1e-9 of zero are ties and count as neither better nor worse, so 1 minus this value is not the chance the candidate is worse. Null when no test case is shared.
- `interval_caveat` (string, optional, nullable) — Plain-language caveat about the interval: absent pairs, or a small pair count, make it a weak estimate.

## Errors

### 400 Bad Request Error

Unsupported metric

- `any`

### 404 Not Found Error

Baseline or candidate Evaluation not found

- `any`

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

### 503 Service Unavailable Error

Telemetry store unavailable

- `any`

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (map from string to any, optional)

### ValidationErrorLocItems

- string
- integer

## Examples

**Response**

```json
{
  "workspace": "string",
  "baseline": "string",
  "candidate": "string",
  "metric": "string",
  "higher_is_better": true,
  "n_pairs": 1,
  "better": 1,
  "same": 1,
  "worse": 1,
  "mean_paired_difference": 1.1,
  "interval_low": 1.1,
  "interval_high": 1.1,
  "p_candidate_better": 1.1,
  "interval_caveat": "string"
}
```

**SDK Code**

```python
import requests

url = "http://localhost:8080/apis/intake/v2/workspaces/workspace/evaluations/compare"

querystring = {"baseline":"baseline","candidate":"candidate","metric":"metric"}

response = requests.get(url, params=querystring)

print(response.json())
```

```javascript
const url = 'http://localhost:8080/apis/intake/v2/workspaces/workspace/evaluations/compare?baseline=baseline&candidate=candidate&metric=metric';
const options = {method: 'GET'};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```