████████╗██╗ ██╗██████╗ ██████╗ ██████╗ ███████╗ ██╗ ██╗ █████╗ ██╗
╚══██╔══╝██║ ██║██╔══██╗ ██╔══██╗ ██╔═══██╗██╔════╝ ██║ ██║██╔══██╗ ██║
██║ ██║ ██║██████╔╝ ██████╔╝ ██║ ██║█████╗ ██║ ██║███████║ ██║
██║ ██║ ██║██╔══██╗ ██╔══██╗ ██║ ██║██╔══╝ ╚██╗ ██╔╝██╔══██║ ██║
██║ ╚██████╔╝██║ ██║ ██████╔╝ ╚██████╔╝███████╗ ╚████╔╝ ██║ ██║ ███████╗
╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚═══╝ ╚═╝ ╚═╝ ╚══════╝
Fast, minimalistic, framework-agnostic, LLM as Judge eval framework based on Jev and Jev-like models. Written in TypeScript. Functional programming first.
npm install github:vincentdnl/turboeval import { configureGEval, jevOpenRouter } from "turboeval";
import type { TestCase } from "turboeval";
const gEval = configureGEval({ judge: jevOpenRouter, threshold: 0.7 });
const testCase: TestCase = {
input: "I want a refund for order #4521",
expectedOutput: "The refund for order #4521 was issued.",
actualOutput: "I've issued your refund for order #4521.",
};
const result = await gEval.correctness().measure(testCase);
if (!result.success) {
throw new Error(`Score ${result.score} is below ${result.threshold}`);
}See tests/tool-correctness.test.ts
Create a thin wrapper around the turboeval primitives like in tests/vitest-reporter.ts
Add it to your vitest.config.ts
Setup turboeval with setupTurboEval in tests/setup.ts
At the end of the run you get a line like:
[turboeval] run 78cb9a37 — $0.000018 — 1 judge call — 419 in / 23 out tokens
configureGEval({ judge, threshold })— build the measurements.gEval.correctness()/.clarity()/.toolCorrectness()/.toolClarity()— return aMeasurement.
jevOpenRouter— built-in OpenRouter judge; readsOPENROUTER_API_KEY.createJudgeProvider(provider, options?)— wrap a custom provider as aJudge.
createRunId()— generate a run id.setupTurboEval({ runId?, directory?, getTestInfo? })— register the active run.recordCost(runId, { cost, judge, measurement })— append one cost record.reportCosts(runId)— read the records and summarize a run.summarizeCostsSince(timestamp)— summarize records written after a point in time.formatCostReports(reports)— format summary lines.