API Reference
modelGrader
function modelGrader(options): Grader;Defined in: goal/model-grader.ts:67
Build a Grader backed by a model.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | ModelGraderOptions | The grader model and optional prompt override. |
Returns
A Grader suitable for runGoal.
Remarks
The returned grader runs one model call per round: it feeds the goal and the round's latest assistant output to the model and parses the JSON verdict it returns (tolerating markdown fences or surrounding prose). It forwards ctx.signal so a cancelled goal loop also cancels the in-flight grading call.
Throws
Error if the model returns no parseable JSON verdict.
Example
const grader = modelGrader({ model: fastModel });
await runGoal({ goal, grader, base });