boothpy 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- boothpy-0.2.0/LICENSE +21 -0
- boothpy-0.2.0/PKG-INFO +441 -0
- boothpy-0.2.0/README.md +396 -0
- boothpy-0.2.0/pyproject.toml +39 -0
- boothpy-0.2.0/setup.cfg +4 -0
- boothpy-0.2.0/src/booth/__init__.py +29 -0
- boothpy-0.2.0/src/booth/core.py +276 -0
- boothpy-0.2.0/src/boothpy.egg-info/PKG-INFO +441 -0
- boothpy-0.2.0/src/boothpy.egg-info/SOURCES.txt +11 -0
- boothpy-0.2.0/src/boothpy.egg-info/dependency_links.txt +1 -0
- boothpy-0.2.0/src/boothpy.egg-info/requires.txt +3 -0
- boothpy-0.2.0/src/boothpy.egg-info/top_level.txt +1 -0
- boothpy-0.2.0/tests/test_core.py +315 -0
boothpy-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 [Vedant Brahmbhatt]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
boothpy-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: boothpy
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A lightweight checkpoint layer for LLM outputs — Path B: self-reported confidence with reconsideration retries.
|
|
5
|
+
Author: Vedant Brahmbhatt
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 [Vedant Brahmbhatt]
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/Vedantgitbot/booth
|
|
29
|
+
Project-URL: Repository, https://github.com/Vedantgitbot/booth
|
|
30
|
+
Classifier: Development Status :: 3 - Alpha
|
|
31
|
+
Classifier: Intended Audience :: Developers
|
|
32
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
33
|
+
Classifier: Programming Language :: Python :: 3
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
38
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
39
|
+
Requires-Python: >=3.9
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
License-File: LICENSE
|
|
42
|
+
Provides-Extra: dev
|
|
43
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
44
|
+
Dynamic: license-file
|
|
45
|
+
|
|
46
|
+
# BOOTH
|
|
47
|
+
|
|
48
|
+
**A lightweight checkpoint layer for LLM outputs.**
|
|
49
|
+
|
|
50
|
+
BOOTH sits between your application and an LLM call and decides whether an answer should pass through, be reconsidered, be flagged as resting on an unstated assumption, or be marked uncertain.
|
|
51
|
+
|
|
52
|
+
The name comes from the idea of a **ticket booth, toll booth, or parking/payment booth**: a booth doesn't need to know everything about what is happening beyond it. It checks whether the required condition has been met before allowing something to pass.
|
|
53
|
+
|
|
54
|
+
BOOTH follows the same idea for LLM outputs.
|
|
55
|
+
|
|
56
|
+
> **BOOTH does not claim to know the truth. It checks whether an output meets a defined acceptance condition.**
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Current Status
|
|
61
|
+
|
|
62
|
+
**v0.2.0 — Path B only**
|
|
63
|
+
|
|
64
|
+
The current implementation handles a bare LLM call:
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
Prompt
|
|
68
|
+
↓
|
|
69
|
+
LLM
|
|
70
|
+
↓
|
|
71
|
+
ambiguous? + interpretations + answer + self-reported confidence
|
|
72
|
+
↓
|
|
73
|
+
BOOTH
|
|
74
|
+
↓
|
|
75
|
+
ambiguous == true?
|
|
76
|
+
├── YES → AMBIGUOUS (returned immediately, no retry)
|
|
77
|
+
└── NO → confidence ≥ threshold?
|
|
78
|
+
├── YES → VERIFIED
|
|
79
|
+
└── NO → reconsider
|
|
80
|
+
↓
|
|
81
|
+
LLM again
|
|
82
|
+
↓
|
|
83
|
+
confidence ≥ threshold?
|
|
84
|
+
├── YES → REPAIRED
|
|
85
|
+
└── NO → UNCERTAIN
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
There is currently **no RAG, tool invocation, or independent evidence checking** in Path B.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## What BOOTH Does
|
|
93
|
+
|
|
94
|
+
BOOTH asks the model to return, in this exact key order:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"ambiguous": false,
|
|
99
|
+
"interpretations": [],
|
|
100
|
+
"chosen_interpretation": null,
|
|
101
|
+
"answer": "Paris",
|
|
102
|
+
"confidence": 0.95
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**The field order is deliberate, not cosmetic.** JSON is generated token by token, left to right. By requiring `ambiguous` and `interpretations` before `answer`, the model has to commit to an ambiguity judgment *before* it generates the answer text — this is a real constraint on generation order, not a self-audit tacked on after the fact.
|
|
107
|
+
|
|
108
|
+
If `ambiguous` is `true`, BOOTH returns immediately with status `AMBIGUOUS`, regardless of confidence. A question that's ambiguous as asked isn't fixed by asking the model to reconsider — reconsideration only helps when the question was answerable and the *answer* was shaky, so ambiguous responses skip the retry loop entirely.
|
|
109
|
+
|
|
110
|
+
If `ambiguous` is `false` and the confidence is below the configured threshold, BOOTH shows the model its previous answer and confidence and asks it to **reconsider**:
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
Previous answer: "Lyon"
|
|
114
|
+
Previous confidence: 0.3
|
|
115
|
+
|
|
116
|
+
Reconsider carefully.
|
|
117
|
+
If that answer is correct, restate it.
|
|
118
|
+
If it is wrong, give the corrected answer.
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
If the reconsidered answer reaches the confidence threshold, BOOTH returns `REPAIRED`. If the model remains below the threshold after all allowed attempts, BOOTH returns `UNCERTAIN`.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Why?
|
|
126
|
+
|
|
127
|
+
A normal LLM call looks like:
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
answer = call_llm(prompt)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
The application has to decide what to do with that answer, and has no way to know whether the question itself had more than one valid reading.
|
|
134
|
+
|
|
135
|
+
With BOOTH:
|
|
136
|
+
|
|
137
|
+
```python
|
|
138
|
+
result = booth.check(call_llm, prompt)
|
|
139
|
+
|
|
140
|
+
if result.status == booth.AMBIGUOUS:
|
|
141
|
+
print("Multiple valid readings:", result.interpretations)
|
|
142
|
+
elif result.ok:
|
|
143
|
+
answer = result.answer
|
|
144
|
+
else:
|
|
145
|
+
answer = "I'm not confident enough to answer that."
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The application gets a structured result instead of having to implement the retry, parsing, confidence handling, ambiguity handling, and attempt tracking itself.
|
|
149
|
+
|
|
150
|
+
**Real example**, from testing against a live model:
|
|
151
|
+
|
|
152
|
+
> **Question:** "What's the best-selling book?"
|
|
153
|
+
>
|
|
154
|
+
> **Without BOOTH:** *"The best-selling book of all time is the Bible, with estimates of over 5 billion copies sold worldwide."* — stated as plain fact, no hint that the question is contested.
|
|
155
|
+
>
|
|
156
|
+
> **With BOOTH:** `status: AMBIGUOUS, confidence: 0.88`, answer: "The Bible", with four listed interpretations — worldwide including religious texts, best-selling *novel*, best-selling *non-religious* book, and best-selling book *this year*. Same underlying model, same underlying "best guess" answer — but only one of the two tells the user the question was contested at all.
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Installation
|
|
161
|
+
|
|
162
|
+
Not yet published to PyPI. Install directly from GitHub:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
pip install git+https://github.com/Vedantgitbot/booth.git
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Or clone and install locally (editable, so local edits take effect immediately):
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
git clone https://github.com/Vedantgitbot/booth.git
|
|
172
|
+
cd booth
|
|
173
|
+
pip install -e .
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Basic Usage
|
|
179
|
+
|
|
180
|
+
BOOTH is provider-agnostic. You provide a function that takes a prompt and returns the model's raw text response.
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
import booth
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
def call_llm(prompt: str) -> str:
|
|
187
|
+
# Connect this to your LLM provider.
|
|
188
|
+
# Return the model's raw text response.
|
|
189
|
+
...
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
result = booth.check(
|
|
193
|
+
call_llm,
|
|
194
|
+
"What is the capital of France?"
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
if result.ok:
|
|
198
|
+
print(result.answer)
|
|
199
|
+
else:
|
|
200
|
+
print(f"BOOTH marked this {result.status.lower()}.")
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
BOOTH does not require a specific LLM provider. Your `call_fn` can be backed by OpenAI, Anthropic, Groq, Gemini, a local model, or another system. See `examples/ai.py` for a full working example against the Groq API.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Result Statuses
|
|
208
|
+
|
|
209
|
+
BOOTH currently exposes five statuses:
|
|
210
|
+
|
|
211
|
+
### `VERIFIED`
|
|
212
|
+
|
|
213
|
+
The question was not flagged ambiguous, and the **first attempt** met the configured confidence threshold.
|
|
214
|
+
|
|
215
|
+
```text
|
|
216
|
+
ambiguous = false
|
|
217
|
+
confidence = 0.91, threshold = 0.70
|
|
218
|
+
|
|
219
|
+
→ VERIFIED
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
`VERIFIED` means the output passed BOOTH's Path B acceptance condition. It does **not** mean that BOOTH independently proved the answer correct.
|
|
223
|
+
|
|
224
|
+
---
|
|
225
|
+
|
|
226
|
+
### `REPAIRED`
|
|
227
|
+
|
|
228
|
+
The question was not flagged ambiguous. The first attempt was below the threshold, but a later reconsideration reached the threshold.
|
|
229
|
+
|
|
230
|
+
```text
|
|
231
|
+
Attempt 1: answer = "Lyon", confidence = 0.30
|
|
232
|
+
↓ reconsider
|
|
233
|
+
Attempt 2: answer = "Paris", confidence = 0.92
|
|
234
|
+
|
|
235
|
+
→ REPAIRED
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
"Repaired" means **recovered through reconsideration**, not "checked against external evidence and proved correct."
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
### `AMBIGUOUS`
|
|
243
|
+
|
|
244
|
+
The model flagged the question as having more than one valid, meaningfully different interpretation — different named entities sharing a name, different metrics, different time periods, or similar. Returned **immediately, regardless of confidence**, and never retried, since reconsideration doesn't resolve a question that's ambiguous as asked.
|
|
245
|
+
|
|
246
|
+
```text
|
|
247
|
+
Question: "What is the capital of Georgia?"
|
|
248
|
+
ambiguous = true
|
|
249
|
+
interpretations = ["Georgia (US state) -> Atlanta", "Georgia (country) -> Tbilisi"]
|
|
250
|
+
chosen_interpretation = "Georgia (country) -> Tbilisi"
|
|
251
|
+
answer = "Tbilisi"
|
|
252
|
+
confidence = 0.93
|
|
253
|
+
|
|
254
|
+
→ AMBIGUOUS
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
`result.answer` still contains the model's best-guess answer under its silently-chosen interpretation, but `result.ok` is `False` for `AMBIGUOUS` — callers should check `result.interpretations` before showing the answer as if it were a settled fact.
|
|
258
|
+
|
|
259
|
+
**Known limitation:** ambiguity detection catches *structural* ambiguity (a term or name that admits multiple readings) reliably. It is weaker on *convention-based* ambiguity, where the split only exists because of a domain norm the model has to already know about — testing found this improves with the ordered-JSON schema but is not guaranteed to catch every case a domain expert would flag. See Non-Goals.
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
### `UNCERTAIN`
|
|
264
|
+
|
|
265
|
+
BOOTH could not obtain an answer that satisfied the acceptance condition. This can happen when every attempt remains below the confidence threshold, every model response is unparseable, or every call fails.
|
|
266
|
+
|
|
267
|
+
```text
|
|
268
|
+
Attempt 1 → confidence 0.40
|
|
269
|
+
Attempt 2 → confidence 0.51
|
|
270
|
+
|
|
271
|
+
→ UNCERTAIN
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
The caller can use this status to avoid silently presenting a low-confidence answer as if it were reliable.
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
### `BLOCKED`
|
|
279
|
+
|
|
280
|
+
Reserved for the broader BOOTH design and **not reachable from the current Path B implementation**. Exposed so applications can pattern-match against the complete BOOTH status vocabulary when Path A is eventually implemented.
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## The Important Limitation
|
|
285
|
+
|
|
286
|
+
BOOTH's current Path B is **not a correctness guarantee**. It is a self-consistency and reconsideration mechanism, plus a self-assessed ambiguity check. The model is evaluating its own answer and its own question.
|
|
287
|
+
|
|
288
|
+
For example, a model could produce:
|
|
289
|
+
|
|
290
|
+
```json
|
|
291
|
+
{"ambiguous": false, "answer": "The Earth is flat.", "confidence": 0.99}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
BOOTH would return `VERIFIED`, because the model's reported confidence satisfies the threshold and it wasn't flagged ambiguous. BOOTH has no independent evidence in Path B that could establish that the answer is actually true.
|
|
295
|
+
|
|
296
|
+
Therefore:
|
|
297
|
+
|
|
298
|
+
> **VERIFIED means "passed BOOTH's current acceptance condition," not "mathematically or factually proven correct."**
|
|
299
|
+
>
|
|
300
|
+
> **AMBIGUOUS means "the model recognized more than one valid reading," not "BOOTH has enumerated every possible reading."**
|
|
301
|
+
|
|
302
|
+
This distinction is fundamental to the project.
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## Path A — Future Scope
|
|
307
|
+
|
|
308
|
+
A separate Path A is planned for situations where an existing retriever or tool can be invoked again and its output can be compared against the LLM's answer:
|
|
309
|
+
|
|
310
|
+
```text
|
|
311
|
+
Question → LLM answer → RAG / tool / evidence → BOOTH → compare → VERIFIED / REPAIRED / AMBIGUOUS / UNCERTAIN / BLOCKED
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Path A is **not implemented in the current release**. It will have a different call shape from Path B because it needs access to a re-invocable retriever/tool rather than only a plain prompt string.
|
|
315
|
+
|
|
316
|
+
---
|
|
317
|
+
|
|
318
|
+
## API
|
|
319
|
+
|
|
320
|
+
```python
|
|
321
|
+
booth.check(
|
|
322
|
+
call_fn,
|
|
323
|
+
prompt,
|
|
324
|
+
threshold=0.7,
|
|
325
|
+
max_retries=1,
|
|
326
|
+
on_attempt=None,
|
|
327
|
+
)
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
**`call_fn`** — `Callable[[str], str]`. Receives a prompt, returns the model's raw response. BOOTH does not manage your model provider or API credentials.
|
|
331
|
+
|
|
332
|
+
**`prompt`** — the original user/application prompt. BOOTH appends its confidence/ambiguity-reporting instructions internally.
|
|
333
|
+
|
|
334
|
+
**`threshold`** — minimum self-reported confidence required to accept an unambiguous answer. Default `0.7`. Must be between `0.0` and `1.0`. **Not independently calibrated** — validate against your own test set before trusting a specific value in production; see `examples/` for a way to log real (question, status, confidence) data.
|
|
335
|
+
|
|
336
|
+
**`max_retries`** — number of reconsideration attempts after the initial call, for low-confidence *unambiguous* answers. `max_retries=0` means one total call; `max_retries=2` allows up to three.
|
|
337
|
+
|
|
338
|
+
**`on_attempt`** — optional `Callable[[int, Attempt], Any]`, invoked after every attempt (including failed/unparseable ones), for logging, debugging, and calibration.
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## Result Object
|
|
343
|
+
|
|
344
|
+
```python
|
|
345
|
+
result.answer # str | None
|
|
346
|
+
result.status # VERIFIED / REPAIRED / AMBIGUOUS / UNCERTAIN / BLOCKED
|
|
347
|
+
result.confidence # float | None
|
|
348
|
+
result.attempts # list[Attempt] — full history of every call made
|
|
349
|
+
result.n_attempts # int
|
|
350
|
+
result.ok # bool — True only for VERIFIED / REPAIRED
|
|
351
|
+
result.ambiguous # bool
|
|
352
|
+
result.interpretations # list[str] — populated only when ambiguous
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
```python
|
|
356
|
+
if result.status == booth.AMBIGUOUS:
|
|
357
|
+
print("This question has multiple readings:", result.interpretations)
|
|
358
|
+
elif result.ok:
|
|
359
|
+
print(result.answer)
|
|
360
|
+
else:
|
|
361
|
+
print("BOOTH could not verify an answer.")
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
---
|
|
365
|
+
|
|
366
|
+
## Why the Checkpoint Metaphor?
|
|
367
|
+
|
|
368
|
+
A ticket booth doesn't know whether the movie is good. A toll booth doesn't know where you're ultimately going. They check a **specific condition**.
|
|
369
|
+
|
|
370
|
+
BOOTH applies the same principle to AI systems: it does not know everything, it checks whether the required condition has been met. In Path B, that condition is currently:
|
|
371
|
+
|
|
372
|
+
```text
|
|
373
|
+
Is this question answerable as a single, unambiguous claim,
|
|
374
|
+
and does the model report confidence at or above the configured threshold?
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
In future evidence-based paths, the condition can become stronger: does the answer agree with the available evidence?
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
## Design Principles
|
|
382
|
+
|
|
383
|
+
1. **Don't silently pass through uncertainty or unstated ambiguity.** If the model can't clear the bar, say so — `UNCERTAIN` or `AMBIGUOUS`, not a confident-looking guess.
|
|
384
|
+
2. **Reconsider rather than blindly resample.** A retry should give the model an opportunity to examine its previous answer.
|
|
385
|
+
3. **Ask "is this even answerable as asked" before "how confident are you."** Field order in the schema forces this sequencing, not just the prompt wording.
|
|
386
|
+
4. **Don't pretend confidence is proof.** Self-reported confidence and self-reported ambiguity are useful signals, not independent evidence.
|
|
387
|
+
5. **Stay provider-agnostic.** BOOTH works above different LLM providers rather than locking applications to one API.
|
|
388
|
+
6. **Keep the core API small.** A checkpoint layer, not another full LLM framework.
|
|
389
|
+
|
|
390
|
+
---
|
|
391
|
+
|
|
392
|
+
## Current Non-Goals
|
|
393
|
+
|
|
394
|
+
BOOTH Path B does **not** currently:
|
|
395
|
+
|
|
396
|
+
- guarantee factual correctness
|
|
397
|
+
- independently verify claims against external evidence
|
|
398
|
+
- browse the web, perform RAG, or invoke external tools
|
|
399
|
+
- compare multiple independent models
|
|
400
|
+
- provide calibrated confidence probabilities (self-reported confidence is a signal, not a calibrated statistic — validate against your own data before trusting a threshold)
|
|
401
|
+
- reliably catch **convention-based** ambiguity that requires specific domain knowledge to recognize as a split (e.g. bestseller-list conventions excluding religious texts) — it is meaningfully better than no check, tested and confirmed working on **structural** ambiguity (shared names, competing metrics), but is not exhaustive
|
|
402
|
+
- replace application-specific safety or validation logic
|
|
403
|
+
|
|
404
|
+
Those may be addressed by future paths or integrations.
|
|
405
|
+
|
|
406
|
+
---
|
|
407
|
+
|
|
408
|
+
## Development
|
|
409
|
+
|
|
410
|
+
```text
|
|
411
|
+
booth/
|
|
412
|
+
├── .gitignore
|
|
413
|
+
├── LICENSE
|
|
414
|
+
├── README.md
|
|
415
|
+
├── TUTORIAL.md
|
|
416
|
+
├── pyproject.toml
|
|
417
|
+
├── src/
|
|
418
|
+
│ └── booth/
|
|
419
|
+
│ ├── __init__.py
|
|
420
|
+
│ └── core.py
|
|
421
|
+
├── examples/
|
|
422
|
+
│ ├── ai.py
|
|
423
|
+
│ └── app.py
|
|
424
|
+
└── tests/
|
|
425
|
+
└── test_core.py
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
```bash
|
|
429
|
+
pip install -e ".[dev]"
|
|
430
|
+
pytest
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
Tests use mock `call_fn` implementations so core BOOTH behavior can be tested without making real LLM API calls. See `examples/ai.py` and `examples/app.py` for a working end-to-end test against a live model (Groq), including a NiceGUI chat frontend that displays status, confidence, and interpretations per response.
|
|
434
|
+
|
|
435
|
+
---
|
|
436
|
+
|
|
437
|
+
## License
|
|
438
|
+
|
|
439
|
+
This is the official BOOTH repository — Vedant Brahmbhatt
|
|
440
|
+
|
|
441
|
+
MIT. See [`LICENSE`](LICENSE).
|