Skip to main content

BOOTH logo

BOOTH

A lightweight checkpoint layer for AI.

PyPI Python Versions License

Should my application trust this LLM output?

Tutorial · Use Cases · Changelog · Contributing · Issues

Every app built on an LLM call has to answer that question eventually, usually the hard way, after a confidently wrong answer has already reached a user. BOOTH is the checkpoint that answers it first. It sits between your application and an LLM call, and hands you back a structured, defensible decision instead of just whatever fluent text the model gave you.

pip install boothpy
import booth

result = booth.check(call_llm, "What is the capital of France?")

if result.ok:
    print(result.answer)                       # "Paris", confident and unambiguous
else:
    print(f"BOOTH returned {result.status}")    # AMBIGUOUS / UNCERTAIN, don't ship it blind

Why BOOTH exists

A few months ago, a person working an airport gate helped me find mine after I'd gotten lost, boarding pass in hand, signs everywhere, still at the wrong gate. She didn't know where I'd flown in from, how the aircraft was built, or anything about my itinerary beyond that one boarding pass. She didn't need to. She knew the airport, and she knew what to check.

That's the idea BOOTH is built around. The industry's default answer to "the model got it wrong" has mostly been to make the model know more: more context, more compute, bigger models, more tools bolted around it. And the problem still happens, because it isn't always a knowledge problem. Sometimes what's missing isn't more information going in. It's something whose only job is checking whether what came out actually meets the bar.

BOOTH doesn't try to know more than your model does. It just knows what to check.

I wrote the longer version of this on Substack: "Knowing less, but knowing what matters".


A real example, not a hypothetical

Same model, same question, asked with and without BOOTH. This is an actual comparison run, not a constructed demo.

Answer
Without BOOTH "90 days" (fabricated, no such number exists in the actual policy)
With booth.check_with_evidence() "45 days" (matches the real policy document exactly)

No amount of self-reported confidence catches that first answer. Only checking it against something real does.

result = booth.check_with_evidence(
    answer=llm_answer,
    evidence=retrieved_docs,
    compare_fn=your_comparison_function,
)

if result.status == booth.BLOCKED:
    print(f"The answer doesn't agree with what was actually retrieved: {result.detail}")

(The specific fabricated number will vary from run to run, that's just uncalibrated sampling. The pattern is the reliable part.)


Philosophy

  1. Keep the checkpoint small. A reusable decision layer, not another full LLM framework.
  2. Make uncertainty explicit. Return a structured status instead of silently passing an unacceptable output through.
  3. Treat ambiguity, validation, and confidence as separate, ordered checks. A confident, validator-passing answer can still be ambiguous.
  4. Reconsider instead of blindly resampling. The reason an attempt failed determines what the model is actually shown on retry.
  5. Expose, don't reinterpret. result.parsed shows the model's raw response rather than deciding what it should mean.
  6. Reject invalid data, don't silently coerce it. An out-of-range confidence or an unrecognized boolean-ish value is a reason to reject the attempt, never guess at.
  7. Keep evidence retrieval outside BOOTH. Applications own their own RAG, search, database, or tool infrastructure.
  8. Do not pretend agreement is truth. Agreement with a validator, confidence value, or retrieved evidence is not the same as proving a claim.
  9. Stay provider-agnostic. BOOTH works with any LLM provider because your application supplies the model-calling function.
  10. Don't collapse distinct failures into one bucket. A blank input, a crashing dependency, and a genuine disagreement are different problems and should be distinguishable without reading BOOTH's own source.

What BOOTH provides today

v0.5.1, zero-dependency, provider-agnostic, works with any LLM client you already have:

  • ambiguity detection, confidence checking with genuine reconsideration retries, and an optional caller-supplied validator
  • check_with_evidence() for grounding an answer against evidence your own RAG pipeline already retrieved
  • sync and async APIs (check() / acheck()) with consistent callable-object support on both
  • structured results, including result.method, result.parsed, result.to_dict(), and result.unwrap() for a plain str (or a raised BoothRejected) instead of Optional[str] handling at every call site
  • on check_with_evidence() results, result.reason, result.detail, and result.checker_failed — so an UNCERTAIN/BLOCKED result tells you which of five distinct causes produced it, instead of forcing you to guess from status alone

Learn more

  • TUTORIAL.md: every function, every field, how it all works
  • USECASES.md: where BOOTH fits, and just as importantly, where it doesn't
  • CHANGELOG.md: what changed in each release, and why
pip install boothpy
# or: pip install git+https://github.com/Vedantgitbot/booth.git

Contributing

BOOTH is small on purpose. That's a design constraint, not a lack of ambition. Bug reports and confirmed edge cases are the most valuable kind of contribution right now.

See CONTRIBUTING.md for how to report a bug well, what a good reproduction looks like, and what BOOTH's "small on purpose" stance means for feature PRs specifically.


License

This is the official BOOTH repository, maintained by Vedant Brahmbhatt.

BOOTH is released under the MIT License. See LICENSE for the full text.

Release files for boothpy 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for boothpy 0.5.1
File Size Uploaded
boothpy-0.5.1.tar.gz 43.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for boothpy 0.5.1
File Interpreter ABI Platform
boothpy-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 59.0 kB

Release files / boothpy-0.5.1.tar.gz

Download URL boothpy-0.5.1.tar.gz
Size 43.9 kB
Tags Source
SHA-256 checksum
How to use checksums
36f019b9ce94217734b8e21b981aa52941910ff93d5fb602dc1a774f89b160ba
BLAKE2b-256 checksum
How to use checksums
ed53423dc54c91ca3107c9b8849ac387339912a0d1eb9cac572edb7fe35c6591
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release files / boothpy-0.5.1-py3-none-any.whl

Download URL boothpy-0.5.1-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccf13ebbf4575395c9c23299672201e3faefeec5b464e7493286c51efc984ddd
BLAKE2b-256 checksum
How to use checksums
62447da102d377dd3d252801784f2a973b4b0160418e57bb9a6824e3bc96855c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.7

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.5.0

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page