Gate CI on LLM evals with promptfoo

domain: promptfoo.dev · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install promptfoo: npm install -g promptfoo or npx promptfoo@latest
  2. Create a promptfooconfig.yaml file defining providers (LLM endpoints), prompts, and test cases with assert blocks specifying expected behavior (e.g., type: contains, value: 'expected phrase')
  3. Run evals locally to verify configuration: npx promptfoo eval — results are shown in the terminal and saved to output files
  4. Add a CI step to your pipeline (GitHub Actions, GitLab CI, etc.) that runs npx promptfoo eval --output results.json --output-format json
  5. Fail the CI job based on results: use npx promptfoo eval --pass-rate-threshold 0.9 to fail if fewer than 90% of test cases pass, or parse results.json with a script checking the passRate field
  6. Optionally run npx promptfoo view to open an HTML report of results, or push results to a shared promptfoo cloud account for team review

Known gotchas

Related routes

Gate CI pipeline deployments on LLM eval pass rates using promptfoo
www.promptfoo.dev · 6 steps · unrated
Build a promptfoo eval config that tests prompts across multiple providers with assertions, then run and review results
promptfoo.dev · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans