@crowandraven/evalkeeper 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +6 -2
- package/bin/evalkeeper.mjs +9 -0
- package/dist/attention.d.ts +49 -0
- package/dist/attention.js +49 -0
- package/dist/attention.js.map +1 -0
- package/dist/board.d.ts +57 -0
- package/dist/board.js +2 -0
- package/dist/board.js.map +1 -0
- package/dist/cli/addPages.d.ts +79 -0
- package/dist/cli/addPages.js +181 -0
- package/dist/cli/addPages.js.map +1 -0
- package/dist/cli/main.d.ts +18 -0
- package/dist/cli/main.js +115 -0
- package/dist/cli/main.js.map +1 -0
- package/dist/common.d.ts +72 -0
- package/dist/common.js +276 -0
- package/dist/common.js.map +1 -0
- package/dist/compare.d.ts +85 -0
- package/dist/compare.js +185 -0
- package/dist/compare.js.map +1 -0
- package/dist/decisions.d.ts +84 -0
- package/dist/decisions.js +146 -0
- package/dist/decisions.js.map +1 -0
- package/dist/feedback.d.ts +114 -0
- package/dist/feedback.js +116 -0
- package/dist/feedback.js.map +1 -0
- package/dist/format.d.ts +6 -0
- package/dist/format.js +22 -0
- package/dist/format.js.map +1 -0
- package/dist/glossary.d.ts +46 -0
- package/dist/glossary.js +45 -0
- package/dist/glossary.js.map +1 -0
- package/dist/health.d.ts +40 -0
- package/dist/health.js +101 -0
- package/dist/health.js.map +1 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/labels.d.ts +8 -0
- package/dist/labels.js +15 -0
- package/dist/labels.js.map +1 -0
- package/dist/legs.d.ts +23 -0
- package/dist/legs.js +22 -0
- package/dist/legs.js.map +1 -0
- package/dist/memoryStore.d.ts +21 -0
- package/dist/memoryStore.js +228 -0
- package/dist/memoryStore.js.map +1 -0
- package/dist/models.d.ts +76 -0
- package/dist/models.js +56 -0
- package/dist/models.js.map +1 -0
- package/dist/prune.d.ts +48 -0
- package/dist/prune.js +77 -0
- package/dist/prune.js.map +1 -0
- package/dist/quickSet.d.ts +26 -0
- package/dist/quickSet.js +44 -0
- package/dist/quickSet.js.map +1 -0
- package/dist/runner.d.ts +202 -0
- package/dist/runner.js +734 -0
- package/dist/runner.js.map +1 -0
- package/dist/settings.d.ts +196 -0
- package/dist/settings.js +272 -0
- package/dist/settings.js.map +1 -0
- package/dist/stableJson.d.ts +11 -0
- package/dist/stableJson.js +15 -0
- package/dist/stableJson.js.map +1 -0
- package/dist/stats.d.ts +98 -0
- package/dist/stats.js +119 -0
- package/dist/stats.js.map +1 -0
- package/dist/store.d.ts +151 -0
- package/dist/store.js +3 -0
- package/dist/store.js.map +1 -0
- package/dist/suggest.d.ts +75 -0
- package/dist/suggest.js +152 -0
- package/dist/suggest.js.map +1 -0
- package/dist/summary.d.ts +51 -0
- package/dist/summary.js +61 -0
- package/dist/summary.js.map +1 -0
- package/dist/testing.d.ts +26 -0
- package/dist/testing.js +362 -0
- package/dist/testing.js.map +1 -0
- package/dist/timeout.d.ts +2 -0
- package/dist/timeout.js +15 -0
- package/dist/timeout.js.map +1 -0
- package/dist/types.d.ts +225 -0
- package/dist/types.js +46 -0
- package/dist/types.js.map +1 -0
- package/dist/upkeepRules.d.ts +28 -0
- package/dist/upkeepRules.js +40 -0
- package/dist/upkeepRules.js.map +1 -0
- package/dist/util.d.ts +8 -0
- package/dist/util.js +18 -0
- package/dist/util.js.map +1 -0
- package/dist/weekly.d.ts +80 -0
- package/dist/weekly.js +113 -0
- package/dist/weekly.js.map +1 -0
- package/package.json +81 -4
- package/src/attention.ts +89 -0
- package/src/board.ts +58 -0
- package/src/cli/addPages.ts +256 -0
- package/src/cli/main.ts +125 -0
- package/src/common.ts +338 -0
- package/src/compare.ts +261 -0
- package/src/decisions.ts +230 -0
- package/src/feedback.ts +225 -0
- package/src/format.ts +19 -0
- package/src/glossary.ts +75 -0
- package/src/health.ts +149 -0
- package/src/index.ts +33 -0
- package/src/labels.ts +18 -0
- package/src/legs.ts +38 -0
- package/src/memoryStore.ts +268 -0
- package/src/models.ts +127 -0
- package/src/prune.ts +95 -0
- package/src/quickSet.ts +55 -0
- package/src/runner.ts +1010 -0
- package/src/settings.ts +441 -0
- package/src/stableJson.ts +24 -0
- package/src/stats.ts +215 -0
- package/src/store.ts +172 -0
- package/src/suggest.ts +247 -0
- package/src/summary.ts +109 -0
- package/src/testing.ts +415 -0
- package/src/timeout.ts +14 -0
- package/src/types.ts +258 -0
- package/src/upkeepRules.ts +46 -0
- package/src/util.ts +17 -0
- package/src/weekly.ts +169 -0
- package/starter/index.ts +86 -0
- package/templates/app/api/cron/evals-weekly/route.ts +24 -0
- package/templates/app/evals/[suite]/page.tsx +449 -0
- package/templates/app/evals/[suite]/runs/[runId]/page.tsx +95 -0
- package/templates/app/evals/feedback/page.tsx +219 -0
- package/templates/app/evals/page.tsx +313 -0
- package/templates/components/evalkeeper/AddCase.tsx +62 -0
- package/templates/components/evalkeeper/AnswerKey.tsx +360 -0
- package/templates/components/evalkeeper/CaseMenu.tsx +122 -0
- package/templates/components/evalkeeper/Fields.tsx +110 -0
- package/templates/components/evalkeeper/RefreshWhile.tsx +25 -0
- package/templates/components/evalkeeper/SettingsHistory.tsx +191 -0
- package/templates/components/evalkeeper/Submit.tsx +58 -0
- package/templates/components/evalkeeper/Thumbs.tsx +117 -0
- package/templates/components/evalkeeper/Tip.tsx +98 -0
- package/templates/components/evalkeeper/WeeklyCheck.tsx +124 -0
- package/templates/components/evalkeeper/evalkeeper.css +71 -0
- package/templates/components/evalkeeper/ui.tsx +103 -0
- package/templates/lib/evalkeeper/actions.ts +263 -0
- package/templates/lib/evalkeeper/cronAuth.ts +18 -0
- package/templates/lib/evalkeeper/paths.ts +11 -0
- package/templates/lib/evalkeeper/time.ts +4 -0
- package/templates/lib/evalkeeper/weekly.ts +51 -0
package/dist/health.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { BoardRow } from "./board.js";
|
|
2
|
+
import type { ModelCatalog } from "./models.js";
|
|
3
|
+
import { type CheckDef, type SuitePriority } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Where a suite stands, for its card on the evals hub: one status and the
|
|
6
|
+
* reasons, from the same board and suggestion its own page shows. Pure.
|
|
7
|
+
*/
|
|
8
|
+
/** Where a suite stands, from not tested to good. */
|
|
9
|
+
export type HealthStatus = "untested" | "stale" | "few" | "improve" | "fair" | "good";
|
|
10
|
+
/**
|
|
11
|
+
* A suite's status for its card, with the live model's score and the reasons, most important first.
|
|
12
|
+
*/
|
|
13
|
+
export type Health = {
|
|
14
|
+
status: HealthStatus;
|
|
15
|
+
title: string;
|
|
16
|
+
/** The live model, its score, and how many models were tested. */
|
|
17
|
+
live: {
|
|
18
|
+
label: string;
|
|
19
|
+
rate: number;
|
|
20
|
+
} | null;
|
|
21
|
+
testedModels: number;
|
|
22
|
+
/** What to do or watch, most important first. */
|
|
23
|
+
details: string[];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Where a suite stands, for its card on the hub, from the same board and suggestion its
|
|
27
|
+
* page shows.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const board = await runner.board("ticket_triage");
|
|
32
|
+
* const h = suiteHealth(board.rows, suite.checks, suite.priority, board.cases, board.provisional, MODELS);
|
|
33
|
+
* // h.status: "good" | "fair" | "improve" | "few" | "stale" | "untested"
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare function suiteHealth(rows: BoardRow[], checks: CheckDef[], priority: SuitePriority, cases: number,
|
|
37
|
+
/** Cases in use on unreviewed answers. */
|
|
38
|
+
provisional?: number,
|
|
39
|
+
/** Your model catalog, for retirements and the fallback's provider. */
|
|
40
|
+
models?: ModelCatalog): Health;
|
package/dist/health.js
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { confidenceFor, TARGET_CASES } from "./summary.js";
|
|
2
|
+
import { suggest } from "./suggest.js";
|
|
3
|
+
import { checkBar } from "./types.js";
|
|
4
|
+
const pct = (x) => `${Math.round(x * 100)}%`;
|
|
5
|
+
/**
|
|
6
|
+
* Where a suite stands, for its card on the hub, from the same board and suggestion its
|
|
7
|
+
* page shows.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* const board = await runner.board("ticket_triage");
|
|
12
|
+
* const h = suiteHealth(board.rows, suite.checks, suite.priority, board.cases, board.provisional, MODELS);
|
|
13
|
+
* // h.status: "good" | "fair" | "improve" | "few" | "stale" | "untested"
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export function suiteHealth(rows, checks, priority, cases,
|
|
17
|
+
/** Cases in use on unreviewed answers. */
|
|
18
|
+
provisional = 0,
|
|
19
|
+
/** Your model catalog, for retirements and the fallback's provider. */
|
|
20
|
+
models = {}) {
|
|
21
|
+
const liveRow = rows.find((r) => r.live) ?? null;
|
|
22
|
+
const testedModels = rows.filter((r) => !r.baseline && r.test && !r.test.stale).length;
|
|
23
|
+
const t = liveRow?.test;
|
|
24
|
+
const live = liveRow && t ? { label: liveRow.label, rate: t.right / t.total } : null;
|
|
25
|
+
const base = { live, testedModels };
|
|
26
|
+
const fewer = cases < TARGET_CASES ? `${cases} of ${TARGET_CASES} cases` : "";
|
|
27
|
+
if (!t)
|
|
28
|
+
return {
|
|
29
|
+
...base,
|
|
30
|
+
status: "untested",
|
|
31
|
+
title: "Not tested yet",
|
|
32
|
+
details: [
|
|
33
|
+
`Test the models to see how ${liveRow?.label ?? "the live model"} does.`,
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
if (t.stale)
|
|
37
|
+
return {
|
|
38
|
+
...base,
|
|
39
|
+
status: "stale",
|
|
40
|
+
title: "Test again",
|
|
41
|
+
details: ["Cases, answers, or instructions changed since the last test."],
|
|
42
|
+
};
|
|
43
|
+
const details = [];
|
|
44
|
+
if (provisional)
|
|
45
|
+
details.push(`${provisional} of ${cases} answers are provisional: review them before trusting these scores.`);
|
|
46
|
+
// Live checks under their bars, serious first.
|
|
47
|
+
const below = checks
|
|
48
|
+
.map((c) => ({ c, rate: t.byCheck[c.key]?.rate ?? null }))
|
|
49
|
+
.filter((x) => x.rate !== null && x.rate < checkBar(x.c))
|
|
50
|
+
.sort((a, b) => Number(b.c.severity === "serious") -
|
|
51
|
+
Number(a.c.severity === "serious") || a.rate - b.rate);
|
|
52
|
+
for (const { c, rate } of below.slice(0, 3))
|
|
53
|
+
details.push(`${c.label}: ${pct(rate)}, under the ${pct(checkBar(c))} bar${c.severity === "serious" ? " (serious)" : ""}.`);
|
|
54
|
+
if (below.length > 3)
|
|
55
|
+
details.push(`${below.length - 3} more under the bar.`);
|
|
56
|
+
const s = suggest(rows, checks, priority, models);
|
|
57
|
+
const change = s && !s.same;
|
|
58
|
+
if (change)
|
|
59
|
+
details.push(s.keepLive
|
|
60
|
+
? `A better fallback is suggested: ${s.fallback?.label}.`
|
|
61
|
+
: `${s.live.label} is suggested over ${liveRow.label}.`);
|
|
62
|
+
if (testedModels < 2)
|
|
63
|
+
details.push("Only one model tested: test others to compare.");
|
|
64
|
+
const confidence = confidenceFor(cases, live?.rate ?? 0.5);
|
|
65
|
+
if (confidence.level === "too-few")
|
|
66
|
+
return {
|
|
67
|
+
...base,
|
|
68
|
+
status: "few",
|
|
69
|
+
title: "Too few cases to trust",
|
|
70
|
+
details: [
|
|
71
|
+
`${fewer}: a score could be off by about ${confidence.margin} points.`,
|
|
72
|
+
...details,
|
|
73
|
+
],
|
|
74
|
+
};
|
|
75
|
+
if (below.length || change)
|
|
76
|
+
return {
|
|
77
|
+
...base,
|
|
78
|
+
status: "improve",
|
|
79
|
+
title: "Room to improve",
|
|
80
|
+
details: fewer
|
|
81
|
+
? [...details, `${fewer}: add more to firm it up.`]
|
|
82
|
+
: details,
|
|
83
|
+
};
|
|
84
|
+
if (confidence.level === "rough")
|
|
85
|
+
return {
|
|
86
|
+
...base,
|
|
87
|
+
status: "fair",
|
|
88
|
+
title: "Good so far",
|
|
89
|
+
details: [
|
|
90
|
+
`Meets every bar, but with ${fewer} a score could be off by about ${confidence.margin} points.`,
|
|
91
|
+
...details,
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
return {
|
|
95
|
+
...base,
|
|
96
|
+
status: "good",
|
|
97
|
+
title: "In good shape",
|
|
98
|
+
details: details.length ? details : ["Meets every bar on enough cases."],
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=health.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../src/health.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAqC,MAAM,YAAY,CAAC;AAwBzE,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC;AAErD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,WAAW,CACzB,IAAgB,EAChB,MAAkB,EAClB,QAAuB,EACvB,KAAa;AACb,0CAA0C;AAC1C,WAAW,GAAG,CAAC;AACf,uEAAuE;AACvE,SAAuB,EAAE;IAEzB,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;IACjD,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAC9B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAC9C,CAAC,MAAM,CAAC;IACT,MAAM,CAAC,GAAG,OAAO,EAAE,IAAI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AAI,EAAE,IAAI,IAAI,GAAG,CAAC,CAAC;IAC3D,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS;QAChC,OAAO;YACL,GAAG,IAAI;YACP,MAAM,EAAE,KAAK;YACb,KAAK,EAAE,wBAAwB;YAC/B,OAAO,EAAE;gBACP,GAAG,KAAK,mCAAmC,UAAU,CAAC,MAAM,UAAU;gBACtE,GAAG,OAAO;aACX;SACF,CAAC;IACJ,IAAI,KAAK,CAAC,MAAM,IAAI,MAAM;QACxB,OAAO;YACL,GAAG,IAAI;YACP,MAAM,EAAE,SAAS;YACjB,KAAK,EAAE,iBAAiB;YACxB,OAAO,EAAE,KAAK;gBACZ,CAAC,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,KAAK,2BAA2B,CAAC;gBACnD,CAAC,CAAC,OAAO;SACZ,CAAC;IACJ,IAAI,UAAU,CAAC,KAAK,KAAK,OAAO;QAC9B,OAAO;YACL,GAAG,IAAI;YACP,MAAM,EAAE,MAAM;YACd,KAAK,EAAE,aAAa;YACpB,OAAO,EAAE;gBACP,6BAA6B,KAAK,kCAAkC,UAAU,CAAC,MAAM,UAAU;gBAC/F,GAAG,OAAO;aACX;SACF,CAAC;IACJ,OAAO;QACL,GAAG,IAAI;QACP,MAAM,EAAE,MAAM;QACd,KAAK,EAAE,eAAe;QACtB,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,kCAAkC,CAAC;KACzE,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The core: suites, checks, stats, comparisons, suggestions, health, feedback,
|
|
3
|
+
* versioned settings, and the store interfaces. Pure: no database,
|
|
4
|
+
* framework, or provider.
|
|
5
|
+
*
|
|
6
|
+
* @module evalkeeper
|
|
7
|
+
*/
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export * from "./models.js";
|
|
10
|
+
export * from "./board.js";
|
|
11
|
+
export * from "./stats.js";
|
|
12
|
+
export * from "./compare.js";
|
|
13
|
+
export * from "./summary.js";
|
|
14
|
+
export * from "./suggest.js";
|
|
15
|
+
export * from "./health.js";
|
|
16
|
+
export * from "./attention.js";
|
|
17
|
+
export * from "./common.js";
|
|
18
|
+
export * from "./legs.js";
|
|
19
|
+
export * from "./timeout.js";
|
|
20
|
+
export * from "./prune.js";
|
|
21
|
+
export * from "./quickSet.js";
|
|
22
|
+
export * from "./stableJson.js";
|
|
23
|
+
export * from "./upkeepRules.js";
|
|
24
|
+
export * from "./format.js";
|
|
25
|
+
export * from "./glossary.js";
|
|
26
|
+
export * from "./feedback.js";
|
|
27
|
+
export * from "./weekly.js";
|
|
28
|
+
export * from "./settings.js";
|
|
29
|
+
export * from "./decisions.js";
|
|
30
|
+
export * from "./store.js";
|
|
31
|
+
export * from "./labels.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The core: suites, checks, stats, comparisons, suggestions, health, feedback,
|
|
3
|
+
* versioned settings, and the store interfaces. Pure: no database,
|
|
4
|
+
* framework, or provider.
|
|
5
|
+
*
|
|
6
|
+
* @module evalkeeper
|
|
7
|
+
*/
|
|
8
|
+
export * from "./types.js";
|
|
9
|
+
export * from "./models.js";
|
|
10
|
+
export * from "./board.js";
|
|
11
|
+
export * from "./stats.js";
|
|
12
|
+
export * from "./compare.js";
|
|
13
|
+
export * from "./summary.js";
|
|
14
|
+
export * from "./suggest.js";
|
|
15
|
+
export * from "./health.js";
|
|
16
|
+
export * from "./attention.js";
|
|
17
|
+
export * from "./common.js";
|
|
18
|
+
export * from "./legs.js";
|
|
19
|
+
export * from "./timeout.js";
|
|
20
|
+
export * from "./prune.js";
|
|
21
|
+
export * from "./quickSet.js";
|
|
22
|
+
export * from "./stableJson.js";
|
|
23
|
+
export * from "./upkeepRules.js";
|
|
24
|
+
export * from "./format.js";
|
|
25
|
+
export * from "./glossary.js";
|
|
26
|
+
export * from "./feedback.js";
|
|
27
|
+
export * from "./weekly.js";
|
|
28
|
+
export * from "./settings.js";
|
|
29
|
+
export * from "./decisions.js";
|
|
30
|
+
export * from "./store.js";
|
|
31
|
+
export * from "./labels.js";
|
|
32
|
+
// Server-only (node:crypto): import from "@crowandraven/evalkeeper/runner".
|
|
33
|
+
// In-memory store for tests and demos: "@crowandraven/evalkeeper/memory".
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,4EAA4E;AAC5E,0EAA0E"}
|
package/dist/labels.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LabelRecord } from "./store.js";
|
|
2
|
+
/**
|
|
3
|
+
* The EXPECTED answer tests use: the newest confirmed one, or failing that a
|
|
4
|
+
* provisional one (put to use before review). Pending answers never count.
|
|
5
|
+
*/
|
|
6
|
+
export declare function confirmedLabel(labels: LabelRecord[]): LabelRecord | null;
|
|
7
|
+
/** In use on an answer nobody has reviewed yet. */
|
|
8
|
+
export declare function isProvisional(labels: LabelRecord[]): boolean;
|
package/dist/labels.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The EXPECTED answer tests use: the newest confirmed one, or failing that a
|
|
3
|
+
* provisional one (put to use before review). Pending answers never count.
|
|
4
|
+
*/
|
|
5
|
+
export function confirmedLabel(labels) {
|
|
6
|
+
const newest = (status) => labels
|
|
7
|
+
.filter((l) => l.status === status)
|
|
8
|
+
.sort((a, b) => +b.updatedAt - +a.updatedAt)[0] ?? null;
|
|
9
|
+
return newest("CONFIRMED") ?? newest("PROVISIONAL");
|
|
10
|
+
}
|
|
11
|
+
/** In use on an answer nobody has reviewed yet. */
|
|
12
|
+
export function isProvisional(labels) {
|
|
13
|
+
return confirmedLabel(labels)?.status === "PROVISIONAL";
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=labels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"labels.js","sourceRoot":"","sources":["../src/labels.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,MAAqB;IAClD,MAAM,MAAM,GAAG,CAAC,MAA6B,EAAE,EAAE,CAC/C,MAAM;SACH,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC;SAClC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC5D,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC;AACtD,CAAC;AAED,mDAAmD;AACnD,MAAM,UAAU,aAAa,CAAC,MAAqB;IACjD,OAAO,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,KAAK,aAAa,CAAC;AAC1D,CAAC"}
|
package/dist/legs.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A test longer than one request's time limit runs in legs: each leg
|
|
3
|
+
* answers what it can, then hands the rest to a fresh request. Pure.
|
|
4
|
+
*/
|
|
5
|
+
/** At most this many legs (about half an hour) before a test gives up. */
|
|
6
|
+
export declare const MAX_LEGS = 6;
|
|
7
|
+
/**
|
|
8
|
+
* Whether a leg that ran out of time should hand off: only when it made
|
|
9
|
+
* progress (so a stuck case can't loop) and legs remain.
|
|
10
|
+
*/
|
|
11
|
+
export declare function shouldContinue(opts: {
|
|
12
|
+
/** Answers left for a later leg. */
|
|
13
|
+
left: number;
|
|
14
|
+
/** Answers this leg gave. */
|
|
15
|
+
done: number;
|
|
16
|
+
leg: number;
|
|
17
|
+
outOfCredits: boolean;
|
|
18
|
+
}): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether a test still marked running was stopped by the server: nothing
|
|
21
|
+
* started or answered within `stuckMs`. Legs keep it alive.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isStuck(startedAt: Date, lastAnswerAt: Date | null, now: number, stuckMs: number): boolean;
|
package/dist/legs.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A test longer than one request's time limit runs in legs: each leg
|
|
3
|
+
* answers what it can, then hands the rest to a fresh request. Pure.
|
|
4
|
+
*/
|
|
5
|
+
/** At most this many legs (about half an hour) before a test gives up. */
|
|
6
|
+
export const MAX_LEGS = 6;
|
|
7
|
+
/**
|
|
8
|
+
* Whether a leg that ran out of time should hand off: only when it made
|
|
9
|
+
* progress (so a stuck case can't loop) and legs remain.
|
|
10
|
+
*/
|
|
11
|
+
export function shouldContinue(opts) {
|
|
12
|
+
return (opts.left > 0 && opts.done > 0 && !opts.outOfCredits && opts.leg < MAX_LEGS);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Whether a test still marked running was stopped by the server: nothing
|
|
16
|
+
* started or answered within `stuckMs`. Legs keep it alive.
|
|
17
|
+
*/
|
|
18
|
+
export function isStuck(startedAt, lastAnswerAt, now, stuckMs) {
|
|
19
|
+
const last = Math.max(+startedAt, lastAnswerAt ? +lastAnswerAt : 0);
|
|
20
|
+
return now - last > stuckMs;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=legs.js.map
|
package/dist/legs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legs.js","sourceRoot":"","sources":["../src/legs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAC;AAE1B;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAO9B;IACC,OAAO,CACL,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,IAAI,CAAC,GAAG,GAAG,QAAQ,CAC5E,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,OAAO,CACrB,SAAe,EACf,YAAyB,EACzB,GAAW,EACX,OAAe;IAEf,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,OAAO,GAAG,GAAG,IAAI,GAAG,OAAO,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An in-memory store, for tests, demos, and trying Evalkeeper before adding
|
|
3
|
+
* tables.
|
|
4
|
+
*
|
|
5
|
+
* @module evalkeeper/memory
|
|
6
|
+
*/
|
|
7
|
+
import type { FeedbackRecord, FeedbackStore } from "./feedback.js";
|
|
8
|
+
import { type SettingsChange, type SettingsStore, type SettingsVersion } from "./settings.js";
|
|
9
|
+
import type { CaseRecord, EvalStore, OutputRecord, RunRecord } from "./store.js";
|
|
10
|
+
/**
|
|
11
|
+
* An EvalStore in memory: for tests, demos, and trying Evalkeeper before
|
|
12
|
+
* adding tables. Everything is gone when the process ends.
|
|
13
|
+
*/
|
|
14
|
+
export declare function memoryStore(): EvalStore & FeedbackStore & SettingsStore & {
|
|
15
|
+
cases: CaseRecord[];
|
|
16
|
+
runs: RunRecord[];
|
|
17
|
+
outputs: OutputRecord[];
|
|
18
|
+
feedback: FeedbackRecord[];
|
|
19
|
+
versions: SettingsVersion[];
|
|
20
|
+
changes: SettingsChange[];
|
|
21
|
+
};
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { cleanRating } from "./feedback.js";
|
|
2
|
+
import { SettingsConflict, } from "./settings.js";
|
|
3
|
+
/**
|
|
4
|
+
* An EvalStore in memory: for tests, demos, and trying Evalkeeper before
|
|
5
|
+
* adding tables. Everything is gone when the process ends.
|
|
6
|
+
*/
|
|
7
|
+
export function memoryStore() {
|
|
8
|
+
const cases = [];
|
|
9
|
+
const runs = [];
|
|
10
|
+
const outputs = [];
|
|
11
|
+
const feedback = [];
|
|
12
|
+
const versions = [];
|
|
13
|
+
const changes = [];
|
|
14
|
+
const live = new Map();
|
|
15
|
+
let n = 0;
|
|
16
|
+
const id = (prefix) => `${prefix}_${(++n).toString(36)}`;
|
|
17
|
+
const now = () => new Date();
|
|
18
|
+
return {
|
|
19
|
+
cases,
|
|
20
|
+
runs,
|
|
21
|
+
outputs,
|
|
22
|
+
feedback,
|
|
23
|
+
versions,
|
|
24
|
+
changes,
|
|
25
|
+
async liveVersion(operation) {
|
|
26
|
+
const id = live.get(operation);
|
|
27
|
+
return versions.find((v) => v.id === id) ?? null;
|
|
28
|
+
},
|
|
29
|
+
async listVersions(operation) {
|
|
30
|
+
return versions
|
|
31
|
+
.filter((v) => v.operation === operation)
|
|
32
|
+
.sort((a, b) => b.number - a.number);
|
|
33
|
+
},
|
|
34
|
+
async listChanges(operation, opts = {}) {
|
|
35
|
+
// Kept in the order they happened, so newest first is the reverse.
|
|
36
|
+
return changes
|
|
37
|
+
.filter((c) => c.operation === operation)
|
|
38
|
+
.reverse()
|
|
39
|
+
.slice(0, opts.limit ?? Infinity);
|
|
40
|
+
},
|
|
41
|
+
async switchTo(operation, sw) {
|
|
42
|
+
// Synchronous from here on, so it's atomic in memory.
|
|
43
|
+
const fromId = live.get(operation) ?? null;
|
|
44
|
+
if (fromId !== sw.expectLive)
|
|
45
|
+
throw new SettingsConflict(operation);
|
|
46
|
+
let to;
|
|
47
|
+
if (sw.create) {
|
|
48
|
+
const last = versions
|
|
49
|
+
.filter((v) => v.operation === operation)
|
|
50
|
+
.reduce((n, v) => Math.max(n, v.number), 0);
|
|
51
|
+
to = {
|
|
52
|
+
...sw.create.settings,
|
|
53
|
+
id: id("ver"),
|
|
54
|
+
operation,
|
|
55
|
+
number: last + 1,
|
|
56
|
+
promptVersion: sw.create.promptVersion,
|
|
57
|
+
createdAt: now(),
|
|
58
|
+
};
|
|
59
|
+
versions.push(to);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
to = versions.find((v) => v.id === sw.versionId && v.operation === operation);
|
|
63
|
+
if (!to)
|
|
64
|
+
throw new Error("No such version for this feature");
|
|
65
|
+
}
|
|
66
|
+
live.set(operation, to.id);
|
|
67
|
+
changes.push({
|
|
68
|
+
id: id("chg"),
|
|
69
|
+
operation,
|
|
70
|
+
kind: sw.kind,
|
|
71
|
+
fromVersionId: fromId,
|
|
72
|
+
toVersionId: to.id,
|
|
73
|
+
reason: sw.reason,
|
|
74
|
+
by: sw.by,
|
|
75
|
+
evidence: sw.evidence ?? null,
|
|
76
|
+
createdAt: now(),
|
|
77
|
+
});
|
|
78
|
+
return to;
|
|
79
|
+
},
|
|
80
|
+
async rate(r) {
|
|
81
|
+
const c = cleanRating(r);
|
|
82
|
+
const at = now();
|
|
83
|
+
const prior = feedback.find((f) => f.raterId === c.raterId &&
|
|
84
|
+
f.operation === c.operation &&
|
|
85
|
+
f.targetId === c.targetId);
|
|
86
|
+
if (prior) {
|
|
87
|
+
// A changed rating needs a fresh look.
|
|
88
|
+
if (prior.rating !== c.rating) {
|
|
89
|
+
prior.status = "OPEN";
|
|
90
|
+
prior.caseId = null;
|
|
91
|
+
}
|
|
92
|
+
Object.assign(prior, c, { updatedAt: at });
|
|
93
|
+
return prior;
|
|
94
|
+
}
|
|
95
|
+
const f = {
|
|
96
|
+
...c,
|
|
97
|
+
id: id("fb"),
|
|
98
|
+
status: "OPEN",
|
|
99
|
+
caseId: null,
|
|
100
|
+
createdAt: at,
|
|
101
|
+
updatedAt: at,
|
|
102
|
+
};
|
|
103
|
+
feedback.push(f);
|
|
104
|
+
return f;
|
|
105
|
+
},
|
|
106
|
+
async clearRating(raterId, operation, targetId) {
|
|
107
|
+
const i = feedback.findIndex((f) => f.raterId === raterId &&
|
|
108
|
+
f.operation === operation &&
|
|
109
|
+
f.targetId === targetId);
|
|
110
|
+
if (i >= 0)
|
|
111
|
+
feedback.splice(i, 1);
|
|
112
|
+
},
|
|
113
|
+
async listFeedback(opts = {}) {
|
|
114
|
+
return feedback
|
|
115
|
+
.filter((f) => (!opts.operation || f.operation === opts.operation) &&
|
|
116
|
+
(!opts.rating || f.rating === opts.rating) &&
|
|
117
|
+
(!opts.status || f.status === opts.status) &&
|
|
118
|
+
(!opts.since || f.updatedAt >= opts.since))
|
|
119
|
+
.sort((a, b) => +b.updatedAt - +a.updatedAt)
|
|
120
|
+
.slice(0, opts.limit ?? Infinity);
|
|
121
|
+
},
|
|
122
|
+
async setFeedbackStatus(feedbackId, status, caseId = null) {
|
|
123
|
+
const f = feedback.find((x) => x.id === feedbackId);
|
|
124
|
+
if (f) {
|
|
125
|
+
f.status = status;
|
|
126
|
+
f.caseId = caseId;
|
|
127
|
+
f.updatedAt = now();
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
async listCases(suite) {
|
|
131
|
+
return cases
|
|
132
|
+
.filter((c) => c.suite === suite && c.status !== "RETIRED")
|
|
133
|
+
.sort((a, b) => +a.createdAt - +b.createdAt);
|
|
134
|
+
},
|
|
135
|
+
async createCase({ labels = [], ...data }) {
|
|
136
|
+
const at = now();
|
|
137
|
+
const c = {
|
|
138
|
+
...data,
|
|
139
|
+
id: id("case"),
|
|
140
|
+
createdAt: at,
|
|
141
|
+
updatedAt: at,
|
|
142
|
+
labels: labels.map((l) => ({
|
|
143
|
+
...l,
|
|
144
|
+
id: id("label"),
|
|
145
|
+
createdAt: at,
|
|
146
|
+
updatedAt: at,
|
|
147
|
+
})),
|
|
148
|
+
};
|
|
149
|
+
cases.push(c);
|
|
150
|
+
return c;
|
|
151
|
+
},
|
|
152
|
+
async addLabel(caseId, data) {
|
|
153
|
+
const c = cases.find((x) => x.id === caseId);
|
|
154
|
+
if (!c)
|
|
155
|
+
throw new Error(`Unknown case ${caseId}`);
|
|
156
|
+
const at = now();
|
|
157
|
+
const l = { ...data, id: id("label"), createdAt: at, updatedAt: at };
|
|
158
|
+
c.labels.push(l);
|
|
159
|
+
c.updatedAt = at;
|
|
160
|
+
return l;
|
|
161
|
+
},
|
|
162
|
+
async setLabelStatus(labelId, status) {
|
|
163
|
+
for (const c of cases)
|
|
164
|
+
for (const l of c.labels)
|
|
165
|
+
if (l.id === labelId) {
|
|
166
|
+
l.status = status;
|
|
167
|
+
l.updatedAt = now();
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
async setCaseStatus(caseId, status) {
|
|
171
|
+
const c = cases.find((x) => x.id === caseId);
|
|
172
|
+
if (c) {
|
|
173
|
+
c.status = status;
|
|
174
|
+
c.updatedAt = now();
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
async getRun(runId) {
|
|
178
|
+
return runs.find((r) => r.id === runId) ?? null;
|
|
179
|
+
},
|
|
180
|
+
async listRuns(suite, opts = {}) {
|
|
181
|
+
return runs
|
|
182
|
+
.filter((r) => r.suite === suite && (!opts.status || r.status === opts.status))
|
|
183
|
+
.sort((a, b) => +b.startedAt - +a.startedAt)
|
|
184
|
+
.slice(0, opts.limit ?? Infinity);
|
|
185
|
+
},
|
|
186
|
+
async createRun(data) {
|
|
187
|
+
const r = {
|
|
188
|
+
...data,
|
|
189
|
+
id: id("run"),
|
|
190
|
+
status: "RUNNING",
|
|
191
|
+
metrics: null,
|
|
192
|
+
error: null,
|
|
193
|
+
startedAt: now(),
|
|
194
|
+
finishedAt: null,
|
|
195
|
+
};
|
|
196
|
+
runs.push(r);
|
|
197
|
+
return r;
|
|
198
|
+
},
|
|
199
|
+
async updateRun(runId, patch, onlyIf) {
|
|
200
|
+
const r = runs.find((x) => x.id === runId);
|
|
201
|
+
if (!r || (onlyIf && r.status !== onlyIf.status))
|
|
202
|
+
return;
|
|
203
|
+
Object.assign(r, patch);
|
|
204
|
+
},
|
|
205
|
+
async listOutputs(runId) {
|
|
206
|
+
return outputs.filter((o) => o.runId === runId);
|
|
207
|
+
},
|
|
208
|
+
async findReusableOutput(requestHash, since) {
|
|
209
|
+
return (outputs
|
|
210
|
+
.filter((o) => o.requestHash === requestHash &&
|
|
211
|
+
!o.reused &&
|
|
212
|
+
!o.error &&
|
|
213
|
+
o.createdAt >= since)
|
|
214
|
+
.sort((a, b) => +b.createdAt - +a.createdAt)[0] ?? null);
|
|
215
|
+
},
|
|
216
|
+
async createOutput(data) {
|
|
217
|
+
const o = { ...data, id: id("out"), createdAt: now() };
|
|
218
|
+
outputs.push(o);
|
|
219
|
+
return o;
|
|
220
|
+
},
|
|
221
|
+
async setOutputScores(outputId, scores) {
|
|
222
|
+
const o = outputs.find((x) => x.id === outputId);
|
|
223
|
+
if (o)
|
|
224
|
+
o.scores = scores;
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=memoryStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+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AAC;QACD,KAAK,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM;YACpC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC;YACjD,IAAI,CAAC;gBAAE,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC;QAC3B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/models.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What Evalkeeper needs to know about the models your app can use. You
|
|
3
|
+
* pass a catalog in; Evalkeeper never picks a provider itself. Pure.
|
|
4
|
+
*/
|
|
5
|
+
/** How hard a reasoning model thinks, where the model takes a setting. */
|
|
6
|
+
export declare const REASONING_EFFORTS: readonly ["none", "low", "medium", "high"];
|
|
7
|
+
/** A reasoning setting a model may accept. */
|
|
8
|
+
export type ReasoningEffort = (typeof REASONING_EFFORTS)[number];
|
|
9
|
+
/**
|
|
10
|
+
* What Evalkeeper needs to know about one model: its label, provider, prices, reasoning
|
|
11
|
+
* settings, and retirement date.
|
|
12
|
+
*/
|
|
13
|
+
export type ModelInfo = {
|
|
14
|
+
label: string;
|
|
15
|
+
/** Who serves it ("anthropic", "openai", …): the fallback must differ. */
|
|
16
|
+
provider: string;
|
|
17
|
+
/** USD per 1M tokens, for estimates and the cost of each answer. */
|
|
18
|
+
inputPer1M?: number;
|
|
19
|
+
outputPer1M?: number;
|
|
20
|
+
/**
|
|
21
|
+
* USD per 1M input tokens read from the provider's prompt cache. Unset:
|
|
22
|
+
* cached input costs `inputPer1M`, which overstates rather than flatters.
|
|
23
|
+
*/
|
|
24
|
+
cachedInputPer1M?: number;
|
|
25
|
+
/**
|
|
26
|
+
* USD per 1M input tokens written to the prompt cache (Anthropic bills
|
|
27
|
+
* these above the input price). Unset: they cost `inputPer1M`.
|
|
28
|
+
*/
|
|
29
|
+
cacheWriteInputPer1M?: number;
|
|
30
|
+
/** Reasoning efforts it accepts, lowest first. */
|
|
31
|
+
efforts?: ReasoningEffort[];
|
|
32
|
+
/**
|
|
33
|
+
* When the provider retires it, as "YYYY-MM" or "YYYY-MM-DD". A retiring
|
|
34
|
+
* model is never suggested, and a retiring live model gets replaced.
|
|
35
|
+
*/
|
|
36
|
+
retiring?: string;
|
|
37
|
+
/** Where the price came from, so it can be checked. */
|
|
38
|
+
source?: string;
|
|
39
|
+
/**
|
|
40
|
+
* As a decision model: "native" probabilities come from the model itself
|
|
41
|
+
* (a full distribution for choices and scales); "prompted" ones are the
|
|
42
|
+
* model's own estimate written out, with no distribution for choices.
|
|
43
|
+
*/
|
|
44
|
+
decisions?: "native" | "prompted";
|
|
45
|
+
/**
|
|
46
|
+
* Code your app runs instead of a model (a matcher, a rules engine) or
|
|
47
|
+
* alongside it, tested so the board shows whether a model beats it. A
|
|
48
|
+
* baseline is compared like any model but never suggested as live or as
|
|
49
|
+
* the fallback. Give it a label that says what it is.
|
|
50
|
+
*/
|
|
51
|
+
baseline?: boolean;
|
|
52
|
+
};
|
|
53
|
+
/** Your app's models, by id. */
|
|
54
|
+
export type ModelCatalog = Record<string, ModelInfo>;
|
|
55
|
+
/** Whether a catalog entry is a baseline (code, not a model): never suggested. */
|
|
56
|
+
export declare function isBaseline(models: ModelCatalog, model: string): boolean;
|
|
57
|
+
/** "January 2027" for a retiring model; null when it isn't retiring. */
|
|
58
|
+
export declare function retiresLabel(models: ModelCatalog, model: string): string | null;
|
|
59
|
+
/**
|
|
60
|
+
* The cost of a call from its token counts; null when the price is unknown.
|
|
61
|
+
* `cachedInput` and `cacheWriteInput` are the parts of `input` read from
|
|
62
|
+
* and written to the provider's prompt cache, priced at the model's cache
|
|
63
|
+
* prices when it has them.
|
|
64
|
+
*/
|
|
65
|
+
export declare function priceCall(models: ModelCatalog, model: string, tokens: {
|
|
66
|
+
input: number;
|
|
67
|
+
output: number;
|
|
68
|
+
cachedInput?: number;
|
|
69
|
+
cacheWriteInput?: number;
|
|
70
|
+
}): number | null;
|
|
71
|
+
/**
|
|
72
|
+
* The effort a model actually gets for a requested one: the same if it
|
|
73
|
+
* takes it; for "none" on a model without it, its lowest; otherwise its own
|
|
74
|
+
* default. Undefined: send nothing.
|
|
75
|
+
*/
|
|
76
|
+
export declare function effortFor(models: ModelCatalog, model: string, requested: ReasoningEffort | null | undefined): ReasoningEffort | undefined;
|