Hallucination Risk Calculator & Prompt Re-engineering Toolkit (OpenAI-only)
Post-hoc calibration without retraining for large language models. This toolkit turns a raw prompt into:
a bounded hallucination risk using the Expectation-level Decompression Law (EDFL), and a decision to ANSWER or REFUSE under a target SLA, with transparent math (nats).
It supports two deployment modes:
Evidence-based: prompts include evidence/context; rolling priors are built by erasing that evidence.
prompts include evidence/context; rolling priors are built by erasing that evidence. Closed-book: prompts have no evidence; rolling priors are built by semantic masking of entities/numbers/titles.
All scoring relies only on the OpenAI Chat Completions API. No retraining required.
Table of Contents
Install & Setup
pip install --upgrade openai export OPENAI_API_KEY=sk-...
... continue reading