LLM Output Assertion Checker

Write test assertions against LLM output without running code.

Ad placeholder (leaderboard)

LLM output assertion checker

When you tune a prompt, you usually have a mental checklist of what a good answer must look like — it should mention a specific term, parse as JSON, stay under a length limit, and never include a forbidden phrase. This tool turns that checklist into explicit assertions and evaluates them against a pasted response, giving you a clear pass/fail grid without writing or running any test code.

How it works

Each assertion is evaluated independently against the same output string. Contains does a case-insensitive substring search. Matches regex compiles your pattern with the browser’s native RegExp and tests it. Valid JSON runs JSON.parse and reports whether it succeeded. Length range checks the character count against an optional minimum and maximum. No banned phrases splits your comma-separated list and fails if any phrase appears. The result panel shows a green tick or red cross per rule, plus the matched substring or the parse error so you can see exactly why a check failed.

Tips and notes

  • Start with the must-haves. A single contains plus a valid JSON check catches most “the model drifted” regressions.
  • Anchor your regex. Use ^ and $ when you need the whole output to match a shape, not just a fragment buried inside prose.
  • Length guards catch runaway output. A max-length assertion is a cheap way to flag responses that ignored a “be concise” instruction.
  • Everything is local. No network requests are made, so paste freely.
Ad placeholder (rectangle)