*.eval.ts file — you can write one by hand whenever you want the control, but you never have to start there.
Why run evals through Ori
The hardest part of evals is keeping the test bench stable. Ori is a harness, not just a skill: it pins the model and settings at a level prompts can’t, so a score change means your agent changed, not the environment. And because Ori routes through OpenRouter, a bakeoff can cover every major lab’s models — not just the one vendor your usual harness supports.Before you start
Install the CLI:OPENROUTER_API_KEY directly. Running evals also needs Bun; if it is missing, ori eval offers to install it on an interactive terminal.
Start from a question
From your project directory, start a session and ask:- Scans your repo for test material — existing prompts, tool definitions, data files (
.jsonl,.csv, chat logs), and gold answers. Tests in any language count: pytest files and Go tests get mined for cases, even though the eval itself is always TypeScript. - Asks what matters — a question or two like “accuracy first, or speed and cost?” — only when the answer changes the eval.
- Writes and runs the eval — scaffolds the
*.eval.ts, seeds candidate models from OpenRouter’s live catalog under your price cap, and runs them. - Recommends one model, with the scores, latency, and cost that back it up.
Under the hood: the eval file
When you want control — or want to understand what the agent built — here is the whole surface. An eval reads like a normalbun test:
recommends.eval.ts
setupAgent() with no arguments is your workspace’s own resolved harness and model — the same agent you already run. Then:
*.eval.ts in the directory, boots an ephemeral runtime, and hands the files to bun test. The exit code mirrors bun test, so a failing eval fails CI.
Compare models
Seed candidates from OpenRouter’s live catalog instead of hand-listing slugs, cap the price, and run the same eval against each:model.eval.ts
Grade open-ended answers
When there is no single right string, grade with an LLM judge. The judge defaults to a dedicated agent on a strong grading model, so scoring stays independent of the model under test:quality.eval.ts
Eval against your own data
Real usage data beats synthetic prompts. Loop chat logs or Q&A pairs withtest.each:
Run it in CI
Evals spend model calls, so put them in a credentialed, opt-in job — not your default unit-test run — with the key as a secret. A failing eval fails the build, so a worse agent stops the ship instead of your users.ori eval --list --allow-no-key needs no key and cheaply asserts evals exist.