TOOL WIKI · EVALUATION & TESTING
promptfoo
Runs configurable evaluations and adversarial tests for model applications.
Jump to a section 10 sections
EXAMPLE USE CASE
Compare known and missing order responses in a test matrix
A developer needs repeatable cases and explicit grading before changing a prompt, model or agent implementation.
- Input
- A custom local provider and two YAML exact-match fixtures.
- Expected output
- Two assertion results from promptfoo eval.
- Success check: Both exact-match fixtures pass with no model API call.
- Try a failure: Make the provider return packed for every order; the missing-order test must fail.
Example scope: Actual evaluation framework without model calls; replace the provider adapter to evaluate your application.
Official reference · promptfoo
Keep fixtures and expected outcomes separate from candidate inputs.
executeTo 02 · Candidate systemRecord code, prompts, model settings, and tool schemas for this run.
observationsTo 03 · promptfooComparing prompts and agent configurations on a repeatable dataset. Keep test fixtures and judge configuration versioned with the candidate.
resultsTo 04 · Failure examplesInspect the failing task and trace rather than relying only on an aggregate score.
reviewTo 05 · Release gateBlock a release on critical permission failures and unacceptable task regression.
Result or stopping pointConvert confirmed production failures into reviewed, versioned fixtures.
Comparing prompts and agent configurations on a repeatable dataset. Keep test fixtures and judge configuration versioned with the candidate.
When to consider it
- Comparing prompts and agent configurations on a repeatable dataset.
A design decision to make
- Keep test fixtures and judge configuration versioned with the candidate.
Prerequisites and setup
- Node.js 22+. The custom local provider isolates evaluation mechanics before connecting a model.
npm init -y
npm install --save-dev promptfooTry a small integration
provider.cjs
module.exports = class OrderFixture {
id() { return 'order-fixture'; }
async callApi(prompt) {
const order = prompt.trim();
return {output:order==='A104'?'packed':'not_found'};
}
};promptfooconfig.yaml
prompts: ['{{order}}']
providers: [file://provider.cjs]
tests:
- vars: {order: A104}
assert: [{type: equals, value: packed}]
- vars: {order: A999}
assert: [{type: equals, value: not_found}]Run and check the result
npx promptfoo eval --config promptfooconfig.yaml --no-cache- Both exact-match fixtures pass with no model API call.
- Change the provider to return packed for every order: the unknown-order case must fail.
Common failures
- A passing score on one fixture is not evidence of general reliability; include missing-data, permission and adversarial cases.
- A judge timeout or parser error must be reported separately from a low-quality answer.
Production decisions
- Version the dataset, prompt, model, tool schema and scorer together; keep a held-out set separate from tuning examples.
- Gate releases on critical failures as well as aggregate quality, latency and cost. Review false positives and grader disagreement.
Keep exploring
Explore the same layer
Compare candidates on your own workload. This entry describes a product’s role; it is not a claim that products in the category are interchangeable.