Skip to main content

Promptfoo

Open-source LLM testing and red-teaming — test prompts, evaluate outputs, catch regressions

Evals & ObservabilityFree

Promptfoo is an open-source CLI and library for testing, evaluating, and red-teaming LLM applications. Write test cases in YAML or JavaScript, run them against multiple models (GPT, Claude, Llama) simultaneously, and compare results in a local web UI. Supports automated red-teaming to find jailbreaks, prompt injections, and safety failures. 4,000+ GitHub stars.

Key specs
27,082 GitHub stars source
as of 2026-11-12

Maker of Promptfoo? Get your db.fyi badge

What we know

LicenseMITsource, checked 2026-11-12
Open sourceYessource, checked 2026-11-12
PricingFreefrom our original listing, not yet re-checked
GitHub stars27,099source, checked 2026-11-12

Why it matters

  • Open-source and self-hosted means no data privacy concerns — test cases and outputs never leave your infrastructure.
  • CLI-first design integrates natively with CI/CD pipelines — run promptfoo eval as a GitHub Actions step on every PR.
  • Multi-model evaluation catches provider-specific quality regressions before deployment — test GPT and Claude simultaneously.
  • Automated red-teaming finds safety issues proactively rather than waiting for users to discover them in production.

Key capabilities

  • Multi-model evaluation: Run the same test suite against GPT, Claude, Llama, Gemini, and more simultaneously.
  • YAML test definition: Define inputs, expected outputs, and grading criteria in readable YAML or JavaScript.
  • Automated red-teaming: Generate hundreds of adversarial prompts targeting jailbreaks, injections, and safety failures.
  • Grading: LLM-as-judge scoring, regex matching, semantic similarity, and custom JavaScript graders.
  • Web UI: Local browser-based comparison table showing all model responses side by side.
  • CI/CD integration: promptfoo eval CLI command with JSON output for automated pipelines.
  • Prompt caching: Cache LLM responses during development to save API costs on repeated test runs.
  • Provider support: OpenAI, Anthropic, Cohere, Mistral, Hugging Face, AWS Bedrock, Vertex AI, Ollama, and more.

Technical notes

  • License: MIT (open source)
  • GitHub: github.com/promptfoo/promptfoo
  • Install: npm install -g promptfoo or npx promptfoo@latest
  • Languages: TypeScript/JavaScript (core); YAML (test definitions); Python via API
  • Providers: OpenAI, Anthropic, Cohere, Mistral, HuggingFace, Bedrock, Vertex, Ollama, local models
  • CI: GitHub Actions, GitLab CI, Jenkins integration
  • Pricing: Free (self-hosted); Cloud tier for teams (paid)

Ideal for

  • AI engineers who want CI/CD integration for LLM quality — automated eval on every PR that touches prompts.
  • Security teams who need to red-team LLM applications for safety issues before deployment.
  • Organizations evaluating which LLM provider gives the best quality/cost ratio for a specific use case.

Not ideal for

  • Teams who need a polished cloud UI with team collaboration and production monitoring — Braintrust is better.
  • Non-technical stakeholders who need to run evaluations without a CLI — Braintrust or LangSmith have better UIs.
  • RAG-specific evaluation metrics (faithfulness, recall, precision) — RAGAS has specialized metrics for retrieval.

See also

  • Braintrust — Cloud-based enterprise eval platform with stronger team collaboration.
  • RAGAS — RAG evaluation focused on retrieval quality metrics (faithfulness, recall).
  • TruLens — Alternative open-source eval library; stronger for LangChain/LlamaIndex pipelines.

FAQ

What is Promptfoo?

Promptfoo is an open-source tool for evaluating LLM prompts and outputs. You define test cases (inputs + expected outputs or grading criteria) in YAML files, and Promptfoo runs them against one or many LLM providers simultaneously, scoring results and displaying them in a side-by-side comparison table. It also includes automated red-teaming to probe for safety issues, hallucinations, and prompt injections.

Is Promptfoo free?

Promptfoo is completely free and open source (MIT license). You run it locally — no data leaves your machine except to the LLM APIs you configure. There's a hosted cloud option for teams who want shared dashboards and collaboration, but the core evaluation tool is free. GitHub: github.com/promptfoo/promptfoo.

How does Promptfoo's red-teaming work?

Promptfoo's automated red-teaming generates adversarial test cases targeting specific vulnerability categories: jailbreaks, prompt injection attacks, PII disclosure, off-topic responses, harmful content, hallucination, and more. It uses a separate LLM to generate adversarial prompts and then scores whether your application handles them appropriately. It can generate hundreds of red-team attacks and give you a safety score.

How does Promptfoo compare to Braintrust?

Both evaluate LLM outputs, but different approaches. Promptfoo is open-source, CLI-first, and developer-oriented — you define tests in YAML/JS and run them locally. Braintrust is a cloud platform with a polished UI, team collaboration, and production monitoring. Promptfoo is better for CI/CD integration and open-source projects; Braintrust for enterprise teams who need collaboration and logging.

Alternatives

Integrations

None listed.

Built on

None listed.

Good for these tasks

Listed 2026-02-28 · updated 2026-11-12