Signal Over Noise

· 5 min read

Promptfoo: The Eval Tool That Treats Prompts Like Code

The pytest of the prompt layer: a CLI, a YAML file, and a CI exit code.

Every team I've talked to in the last six months that's still "evaluating eval platforms" has the same shape of problem. They've been comparing Braintrust and LangSmith and Langfuse for a quarter, their agents are drifting in production while they work on the procurement deck, and the eval suite they keep promising to ship gets pushed to next quarter. Promptfoo is what I tell them to install on the way to that meeting. The whole pitch is a YAML file checked into git and a CLI command in their CI script, and the suite gets gated on every PR by the end of the week.

Installation is thirty seconds. npx promptfoo init drops a promptfooconfig.yaml into your repo with a working example. The config defines three things: the providers you want to test against, the prompts you're evaluating, and the test cases with their assertions. npx promptfoo eval runs the matrix. The output is a table in your terminal showing pass/fail per case, plus a local web UI at localhost:15500 that's a glorified viewer for the JSON results file. Nothing is hosted, nothing requires an account, and the data stays in your repo or on disk where you put it.

The interesting part is what falls out of the config without extra wiring. You can run the same set of test cases against GPT-4o, Claude Sonnet 4.5, and a self-hosted Llama 3.1 model in a single command and get a side-by-side comparison of which model performs best on your actual task. That comparison is the question most teams are answering with vibes. You don't need a vendor relationship or a billing setup to do it. Add a provider to your YAML, re-run the eval, and you have a real number to base a model decision on.

The assertion library is where most of the value lives. Promptfoo ships with around twenty assertion types: exact equality, contains, regex, JSON schema, JavaScript expressions, Python expressions, factuality against a reference, semantic similarity, LLM-as-judge with a custom rubric, latency thresholds, cost ceilings, and tool-call argument inspection. The deterministic ones are fast and free. LLM-graded checks cost real money but score qualitative outputs no regex would catch. The mix is the point. Most of your assertions can be a contains check or a JSON schema, and you reserve the LLM-grader for the cases that actually need it.

The first prompt change I gated through a Promptfoo eval caught a JSON schema regression I would have shipped that afternoon. A refactor had restructured the system prompt, the diff looked benign in review, and the model started returning a flat result where the downstream service expected a nested object. No human reviewer would have caught it on a five-line prompt edit. A schema assertion and a contains check did, before merge. The cost of that single regression catch paid for the entire afternoon of writing the suite, and it was the moment the discipline stopped feeling like overhead.

CI integration is the part where it becomes obvious the tool was designed by people who'd actually shipped this kind of system. The CLI exits non-zero if the pass rate drops below a threshold you set. Wire it into a GitHub Action or your Buildkite pipeline, set the threshold to your current pass rate, and any prompt change that drops the score gets caught before merge. A promptfoo share command uploads results to a hosted viewer if you want a shareable URL for a PR comment, and a --output flag emits JSON or YAML for piping into whatever reporting layer you already have. None of this is groundbreaking. It's the part most eval platforms get wrong by trying to be the reporting layer instead of integrating with the one you already have.

The YAML config is great at twenty test cases and tolerable at two hundred. At a thousand, it's a mess, and you end up breaking the suite across multiple files and hand-rolling a directory layout the tool doesn't have an opinion about. The dataset story is weaker than Braintrust's by design. There's no concept of a curated dataset with version history, ownership, and human annotation workflows attached to it. Your test cases are rows in a YAML file or a CSV, and that's it. If you need a product manager to annotate failure modes or a non-engineer to write test cases through a UI, you're going to outgrow the tool quickly.

The local-first posture has the same shape. Traces and results live in a SQLite file on disk by default, which is great for solo work and rough for team collaboration. The hosted offering exists, and the team has been honest that the product is the open-source CLI while the hosting is a convenience layer. If you want eval results to be a first-class artifact in your team's workflow, with dashboards, alerting, and historical drift tracking, you're either bolting that on top of the JSON output or picking a different tool.

Multi-turn agent evaluation is the part still settling. Promptfoo started as a prompt-eval tool, and the agent-eval support, including conversation flows, tool-call inspection, and trajectory grading, is real but younger than the rest of the surface. It works, with more friction than evaluating a single-shot prompt. If you're testing an agent loop with five tool calls and conditional branches, you can express that, and you'll spend more time writing the test cases than you would in a framework with first-class agent-eval primitives. The gap is closing month over month. The honest framing is that Promptfoo is a prompt-eval tool that grew agent features, not an agent-eval tool built from the ground up.

There's a separate command in the same CLI that almost nobody uses. Run promptfoo redteam and you get a vulnerability-testing harness that auto-generates adversarial prompts targeting common failure modes: prompt injection, jailbreaks, harmful output, PII leakage, hallucination on out-of-scope questions. It's a different mental model from the regression-eval workflow, and the documentation treats it as a sibling product. If you're shipping a customer-facing agent, you want this running on a schedule. Most teams don't know it's free and lives in the same CLI they already installed.

The cost equation is the part that makes the tool hard to argue with. The CLI is free. The dependencies are an npm install. The eval inference cost is whatever your provider charges per call, and most of your assertions don't need an LLM at all. A team that has been deferring eval work because the hosted platforms felt like a procurement decision can run their first eval suite in an afternoon and have it gated on every PR by the end of the week. The hosted platforms have real value for teams at scale. Promptfoo is what gets you to the point where you can tell whether you need them.

Eval tooling is going to end up looking the way test tooling looks. A free, ubiquitous, CI-integrated CLI at the bottom of the stack, with hosted dashboards and dataset platforms layered on top for the teams that need them. Promptfoo is what the bottom of that stack looks like right now. The teams still waiting for the right eval platform to emerge are going to look back in eighteen months and realize the right tool was free and sitting in their package manager the whole time.

Discussion

Leave a comment

We’ll email you a link to confirm. Comments appear after review.

Get the next post by email