Choosing promptfoo assertions: deterministic or model-graded
When an objective check such as equals, regex, is-json or a JavaScript function is enough, when a model grader is needed, and how mixing both keeps evals cheap and stable.

Building promptfoo eval suites that catch quality regressions in LLM applications: choosing assertions, LLM-as-a-judge grading, RAG and structured output checks, and comparing models on your own data.
When an objective check such as equals, regex, is-json or a JavaScript function is enough, when a model grader is needed, and how mixing both keeps evals cheap and stable.
Designing judge prompts and rubrics in promptfoo: picking a judge model separate from the target, multi-judge voting, checking judges for bias and defending judges against prompt injection in outputs.
Writing natural-language rubrics that reject wrong answers, inlining the source material the grader needs, setting thresholds and avoiding rubrics that pass anything well formatted.
Scoring outputs against custom criteria with promptfoo g-eval: writing criteria, chain-of-thought grading, thresholds and when G-Eval beats a plain rubric.
Comparing outputs to reference answers with the factuality assertion: how its grading categories work, building reference sets and handling answers that are correct but phrased differently.
Measuring retrieval and answer quality separately with context-relevance, context-recall and context-faithfulness, plus end-to-end factuality, and wiring retrieved context into tests.
Validating structured LLM output with is-json and contains-json schema checks, field-level JavaScript assertions and function-call validation against tool schemas.
Running one promptfoo suite across several hosted models to compare quality, cost and latency for a specific task, and avoiding unfair comparisons from prompts tuned for one model.
Testing DeepSeek, Mistral, Qwen and Llama on your own tasks with promptfoo before committing to self-hosting one, including local runs through Ollama or vLLM.
Building tests that expose fabricated answers: reference-based factuality, context faithfulness for RAG, the hallucination red team plugin, and tracking the rate over releases.
Testing natural-language-to-SQL features with promptfoo: schema-aware test cases, checking generated queries, comparing models and catching unsafe statements.
Testing chatbots across a conversation instead of single prompts: chat message formats, conversation history, conversation-relevance scoring and stateful targets.
Using promptfoo optimize to improve one prompt against one provider: candidate search, validation splits, choosing the target metric and reviewing results before adopting a new prompt.
Adding Hugging Face classifiers and moderation APIs to promptfoo tests for toxicity, bias and PII in outputs, and when a classifier is cheaper than a model grader.
Running generated code inside isolated Docker containers during promptfoo evals so tests can check that it works without executing it on the CI host.
Grading what an agent did, not only what it said: sending OpenTelemetry spans to promptfoo, trace assertions on tool calls and order, and giving graders the trace as context.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.