Promptfoopromptfoo 0.123.0 · Node 22.22+ · Python 3
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
25 small wins to finish your pathNext lesson

Two prompts side by side

Providers are not the only thing there can be two of. The prompt is usually the thing you are really testing, and it is the cheapest thing to change.

prompts is a list, and promptfoo runs every prompt against every provider against every test.

yaml
providers:
  - file://support_bot.py
prompts:
  - "{{question}}"
  - "Answer briefly. {{question}}"
tests:
  - vars:
      question: Where is order A17?
    assert:
      - type: contains
        value: 3 March
Example
promptfoo eval

One test, two prompts, two columns. The bot ignores the instruction because it is a dictionary lookup, so both answers are the same; with a real model behind it the second column is where you would see the wording take effect.

The grid

It is worth knowing exactly how many runs a config asks for, because it grows faster than it looks.

ProvidersPromptsTestsRuns
1133
2136
22312
2240160

Every one of those is a call. On a real provider the last row is a coffee break and a bill, which is the practical reason to keep one variable moving at a time.

Prompts per provider

Sometimes a prompt only makes sense for one provider, because the models take different formats. A prompt can name the providers it belongs to. The provider named below is a real model rather than a file, which is what lesson 21 swaps in.

yaml
prompts:
  - id: file://chat_prompt.json
    label: chat
    providers:
      - openai:gpt-5
Change one thing per run. Two prompts and two providers in the same run gives you four columns and no way to say which difference caused what. Run the prompt comparison on one provider, pick a winner, then compare providers on the winning prompt.
Try it yourself
  • Add a third prompt that asks for a one word answer and count the columns.
  • Move the second prompt into its own .txt file and reference it with file://.
  • Work out how many runs two providers, three prompts and the three-row CSV would make.

You understood something today that you didn't yesterday.