Open SourceApache-2.0 License

badgr-eval-check

Assert that AI model output contains what it should, excludes what it shouldn't, and matches the shape you expect — repeatable checks you can run in CI.

How it works

LLM outputs are non-deterministic, so regressions are easy to miss — a model update can silently start refusing questions or dropping required fields. badgr-eval-check lets you write simple assertions against model output and run them on every deploy, like unit tests for your prompts.

1

Pass the model output

Give it the output string to check via --output, whether plain text or a JSON response body.

2

Assert include / exclude / shape

Check required substrings with --must-include, banned phrases with --must-not-include, and required JSON fields (dot-path supported) via the TypeScript API.

3

Get a pass/fail verdict

Prints a per-assertion result and exits 1 if any check failed, so it can gate a deploy or a CI job.

1

Install

Terminal
npx badgr-eval-check --output "The answer is 42." --must-include "42"

Requires Node.js 18+.

2

Usage

Check that a model's output includes required text and excludes banned phrases in a single command.

Terminal
npx badgr-eval-check \
  --output "The answer is 42. Confidence: high." \
  --must-include "42" \
  --must-not-include "I cannot"

Example output

Terminal output
badgr-eval-check

  ✓  must-include     "42" found in output
  ✓  must-include     "confidence" found in output
  ✗  must-not-include "I cannot" found in output — model refused to answer

  1 check failed.

What's included

Asserts required text with --must-include
Blocks banned phrases with --must-not-include
Checks required JSON fields via dot-path (e.g. data.items.0.name)
Batch-checks multiple fixtures with the TypeScript API
Machine-readable --json output for CI
Catches silent model regressions after provider or prompt changes
Runs entirely on your machine — no account needed
View on GitHub →

Ready to try badgr-eval-check?

npx badgr-eval-check --output "The answer is 42." --must-include "42" — no account needed to get started.