Evaluations
Score every model output automatically. Attach evaluators to production traces or run them over a test set — rule-based checks are unlimited on Pro; LLM graders draw from your monthly AI-run pool.
The evaluator library
Seventeen evaluators — plus human labels — grouped by what they do.
Rule-based
— Deterministic, fast, and unlimited on Pro.LLM-as-judge
— A model scores the output. Metered against your monthly AI-run pool.Safety
— Dedicated graders for the risky stuff.Agentic
— Score how an agent got there, not just the final answer.Custom & integration
— When the built-ins are not enough.Custom code evaluator
Write a JavaScript function that scores an output. It runs in a QuickJS WebAssembly sandbox with no network or filesystem access and a 1-second time limit — so your code is safe to run, and a runaway function can never hang the platform.
// Runs in a secure sandbox — no network, no filesystem, 1s time limit.
({ input, output, expectedOutput, metadata }) => {
const required = ['refund', 'policy']
const text = output.toLowerCase()
const missing = required.filter((w) => !text.includes(w))
return {
score: missing.length === 0 ? 1 : 0, // 0..1
passed: missing.length === 0, // optional (defaults to score >= threshold)
reasoning: missing.length ? 'Missing: ' + missing.join(', ') : 'All terms present',
}
}The contract
{ input, output, expectedOutput, metadata } and returns { score, passed?, reasoning? }. score is clamped to 0–1; if you omit passed it defaults to score ≥ threshold.Add one in the dashboard
Pick “Custom Code”
Start from a template
Test against a sample
Attach & save
Run it from the API
curl -X POST https://enprompta.com/api/dashboard/evaluators/run \
-H "Content-Type: application/json" \
-d '{
"type": "CUSTOM",
"input": { "output": "Our refund policy allows 30 days." },
"config": { "evaluatorFunction": "({ output }) => ({ score: output.includes(\"refund\") ? 1 : 0 })" }
}'Is your grader as good as your reviewers?
Label some traces by hand, then measure how well an AI grader agrees with your reviewers — agreement, Cohen’s κ, precision/recall on the fail class, and inter-annotator agreement (the ceiling a judge can reach). When it’s off, the Optimize step rewrites the grader’s criteria and proves the gain on a held-out split.
Open judge alignment