explaingit

pierreolivierbonin/verbatimeter

Analysis updated 2026-05-18

4PythonAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

Verbatimeter is a deterministic Python tool that measures how much of an AI-generated answer is verbatim reuse or paraphrase of its source, for grounding checks and CI gates.

Mindmap

mindmap
  root((verbatimeter))
    What it does
      Grounding verification
      Verbatim reuse check
      Verbatim paraphrase check
      Quotation check
    Tech stack
      Python
      tiktoken
    Use cases
      RAG grounding checks
      CI gating
      Hallucination detection
    Surfaces
      Decorator
      CLI
      CI gate

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add a decorator to your RAG generation function to automatically verify how much of each answer is grounded in the retrieved context.

USE CASE 2

Run a command line check that compares a source file and an answer file and reports the percentage of verbatim overlap.

USE CASE 3

Gate a CI pipeline so a build fails if a model's answers fall below a grounding threshold.

USE CASE 4

Catch fabricated quotations by checking only the quoted spans of an answer against the source.

What is it built with?

Pythontiktoken

How does it compare?

pierreolivierbonin/verbatimeter1038lab/agnes-ai3eyedtiger/video2vrcemote
Stars444
LanguagePythonPythonPython
Setup difficultyeasyeasyeasy
Complexity2/52/51/5
Audiencedevelopervibe codervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min
Permissive open-source license, use freely, including for commercial purposes.

In plain English

Verbatimeter is a small Python tool that checks how much of an AI generated answer actually comes word for word from the source text it was supposed to be grounded in. It is aimed at teams building RAG systems, retrieval augmented generation, where a model pulls in context and is expected to answer using that context rather than making things up. The tool works by comparing an answer against a source and reporting which words were copied directly, shown in green, and which words the model added on its own, shown in red. Two ways of measuring this are offered. The default, verbatim reuse, looks for contiguous runs of at least three matching words in a row, since single matching words are too easy to happen by chance. A second mode, verbatim paraphrasing, uses a longest common subsequence comparison to catch cases where the source's words are reused but rearranged or split apart. There is also a quotation mode that checks only the text inside quotation marks, which is useful for catching a model that claims to be quoting a source but actually invented the quote. Verbatimeter can be used in three ways: as a Python decorator wrapped around a generation function so every answer is checked automatically, as a command line tool that takes source and answer text or files, or as a gate in a continuous integration pipeline that fails the build when grounding drops too low. The checking itself is fully deterministic and does not rely on another AI model to judge the answer, so results are repeatable. The tool supports any language that separates words with spaces, including French, Hindi, Urdu, and Arabic, though it does not yet handle languages without spaces between words, such as Chinese, Japanese, or Thai. It has a single runtime dependency, tiktoken, and needs no network access once installed. Extracting text from PDFs or other document formats is left to other tools, verbatimeter only works on plain text you already have.

Copy-paste prompts

Prompt 1
Show me how to wrap my RAG generate function with verbatimeter's @verify decorator.
Prompt 2
Write a CLI command using verbatimeter to compare source.txt and answer.txt with the quotes flag enabled.
Prompt 3
Explain the difference between verbatimeter's verbatim reuse mode and its verbatim paraphrasing mode.
Prompt 4
Set up a CI step that fails the build if verbatimeter reports less than 50 percent grounding.

Frequently asked questions

What is verbatimeter?

Verbatimeter is a deterministic Python tool that measures how much of an AI-generated answer is verbatim reuse or paraphrase of its source, for grounding checks and CI gates.

What language is verbatimeter written in?

Mainly Python. The stack also includes Python, tiktoken.

What license does verbatimeter use?

Permissive open-source license, use freely, including for commercial purposes.

How hard is verbatimeter to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is verbatimeter for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.