pi-mono/packages/evals
2026-07-27 17:40:14 +03:00
..
scripts feat(coding-agent): add vitest eval harness (#7085) 2026-07-25 08:22:32 +02:00
src fix(coding-agent): project typed eval outputs 2026-07-27 17:40:14 +03:00
package.json fix(coding-agent): simplify eval normalization 2026-07-25 23:47:07 +03:00
README.md fix(coding-agent): project typed eval outputs 2026-07-27 17:40:14 +03:00
tsconfig.json feat(coding-agent): add vitest eval harness (#7085) 2026-07-25 08:22:32 +02:00
vitest.config.ts fix: drop harness-pi-ai and its legacy registry aliases from evals 2026-07-25 14:36:32 +02:00

Pi evals

Behavioral evaluations for Pi using vitest-evals.

src/pi-harness.ts adapts Pi's AgentSession directly to vitest-evals. Each run uses isolated temporary project and agent directories that are removed afterward. Judge harnesses are configured separately from the application harness.

Eval cases supply either one prompt or a JSON-safe sequence of prompt and reload steps. The harness executes that input and normalizes the resulting session without defining scenario-specific behavior. Suites can configure a typed output selector over the final response and AgentSession state.

Running

From the repository root, run with an explicit provider and model:

npm run eval -- --provider openai-codex --model gpt-5.4

When invoked from a Pi Bash tool, the current session supplies PI_PROVIDER and PI_MODEL, so this is sufficient:

npm run eval

The runner requires both values and never falls back to another model. Additional arguments are forwarded to Vitest, for example:

npm run eval -- -t "capital of France"

Authentication is resolved by Pi's normal ModelRuntime. Subscription-backed providers such as openai-codex use credentials from the user's Pi configuration. API-backed providers use their standard environment variables, such as OPENAI_API_KEY for openai.