Scripts2026年4月1日·1 分钟阅读

Promptfoo — Test & Red-Team LLM Apps

Promptfoo is a CLI for evaluating prompts, comparing models, and red-teaming AI apps. 18.9K+ GitHub stars. Side-by-side comparison, vulnerability scanning, CI/CD. MIT.

TO
TokRepo精选 · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

# Install
npm install -g promptfoo
# or: brew install promptfoo / pip install promptfoo

# Initialize evaluation config
promptfoo init

# Run evaluation
promptfoo eval

# View results in browser
promptfoo view

# Red-team scan for vulnerabilities
promptfoo redteam init
promptfoo redteam run

介绍

Promptfoo is a CLI and library for evaluating and red-teaming LLM applications. With 18,900+ GitHub stars and MIT license, it enables testing prompts across multiple LLM providers, side-by-side model comparison (OpenAI, Claude, Gemini, Llama), automated red teaming and vulnerability scanning, CI/CD integration for continuous testing, and privacy-first local execution where prompts never leave your machine. Results are viewable in a web-based UI or command line.

Best for: Teams shipping AI products who need systematic prompt testing and security scanning Works with: Claude Code, OpenAI Codex, Cursor, Gemini CLI, Windsurf Providers: OpenAI, Claude, Gemini, Llama, Mistral, and 50+ more


Key Features

  • Prompt evaluation: Test prompts against assertions and expected outputs
  • Model comparison: Side-by-side across 50+ LLM providers
  • Red teaming: Automated vulnerability scanning for AI apps
  • CI/CD integration: Run evaluations in your deployment pipeline
  • Privacy-first: All prompts stay on your machine
  • Web UI: Visual results viewer and comparison dashboard
  • Code scanning: Detect prompt injection and security issues

FAQ

Q: What is Promptfoo? A: Promptfoo is an LLM evaluation and red-teaming CLI with 18.9K+ stars. Test prompts, compare models, scan for vulnerabilities. Local execution, CI/CD ready. MIT.

Q: How do I install Promptfoo? A: npm install -g promptfoo or brew install promptfoo. Then promptfoo init and promptfoo eval.


🙏

来源与感谢

Created by Promptfoo. Licensed under MIT. promptfoo/promptfoo — 18,900+ GitHub stars

相关资产