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

What you are going to build

Promptfoo is a command that runs your prompts and your application against a list of questions, checks every answer, and tells you which ones broke. This course builds one suite for one support bot, from a single question to a run that fails a build. Every lesson runs on your machine with no API key.

You already test the rest of your code. An answer from a model is harder: it is a paragraph, not a number, and it changes when you touch the prompt. Promptfoo's answer is a file that lists the questions, the thing that answers them, and what counts as a good answer. Running it is one command.

The finished suite

Example
promptfoo eval

Three questions, three answers, three checks, and a line saying how many passed. That is the whole idea of the tool, and the rest of the course is about what you put in that file.

The bot being tested here is an ordinary Python file that you write in lesson 5. Nothing in this run reached the internet, which is the second thing this course is about.

No API key, anywhere

Every other promptfoo tutorial starts by asking for an OPENAI_API_KEY. That is a reasonable thing to need eventually, and a bad thing to need in lesson one. So this course uses providers that run on your machine: a built in one called echo, and Python files you write yourself. The last part shows the one line that swaps in a real model.

Some checks in promptfoo ask a model to judge an answer. Those need a key too, so in lesson 13 you write the judge: a Python file that promptfoo talks to exactly as it would talk to a model, which decides by comparing words instead of by thinking. It is about sixty lines by the end of that lesson, and it grows twice more as new kinds of check arrive.

What you will have built

PieceWhat it doesLesson
promptfooconfig.yamlThe file that names the questions, the app and the checks2
A Python providerYour own application, under test5
tests.csvQuestions in a spreadsheet instead of in the config7
Deterministic checkscontains, regex, JSON shape, your own function8 to 10
A stand-in judgeAnswers the graders, with no key13
Named metricsOne score per thing you care about11
A CI gateA build that fails when the pass rate drops20
The suiteAll of it, over a bot that answers from documents24
Where the course goes
The config fileChecksComparingShippingpromptfoo

What you need

  • Node.js 22.22 or newer. Node 24 is what the promptfoo docs recommend.
  • Python 3, for the provider and the judge you write.
  • A terminal. No account, no key, no card.
Try it yourself
  • Read the table above and pick the row you most want. That is the lesson to look forward to.
  • Open a terminal and run node --version. If it starts with 22.22 or higher you are ready.
Back toAll frameworks

Every expert started right here.