@ouispec/agent-evals 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/aggregate.d.ts +178 -0
- package/dist/aggregate.d.ts.map +1 -0
- package/dist/aggregate.js +122 -0
- package/dist/aggregate.js.map +1 -0
- package/dist/cassettes.d.ts +18 -2
- package/dist/cassettes.d.ts.map +1 -1
- package/dist/cassettes.js +19 -7
- package/dist/cassettes.js.map +1 -1
- package/dist/cli.js +125 -6
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +61 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/expectations.d.ts +8 -0
- package/dist/expectations.d.ts.map +1 -0
- package/dist/expectations.js +16 -0
- package/dist/expectations.js.map +1 -0
- package/dist/index.d.ts +27 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/dist/judge.d.ts +8 -2
- package/dist/judge.d.ts.map +1 -1
- package/dist/judge.js +5 -2
- package/dist/judge.js.map +1 -1
- package/dist/leaderboard.d.ts +34 -0
- package/dist/leaderboard.d.ts.map +1 -0
- package/dist/leaderboard.js +341 -0
- package/dist/leaderboard.js.map +1 -0
- package/dist/matrix.d.ts +100 -0
- package/dist/matrix.d.ts.map +1 -0
- package/dist/matrix.js +169 -0
- package/dist/matrix.js.map +1 -0
- package/dist/models.d.ts +77 -0
- package/dist/models.d.ts.map +1 -0
- package/dist/models.js +163 -0
- package/dist/models.js.map +1 -0
- package/dist/report.d.ts +2 -2
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +12 -4
- package/dist/report.js.map +1 -1
- package/dist/run.d.ts +56 -10
- package/dist/run.d.ts.map +1 -1
- package/dist/run.js +145 -55
- package/dist/run.js.map +1 -1
- package/dist/spend.d.ts +113 -0
- package/dist/spend.d.ts.map +1 -0
- package/dist/spend.js +170 -0
- package/dist/spend.js.map +1 -0
- package/dist/suite.d.ts +3 -1
- package/dist/suite.d.ts.map +1 -1
- package/dist/suite.js +2 -1
- package/dist/suite.js.map +1 -1
- package/dist/usage.d.ts +45 -4
- package/dist/usage.d.ts.map +1 -1
- package/dist/usage.js +57 -14
- package/dist/usage.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -22,6 +22,27 @@ agent-evals --channel sms --scenario price-only --junit evals.xml
|
|
|
22
22
|
|
|
23
23
|
In a test runner, `evalCases(config)` gives one case per scenario and channel; `await evalCase.assert()` throws with every failure.
|
|
24
24
|
|
|
25
|
+
## A model matrix: one run against every candidate model
|
|
26
|
+
|
|
27
|
+
The same suites, on every model you might run your agent on, several times each, judged by one fixed model, so the cheapest model that does your work well enough is chosen by your own scenarios rather than a public benchmark.
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
agent-evals --models models.json --runs 5 --estimate # what it will cost; calls no model
|
|
31
|
+
agent-evals --live --models models.json --runs 5 --max-cost 400 \
|
|
32
|
+
--json results.json --html leaderboard.html --markdown summary.md
|
|
33
|
+
agent-evals --record --models all --runs 5 # the same, writing each model's recordings
|
|
34
|
+
agent-evals --models all --runs 5 --html leaderboard.html # in CI: replays them, no network
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- **Candidates are data.** Each model your registry declares: `{ id, label, providerOptions, capabilities: { promptCache, forcedToolChoice, temperature, vision, contextWindow }, prices: { input, output, cacheRead, cacheWrite } }`, prices in US dollars per million tokens. Give them as `models` in the configuration (`--models all`, or some by id, comma-separated) or in a file (`--models models.json`, `.yaml` or a module). The configuration's `model` factory is handed each one (`seam.candidate`) and builds it; a case whose factory builds another model fails rather than measuring the wrong one. Each candidate's turns send its own `providerOptions` in place of the agent's, a cache breakpoint only where it caches, no forced tool choice and no temperature where it takes none.
|
|
38
|
+
- **One judge.** Rubrics are decided by `judgeModel` (`{ id, label, providerOptions, prices }`), the same model for every candidate and never one of them. Its verdicts are priced apart from the candidates' cost.
|
|
39
|
+
- **What each call used.** Input, output, cache-read and cache-write tokens as the provider reported them; the time to its first token and in all; why it finished. Per turn: model calls, invalid tool calls (input the tool's schema refused or that would not parse, or a tool that does not exist) and refusals (a call the provider stopped for its content, or a reply in the words of a refusal on a turn that expects none; `refusal` in the configuration sets the words). A recording keeps its calls' times, so a replay reports the live run's latency.
|
|
40
|
+
- **Per model.** Pass rate over the cases judged, with its mean, least and most across runs; the pass rate in each category (`tags` on a suite or a scenario); tokens with the cache split; cost per run and **cost per completed task** (everything it spent, failures included, over the cases it passed); first-token and model time p50 and p90; invalid tool calls; refusals. And the picks: for all scenarios and for each category, the cheapest model per completed task among those within `--within` points (default 2) of the best pass rate.
|
|
41
|
+
- **Reports.** `--json` writes the results (`format: "agent-evals-matrix"`: every case with its turns, each model's summary, the picks and the spend); `--html` a leaderboard page that loads nothing (a sortable table, the picks, the categories, and every scenario's results by model); `--markdown` a summary. The same results give the same bytes. `runMatrix`, `leaderboardHtml` and `matrixMarkdown` do the same in code.
|
|
42
|
+
- **A spend limit.** The cost is estimated before anything runs, from each turn's token budget (its `usage` bounds: `inputTokens.max`, or `callInputTokens.max` × `modelCalls.max`, `outputTokens.max` and `cachedShare.min`; else the configuration's `budgets.turn`) at each model's prices, plus one verdict per rubric at the judge's (`budgets.judgeCall`). Input not declared as read from the cache is priced as written to it on a model that caches, so the estimate does not fall short. `--estimate` prints it and calls no model. `--max-cost <usd>` runs nothing when the estimate is over it, and, while the run goes, refuses the next model request once the run has spent it: the run stops, and reports what it ran, the cases it stopped left out of every figure.
|
|
43
|
+
|
|
44
|
+
A matrix exits 0 when every case ran (a model failing a scenario is a result, not an error), 1 when a case could not run as written (a recording missing or stale, the wrong model built), 2 when it could not start, and 4 when the spend limit stopped it. `--concurrency <n>` runs cases side by side; a recording is filed under its model, and each run after the first apart (`<suite>/<model>/<scenario>.<channel>.run-<n>.json`).
|
|
45
|
+
|
|
25
46
|
The package ships an example in `examples/dealer`: a fake dealer agent, and its first acceptance cases (AI disclosure, dealer price and no payments, an injected instruction, an SSN refused and not stored, a request for a person, a booking confirmed by its readback, a take-over and hand-back) on web chat, SMS and voice, recorded from Claude on Bedrock.
|
|
26
47
|
|
|
27
48
|
The integrator guide (`@ouispec/contract/INTEGRATOR-GUIDE.md`, "Evals") documents the suite format. The package releases with the rest of the agent SDK, under one version: see [VERSIONING.md](https://github.com/wesreid/oui/blob/main/VERSIONING.md).
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a model matrix says about each model: how often it did the work, how
|
|
3
|
+
* evenly across runs and in each category, what it used and cost, how fast it
|
|
4
|
+
* answered, and how often it wrote a call wrong or declined.
|
|
5
|
+
*
|
|
6
|
+
* A case is one scenario on one channel, for one model, in one run. A case
|
|
7
|
+
* the judge could not decide (`unjudged`) is neither passed nor failed: pass
|
|
8
|
+
* rates are over the cases judged. A case the spend guard stopped (`stopped`)
|
|
9
|
+
* did not run to its end and is left out of every figure but the count.
|
|
10
|
+
*/
|
|
11
|
+
import type { EvalFailure, EvalTurnRecord } from './run.js';
|
|
12
|
+
import type { EvalCandidate } from './models.js';
|
|
13
|
+
import type { EvalTurnUsage } from './usage.js';
|
|
14
|
+
/** One of a case's turns, as a matrix keeps it. */
|
|
15
|
+
export interface MatrixTurn {
|
|
16
|
+
turn: number;
|
|
17
|
+
kind: EvalTurnRecord['kind'];
|
|
18
|
+
customer: string;
|
|
19
|
+
reply: string;
|
|
20
|
+
toolCalls: EvalTurnRecord['toolCalls'];
|
|
21
|
+
held: boolean;
|
|
22
|
+
usage: EvalTurnUsage;
|
|
23
|
+
invalidToolCalls: number;
|
|
24
|
+
refusal: EvalTurnRecord['refusal'];
|
|
25
|
+
/** What its calls cost at the model's prices, in US dollars. */
|
|
26
|
+
costUsd: number;
|
|
27
|
+
outcome: EvalTurnRecord['outcome'];
|
|
28
|
+
stopReason?: string;
|
|
29
|
+
}
|
|
30
|
+
/** One scenario on one channel, for one model, in one run. */
|
|
31
|
+
export interface MatrixCase {
|
|
32
|
+
suite: string;
|
|
33
|
+
scenario: string;
|
|
34
|
+
title: string;
|
|
35
|
+
channel: string;
|
|
36
|
+
/** Its scenario's categories, its suite's first. */
|
|
37
|
+
tags: string[];
|
|
38
|
+
model: string;
|
|
39
|
+
/** From 1. */
|
|
40
|
+
run: number;
|
|
41
|
+
/** `stopped`: the spend guard refused one of its requests, so it did not run to its end. */
|
|
42
|
+
status: 'passed' | 'failed' | 'unjudged' | 'stopped';
|
|
43
|
+
failures: EvalFailure[];
|
|
44
|
+
turns: MatrixTurn[];
|
|
45
|
+
/** What the model's calls cost, in US dollars. */
|
|
46
|
+
costUsd: number;
|
|
47
|
+
/** What the judge's verdicts on it cost, in US dollars; null when the judge has no prices. */
|
|
48
|
+
judgeCostUsd: number | null;
|
|
49
|
+
modelRequests: number;
|
|
50
|
+
durationMs: number;
|
|
51
|
+
cassette: string;
|
|
52
|
+
}
|
|
53
|
+
/** A figure over runs: its mean, its least and its most, and each run's value (null where the run judged nothing). */
|
|
54
|
+
export interface Spread {
|
|
55
|
+
mean: number;
|
|
56
|
+
min: number;
|
|
57
|
+
max: number;
|
|
58
|
+
values: Array<number | null>;
|
|
59
|
+
}
|
|
60
|
+
/** The middle and the ninetieth percentile of a figure, and how many values they are of. */
|
|
61
|
+
export interface Percentiles {
|
|
62
|
+
p50: number | null;
|
|
63
|
+
p90: number | null;
|
|
64
|
+
samples: number;
|
|
65
|
+
}
|
|
66
|
+
/** A category's results for one model. */
|
|
67
|
+
export interface CategorySummary {
|
|
68
|
+
cases: number;
|
|
69
|
+
judged: number;
|
|
70
|
+
passed: number;
|
|
71
|
+
passRate: number | null;
|
|
72
|
+
costUsd: number;
|
|
73
|
+
costPerCompletedTaskUsd: number | null;
|
|
74
|
+
}
|
|
75
|
+
/** What a matrix says about one model. */
|
|
76
|
+
export interface ModelSummary {
|
|
77
|
+
model: string;
|
|
78
|
+
label: string;
|
|
79
|
+
capabilities: EvalCandidate['capabilities'];
|
|
80
|
+
/** Its cases: those that ran to their end, those the guard stopped, and of those that ran, each status. */
|
|
81
|
+
cases: {
|
|
82
|
+
total: number;
|
|
83
|
+
ran: number;
|
|
84
|
+
stopped: number;
|
|
85
|
+
judged: number;
|
|
86
|
+
passed: number;
|
|
87
|
+
failed: number;
|
|
88
|
+
unjudged: number;
|
|
89
|
+
};
|
|
90
|
+
/** Passed over judged, 0 to 1; null when nothing was judged. */
|
|
91
|
+
passRate: number | null;
|
|
92
|
+
/** Each run's pass rate, and their spread; null when no run judged anything. */
|
|
93
|
+
passRateByRun: Spread | null;
|
|
94
|
+
/** Each category's results, by tag; scenarios with no tag are under `untagged`. */
|
|
95
|
+
categories: Record<string, CategorySummary>;
|
|
96
|
+
/** The agent's turns that ran a model call (a turn a person held runs none). */
|
|
97
|
+
turns: number;
|
|
98
|
+
modelCalls: {
|
|
99
|
+
total: number;
|
|
100
|
+
perTurn: number | null;
|
|
101
|
+
maxPerTurn: number;
|
|
102
|
+
};
|
|
103
|
+
tokens: {
|
|
104
|
+
input: number;
|
|
105
|
+
noCache: number;
|
|
106
|
+
cacheRead: number;
|
|
107
|
+
cacheWrite: number;
|
|
108
|
+
output: number;
|
|
109
|
+
/** The share of the input read from the prompt cache. */
|
|
110
|
+
cachedShare: number | null;
|
|
111
|
+
perTurn: {
|
|
112
|
+
input: number | null;
|
|
113
|
+
output: number | null;
|
|
114
|
+
};
|
|
115
|
+
/** The largest one call's input: what its context window held. */
|
|
116
|
+
peakCallInput: number;
|
|
117
|
+
};
|
|
118
|
+
cost: {
|
|
119
|
+
/** Every case that ran, in US dollars. */
|
|
120
|
+
totalUsd: number;
|
|
121
|
+
perTurnUsd: number | null;
|
|
122
|
+
/** What one whole run of the suite cost, over the runs it finished; null when it finished none. */
|
|
123
|
+
perRunUsd: Spread | null;
|
|
124
|
+
/** What it cost over the cases it passed: everything it spent, failures included, per case passed; null when it passed none. */
|
|
125
|
+
perCompletedTaskUsd: number | null;
|
|
126
|
+
};
|
|
127
|
+
/** Per turn, in milliseconds: to its first token, and its model calls' time. */
|
|
128
|
+
latencyMs: {
|
|
129
|
+
firstToken: Percentiles;
|
|
130
|
+
total: Percentiles;
|
|
131
|
+
};
|
|
132
|
+
invalidToolCalls: {
|
|
133
|
+
total: number;
|
|
134
|
+
perTurn: number | null;
|
|
135
|
+
};
|
|
136
|
+
/** Turns that declined: in all, those the provider stopped for their content, and replies that declined where no refusal was expected. */
|
|
137
|
+
refusals: {
|
|
138
|
+
total: number;
|
|
139
|
+
provider: number;
|
|
140
|
+
reply: number;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/** The model a matrix picks for a scope: the cheapest per completed task of those within `withinPoints` of the best pass rate. */
|
|
144
|
+
export interface MatrixLeader {
|
|
145
|
+
/** `all`, or a category's tag. */
|
|
146
|
+
scope: string;
|
|
147
|
+
withinPoints: number;
|
|
148
|
+
best: {
|
|
149
|
+
model: string;
|
|
150
|
+
passRate: number;
|
|
151
|
+
} | null;
|
|
152
|
+
/** The models within the points of the best, cheapest per completed task first. */
|
|
153
|
+
contenders: Array<{
|
|
154
|
+
model: string;
|
|
155
|
+
passRate: number;
|
|
156
|
+
costPerCompletedTaskUsd: number;
|
|
157
|
+
}>;
|
|
158
|
+
pick: string | null;
|
|
159
|
+
}
|
|
160
|
+
export declare const UNTAGGED = "untagged";
|
|
161
|
+
/** The `p` quantile (0 to 1) of values, interpolated linearly between the two nearest ranks; null with none. */
|
|
162
|
+
export declare function percentile(values: readonly number[], p: number): number | null;
|
|
163
|
+
export declare function percentiles(values: readonly number[]): Percentiles;
|
|
164
|
+
/** The spread of values by run; null when no run has one. */
|
|
165
|
+
export declare function spreadOf(values: ReadonlyArray<number | null>): Spread | null;
|
|
166
|
+
/**
|
|
167
|
+
* One model's summary, from its cases. `runs` is how many runs the matrix
|
|
168
|
+
* asked for, and `targets` how many cases make one whole run.
|
|
169
|
+
*/
|
|
170
|
+
export declare function summarizeModel(model: EvalCandidate, cases: readonly MatrixCase[], runs: number, targets: number): ModelSummary;
|
|
171
|
+
/**
|
|
172
|
+
* For the whole suite and each category: the best pass rate, the models within
|
|
173
|
+
* `withinPoints` percentage points of it, and of those the cheapest per
|
|
174
|
+
* completed task (ties: the higher pass rate, then the matrix's order). A
|
|
175
|
+
* model that passed nothing in a scope cannot be picked for it.
|
|
176
|
+
*/
|
|
177
|
+
export declare function leadersOf(summaries: readonly ModelSummary[], withinPoints: number): MatrixLeader[];
|
|
178
|
+
//# sourceMappingURL=aggregate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../src/aggregate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,mDAAmD;AACnD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,aAAa,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACnC,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,8DAA8D;AAC9D,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,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a,EAAE,KAAK,EAAE,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CAmE9H;AAKD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,SAAS,YAAY,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,YAAY,EAAE,CAiBlG"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export const UNTAGGED = 'untagged';
|
|
2
|
+
const sum = (values) => values.reduce((s, v) => s + v, 0);
|
|
3
|
+
const ratio = (n, d) => (d > 0 ? n / d : null);
|
|
4
|
+
/** The `p` quantile (0 to 1) of values, interpolated linearly between the two nearest ranks; null with none. */
|
|
5
|
+
export function percentile(values, p) {
|
|
6
|
+
if (values.length === 0)
|
|
7
|
+
return null;
|
|
8
|
+
const sorted = [...values].sort((a, b) => a - b);
|
|
9
|
+
const rank = Math.min(1, Math.max(0, p)) * (sorted.length - 1);
|
|
10
|
+
const lo = Math.floor(rank);
|
|
11
|
+
const hi = Math.ceil(rank);
|
|
12
|
+
return sorted[lo] + (sorted[hi] - sorted[lo]) * (rank - lo);
|
|
13
|
+
}
|
|
14
|
+
export function percentiles(values) {
|
|
15
|
+
return { p50: percentile(values, 0.5), p90: percentile(values, 0.9), samples: values.length };
|
|
16
|
+
}
|
|
17
|
+
/** The spread of values by run; null when no run has one. */
|
|
18
|
+
export function spreadOf(values) {
|
|
19
|
+
const given = values.filter((v) => v !== null);
|
|
20
|
+
if (given.length === 0)
|
|
21
|
+
return null;
|
|
22
|
+
return { mean: sum(given) / given.length, min: Math.min(...given), max: Math.max(...given), values: [...values] };
|
|
23
|
+
}
|
|
24
|
+
const categoryOf = (cases) => {
|
|
25
|
+
const ran = cases.filter((c) => c.status !== 'stopped');
|
|
26
|
+
const passed = ran.filter((c) => c.status === 'passed').length;
|
|
27
|
+
const judged = passed + ran.filter((c) => c.status === 'failed').length;
|
|
28
|
+
const costUsd = sum(ran.map((c) => c.costUsd));
|
|
29
|
+
return { cases: ran.length, judged, passed, passRate: ratio(passed, judged), costUsd, costPerCompletedTaskUsd: ratio(costUsd, passed) };
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* One model's summary, from its cases. `runs` is how many runs the matrix
|
|
33
|
+
* asked for, and `targets` how many cases make one whole run.
|
|
34
|
+
*/
|
|
35
|
+
export function summarizeModel(model, cases, runs, targets) {
|
|
36
|
+
const ran = cases.filter((c) => c.status !== 'stopped');
|
|
37
|
+
const count = (status) => cases.filter((c) => c.status === status).length;
|
|
38
|
+
const passed = count('passed');
|
|
39
|
+
const failed = count('failed');
|
|
40
|
+
const judged = passed + failed;
|
|
41
|
+
const runNumbers = Array.from({ length: runs }, (_, i) => i + 1);
|
|
42
|
+
const passRateByRun = spreadOf(runNumbers.map((run) => {
|
|
43
|
+
const inRun = ran.filter((c) => c.run === run);
|
|
44
|
+
const p = inRun.filter((c) => c.status === 'passed').length;
|
|
45
|
+
return ratio(p, p + inRun.filter((c) => c.status === 'failed').length);
|
|
46
|
+
}));
|
|
47
|
+
// A run is whole when every one of its cases ran to its end.
|
|
48
|
+
const perRunUsd = spreadOf(runNumbers.map((run) => {
|
|
49
|
+
const inRun = ran.filter((c) => c.run === run);
|
|
50
|
+
return inRun.length === targets && targets > 0 ? sum(inRun.map((c) => c.costUsd)) : null;
|
|
51
|
+
}));
|
|
52
|
+
const tags = [...new Set(cases.flatMap((c) => (c.tags.length ? c.tags : [UNTAGGED])))].sort();
|
|
53
|
+
const categories = Object.fromEntries(tags.map((tag) => [tag, categoryOf(cases.filter((c) => (c.tags.length ? c.tags.includes(tag) : tag === UNTAGGED)))]));
|
|
54
|
+
const turns = ran.flatMap((c) => c.turns).filter((t) => !t.held && t.usage.calls.length > 0);
|
|
55
|
+
const tokens = (pick) => sum(turns.map((t) => pick(t.usage)));
|
|
56
|
+
const input = tokens((u) => u.inputTokens);
|
|
57
|
+
const output = tokens((u) => u.outputTokens);
|
|
58
|
+
const cacheRead = tokens((u) => u.cacheReadTokens);
|
|
59
|
+
const calls = turns.map((t) => t.usage.calls.length);
|
|
60
|
+
const totalUsd = sum(ran.map((c) => c.costUsd));
|
|
61
|
+
const invalid = sum(turns.map((t) => t.invalidToolCalls));
|
|
62
|
+
return {
|
|
63
|
+
model: model.id,
|
|
64
|
+
label: model.label,
|
|
65
|
+
capabilities: model.capabilities,
|
|
66
|
+
cases: { total: cases.length, ran: ran.length, stopped: count('stopped'), judged, passed, failed, unjudged: count('unjudged') },
|
|
67
|
+
passRate: ratio(passed, judged),
|
|
68
|
+
passRateByRun,
|
|
69
|
+
categories,
|
|
70
|
+
turns: turns.length,
|
|
71
|
+
modelCalls: { total: sum(calls), perTurn: ratio(sum(calls), turns.length), maxPerTurn: calls.length ? Math.max(...calls) : 0 },
|
|
72
|
+
tokens: {
|
|
73
|
+
input,
|
|
74
|
+
noCache: tokens((u) => u.noCacheTokens),
|
|
75
|
+
cacheRead,
|
|
76
|
+
cacheWrite: tokens((u) => u.cacheWriteTokens),
|
|
77
|
+
output,
|
|
78
|
+
cachedShare: ratio(cacheRead, input),
|
|
79
|
+
perTurn: { input: ratio(input, turns.length), output: ratio(output, turns.length) },
|
|
80
|
+
peakCallInput: turns.reduce((m, t) => Math.max(m, t.usage.peakCallInputTokens), 0),
|
|
81
|
+
},
|
|
82
|
+
cost: { totalUsd, perTurnUsd: ratio(totalUsd, turns.length), perRunUsd, perCompletedTaskUsd: ratio(totalUsd, passed) },
|
|
83
|
+
latencyMs: {
|
|
84
|
+
firstToken: percentiles(turns.map((t) => t.usage.firstTokenMs).filter((ms) => ms !== null)),
|
|
85
|
+
total: percentiles(turns.map((t) => t.usage.modelMs)),
|
|
86
|
+
},
|
|
87
|
+
invalidToolCalls: { total: invalid, perTurn: ratio(invalid, turns.length) },
|
|
88
|
+
refusals: {
|
|
89
|
+
total: turns.filter((t) => t.refusal !== null).length,
|
|
90
|
+
provider: turns.filter((t) => t.refusal === 'provider').length,
|
|
91
|
+
reply: turns.filter((t) => t.refusal === 'reply').length,
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** Floating error in a pass rate is not a point: two rates this close are one. */
|
|
96
|
+
const EPSILON = 1e-9;
|
|
97
|
+
/**
|
|
98
|
+
* For the whole suite and each category: the best pass rate, the models within
|
|
99
|
+
* `withinPoints` percentage points of it, and of those the cheapest per
|
|
100
|
+
* completed task (ties: the higher pass rate, then the matrix's order). A
|
|
101
|
+
* model that passed nothing in a scope cannot be picked for it.
|
|
102
|
+
*/
|
|
103
|
+
export function leadersOf(summaries, withinPoints) {
|
|
104
|
+
const scopes = ['all', ...[...new Set(summaries.flatMap((s) => Object.keys(s.categories)))].sort()];
|
|
105
|
+
return scopes.map((scope) => {
|
|
106
|
+
const rows = summaries.flatMap((s, order) => {
|
|
107
|
+
const passRate = scope === 'all' ? s.passRate : (s.categories[scope]?.passRate ?? null);
|
|
108
|
+
const cost = scope === 'all' ? s.cost.perCompletedTaskUsd : (s.categories[scope]?.costPerCompletedTaskUsd ?? null);
|
|
109
|
+
return passRate === null ? [] : [{ model: s.model, passRate, cost, order }];
|
|
110
|
+
});
|
|
111
|
+
const top = rows.reduce((best, r) => (!best || r.passRate > best.passRate + EPSILON ? r : best), null);
|
|
112
|
+
if (!top || top.passRate <= 0)
|
|
113
|
+
return { scope, withinPoints, best: top ? { model: top.model, passRate: top.passRate } : null, contenders: [], pick: null };
|
|
114
|
+
const floor = top.passRate - withinPoints / 100 - EPSILON;
|
|
115
|
+
const contenders = rows
|
|
116
|
+
.filter((r) => r.passRate >= floor && r.cost !== null)
|
|
117
|
+
.sort((a, b) => a.cost - b.cost || b.passRate - a.passRate || a.order - b.order)
|
|
118
|
+
.map((r) => ({ model: r.model, passRate: r.passRate, costPerCompletedTaskUsd: r.cost }));
|
|
119
|
+
return { scope, withinPoints, best: { model: top.model, passRate: top.passRate }, contenders, pick: contenders[0]?.model ?? null };
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+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"}
|
package/dist/cassettes.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import type { AgentEvalScenario, AgentEvalSuite } from '@ouispec/contract';
|
|
|
2
2
|
import type { RecordedExchange } from '@ouispec/agent-worker/testing';
|
|
3
3
|
import type { RegisteredTool } from '@ouispec/agent-worker';
|
|
4
4
|
import type { EvalChannel } from './config.js';
|
|
5
|
+
import { type EvalCandidate } from './models.js';
|
|
6
|
+
import type { EvalCallTiming } from './usage.js';
|
|
5
7
|
export declare const CASSETTE_VERSION = 1;
|
|
6
8
|
export interface Cassette {
|
|
7
9
|
version: typeof CASSETTE_VERSION;
|
|
@@ -13,9 +15,20 @@ export interface Cassette {
|
|
|
13
15
|
recordedAt: string;
|
|
14
16
|
fingerprint: string;
|
|
15
17
|
exchanges: RecordedExchange[];
|
|
18
|
+
/** How long each of the agent's model calls took, in order (never the judge's): a replay reports these. */
|
|
19
|
+
timings?: EvalCallTiming[];
|
|
16
20
|
}
|
|
17
|
-
/**
|
|
18
|
-
export
|
|
21
|
+
/** Which of a matrix's recordings: the candidate's, and the run (1 for the first). */
|
|
22
|
+
export interface CassetteSlot {
|
|
23
|
+
model?: string;
|
|
24
|
+
run?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Where a scenario's recording on a channel lives: `<suite>/<scenario>.<channel>.json`;
|
|
28
|
+
* in a matrix `<suite>/<model>/<scenario>.<channel>.json`, and from its second
|
|
29
|
+
* run on `….run-<n>.json`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function cassettePath(directory: string, suite: AgentEvalSuite, scenario: AgentEvalScenario, channel: string, slot?: CassetteSlot): string;
|
|
19
32
|
export declare function readCassette(path: string): Cassette | null;
|
|
20
33
|
export declare function writeCassette(path: string, cassette: Cassette): void;
|
|
21
34
|
/** What the fingerprint is taken over: what shapes the requests the model is sent. */
|
|
@@ -36,6 +49,9 @@ export interface FingerprintInputs {
|
|
|
36
49
|
/** Whether a choice waits for a reply: it can add a step to a turn. */
|
|
37
50
|
requireReplyBeforeChoice?: boolean;
|
|
38
51
|
uiActions?: unknown;
|
|
52
|
+
/** In a model matrix: the candidate, as it shapes what is sent, and the judge's id. */
|
|
53
|
+
candidate?: Pick<EvalCandidate, 'id' | 'providerOptions' | 'capabilities'>;
|
|
54
|
+
judge?: string;
|
|
39
55
|
}
|
|
40
56
|
export declare function fingerprint(inputs: FingerprintInputs): string;
|
|
41
57
|
//# sourceMappingURL=cassettes.d.ts.map
|
package/dist/cassettes.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cassettes.d.ts","sourceRoot":"","sources":["../src/cassettes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cassettes.d.ts","sourceRoot":"","sources":["../src/cassettes.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,OAAO,gBAAgB,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,2GAA2G;IAC3G,OAAO,CAAC,EAAE,cAAc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7 +5,13 @@
|
|
|
5
5
|
* The fingerprint is a hash of everything that shapes what the model is
|
|
6
6
|
* asked: the system prompt, the tools' names, descriptions and schemas, the
|
|
7
7
|
* channel's settings, the scenario's inputs, its page, the agent's provider
|
|
8
|
-
* and UI settings, and the rubrics its judge reads
|
|
8
|
+
* and UI settings, and the rubrics its judge reads; in a model matrix, the
|
|
9
|
+
* candidate too (its id, its provider options and what it can be asked for)
|
|
10
|
+
* and the judge's id.
|
|
11
|
+
*
|
|
12
|
+
* A matrix files each candidate's recordings apart, and each run of a
|
|
13
|
+
* scenario apart from its first. A recording also keeps how long each of the
|
|
14
|
+
* agent's model calls took, so a replay reports the live run's times.
|
|
9
15
|
* A recording replayed against a changed configuration or scenario fails,
|
|
10
16
|
* rather than passing on answers to a question no longer asked.
|
|
11
17
|
*/
|
|
@@ -13,13 +19,17 @@ import { createHash } from 'node:crypto';
|
|
|
13
19
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
14
20
|
import { dirname, join } from 'node:path';
|
|
15
21
|
import { canonicalJson } from '@ouispec/agent-core';
|
|
22
|
+
import { slug } from './models.js';
|
|
16
23
|
import { rubricsOf } from './suite.js';
|
|
17
24
|
export const CASSETTE_VERSION = 1;
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Where a scenario's recording on a channel lives: `<suite>/<scenario>.<channel>.json`;
|
|
27
|
+
* in a matrix `<suite>/<model>/<scenario>.<channel>.json`, and from its second
|
|
28
|
+
* run on `….run-<n>.json`.
|
|
29
|
+
*/
|
|
30
|
+
export function cassettePath(directory, suite, scenario, channel, slot = {}) {
|
|
31
|
+
const run = slot.run !== undefined && slot.run > 1 ? `.run-${slot.run}` : '';
|
|
32
|
+
return join(directory, slug(suite.name), ...(slot.model !== undefined ? [slug(slot.model, 'model')] : []), `${scenario.id}.${channel}${run}.json`);
|
|
23
33
|
}
|
|
24
34
|
export function readCassette(path) {
|
|
25
35
|
if (!existsSync(path))
|
|
@@ -35,7 +45,7 @@ export function writeCassette(path, cassette) {
|
|
|
35
45
|
writeFileSync(path, `${JSON.stringify(cassette, null, 2)}\n`);
|
|
36
46
|
}
|
|
37
47
|
export function fingerprint(inputs) {
|
|
38
|
-
const { systemPrompt, tools, channel, suite, scenario, page, modelProviderOptions, forcedToolChoice, requireReplyBeforeChoice, uiActions } = inputs;
|
|
48
|
+
const { systemPrompt, tools, channel, suite, scenario, page, modelProviderOptions, forcedToolChoice, requireReplyBeforeChoice, uiActions, candidate, judge } = inputs;
|
|
39
49
|
const shaped = {
|
|
40
50
|
systemPrompt,
|
|
41
51
|
tools: [...tools]
|
|
@@ -60,6 +70,8 @@ export function fingerprint(inputs) {
|
|
|
60
70
|
...(forcedToolChoice !== undefined ? { forcedToolChoice } : {}),
|
|
61
71
|
...(requireReplyBeforeChoice ? { requireReplyBeforeChoice } : {}),
|
|
62
72
|
...(uiActions !== undefined ? { uiActions } : {}),
|
|
73
|
+
...(candidate ? { candidate: { id: candidate.id, providerOptions: candidate.providerOptions ?? null, capabilities: candidate.capabilities } } : {}),
|
|
74
|
+
...(judge !== undefined ? { judge } : {}),
|
|
63
75
|
};
|
|
64
76
|
return createHash('sha256').update(canonicalJson(shaped)).digest('hex');
|
|
65
77
|
}
|
package/dist/cassettes.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cassettes.js","sourceRoot":"","sources":["../src/cassettes.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"cassettes.js","sourceRoot":"","sources":["../src/cassettes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,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