Installation
Install promptfoo using npm, npx, or Homebrew (Mac, Linux):
- npm
- npx
- brew
npm install -g promptfoo
npx promptfoo@latest
brew install promptfoo
note
npm and npx require Node.js 20.20+ or 22.22+.
To use promptfoo as a library in your project, run npm install promptfoo --save.
Verify Installation
To verify that promptfoo is installed correctly, run:
- npm
- npx
- brew
promptfoo --version
npx promptfoo@latest --version
promptfoo --version
This should display the current version number of promptfoo.
Run Promptfoo
After installation, you can start using promptfoo by running:
- npm
- npx
- brew
promptfoo init
npx promptfoo@latest init
promptfoo init
This will guide you through the process of creating a promptfooconfig.yaml file.
For a guide on running your first evaluation, please refer to our Getting Started guide.