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("The answer doesn't agree with what was actually retrieved.")

(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.

What BOOTH provides today

v0.4.9, 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, and result.to_dict(), instead of a raw string you have no reason to trust

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.4.9

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.4.9
File Size Uploaded
boothpy-0.4.9.tar.gz 40.2 kB Details

Built distribution (wheel)

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

Total release size: 53.4 kB

Release files / boothpy-0.4.9.tar.gz

Download URL boothpy-0.4.9.tar.gz
Size 40.2 kB
Tags Source
SHA-256 checksum
How to use checksums
92f4227ec8a92ca5433e1d7dc16ee3fc9332be2c967b8252f8cc9060294d9c23
BLAKE2b-256 checksum
How to use checksums
a5e196c20dafaa132e21f1b34a80d498647c986d39d45b596afe4c6d86a81563
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.4.9-py3-none-any.whl

Download URL boothpy-0.4.9-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73d224f52a0a3bf9198d12b6517218c8cbe41ac1a37be51ccdb6e6bdf14ca66f
BLAKE2b-256 checksum
How to use checksums
93a8532c3771de3fb1263eb30218f444d4a80d54ce37a71044b74601418b7e01
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

0.5.1

2 release files

0.5.0

2 release files

This release

0.4.9 This release

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