feat(evals): run the rubric judge through OpenRouter

AC
8d ago
+137-3

why

--harness mastra already runs on an OpenRouter key alone, because Mastra's model router resolves openrouter/<vendor>/<model> ids. The judge can't. It only reads OpenAI, Anthropic and Google keys, so an OpenRouter-only setup still needs a Google key for the default judge. This lets the judge use the OpenRouter key too.

what changed

  • An openrouter/<vendor>/<model> judge (EVAL_VERIFIER_MODEL or verifier.model in config) runs on the evaluator's OpenAI client pointed at https://openrouter.ai/api/v1, with OPENROUTER_API_KEY. resolveOpenRouterVerifier in verifierModel.ts does the mapping. A missing key throws, as an explicit judge with a missing key already does.
  • evals doctor knows OPENROUTER_API_KEY, for the judge and for harness rows whose model starts with openrouter/. With --probe it validates the key (GET /key) and reports a judge model OpenRouter doesn't serve as retired (GET /models/<id>/endpoints returns 404).
  • README: two sentences on choosing the judge.

The default judge stays google/gemini-3.5-flash. Nothing changes unless a model id starts with openrouter/.

One thing I have not checked: whether a judge reached through OpenRouter grades the same as that model on its vendor's own API. It's the same model id, but a different endpoint.

test plan

  • pnpm check and the evals unit tests (1223 passing)
  • new verifierModel.test.ts, and a doctor test covering an OpenRouter judge with a missing key, a served model, a rejected key and a retired model
  • live evals doctor --harness mastra --probe with EVAL_VERIFIER_MODEL=openrouter/google/gemini-3.5-flash: key found, probe 200. With a made-up model: "model not found"
  • live run of one HardBench task, --harness mastra -m openrouter/openai/gpt-6.1-sol with judge openrouter/google/gemini-3.5-flash and only OpenRouter and Browserbase keys in .env: graded, 0/2 criteria unverifiable
  • the same judge route on an October commit of this repo graded 720 of 724 HardBench runs for us. The other 4 came back as verifier uncertainty results. None failed on transport or auth

🤖 Generated with Claude Code


Summary by cubic

Allows the rubric judge to run through OpenRouter via openrouter/<vendor>/<model> ids, so an OpenRouter-only setup no longer needs a key from the judge's own vendor.

  • The judge runs on the evaluator's OpenAI client pointed at https://openrouter.ai/api/v1 with OPENROUTER_API_KEY; a missing key throws as it already does for an explicit judge.
  • evals doctor now recognizes the key, validates it with --probe, and reports judge models OpenRouter no longer serves as retired.
  • The default judge is unchanged; nothing else changes unless a model id starts with openrouter/.