
promptfoo
CLI and library for testing LLM prompts and red-teaming AI apps, with declarative configs.
- Stars
- 26.7k
- Forks
- 2.6k
- Licence
- MIT
- Language
- TypeScript
- Last update
- 4 days ago
- Type
- Dev tool
What it is
Promptfoo is a command-line tool and library for evaluating LLM-based apps. You write a declarative config listing prompts, models, and test cases, then run it to compare outputs across providers such as OpenAI, Anthropic, and Ollama. It also includes red-teaming features that scan AI apps for security vulnerabilities.
- Run the same prompt against GPT and Claude and view the results in a web viewer
- Add prompt evaluations to a CI/CD pipeline so changes are checked automatically
- Scan an LLM app for vulnerabilities with its red-teaming features and generate a report
- Review pull requests for LLM-related security and compliance issues using its code scanning feature
Great for
- Developers building apps on top of LLM APIs who want repeatable prompt tests
- Teams comparing several models side by side on the same prompts
- People who want to run automated LLM checks in CI/CD pipelines
- Teams looking for a local, command-line way to scan LLM apps for security issues
Not ideal for
- People who want a no-code, point-and-click tool, since the workflow centers on the command line and config files
- Projects that do not call any LLM APIs, because there is nothing for it to evaluate
- Anyone who needs a guaranteed security audit, since the README describes scanning as a tool rather than a complete assurance
How to get it
- 1
Install with a package manager
You'll need: Node.js (npm is used for the install command) · An API key for the LLM provider you want to test
Install globally with npm
npm install -g promptfooCreate a starter example
promptfoo init --example getting-started - 2
Run it
- Set your provider API key, for example export OPENAI_API_KEY=sk-abc123
- Run cd getting-started
- Run promptfoo eval to execute the example
- Run promptfoo view to see the results in a web viewer
- 3
Get the most out of it
- Use the red-teaming guide to scan your LLM app for vulnerabilities
- Connect evals to CI/CD so prompt changes are tested automatically
- Compare multiple providers in one config to see differences side by side
- Use the Node.js package if you want to call promptfoo from code instead of the CLI
- Use the code scanning feature to review pull requests for LLM-related issues
Downloads
Strengths
- The README states that evals run locally and prompts never leave your machine
- Works with many providers and any LLM API, according to the README
- Has a large community with about 26,500 stars and an MIT license
Trade-offs
- The README says the project is now part of OpenAI, which may matter to some users evaluating independence
- Requires API keys for most providers, which means usage costs from those providers
- Some claims in the README, such as usage by OpenAI and Anthropic and serving 10M+ users, are not independently verified here
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| promptfoo (this) | 26.7k | Dev tool | intermediate | 4 days ago | Developers building apps on top of LLM APIs who want repeatable prompt tests |
| Prompt-Engineering-Guide | 79.8k | Learning resource | beginner | 8 months ago | People who are new to prompting and want structured lessons with examples |
| awesome-nanobanana-pro | 10.4k | Curated list | beginner | 4 days ago | People who want ready-made prompts to copy and adapt for image generation |
| composio | 30.9k | Dev tool | intermediate | 4 days ago | Developers building AI agents that need to read or act in third-party apps |
| lm-evaluation-harness | 14.4k | Dev tool | intermediate | 2 months ago | Researchers who need reproducible scores on standard academic benchmarks |
| claude-context | 12.7k | Dev tool | beginner | 4 months ago | Developers working in large codebases where loading everything into an agent's context is impractical |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.