# uqlm: Uncertainty Quantification for Language Models

A Python library that detects likely hallucinations in large language model outputs using uncertainty quantification techniques, scoring each response's confidence between 0 and 1.

UQLM is a Python library for detecting hallucinations in large language model outputs using uncertainty quantification. It provides a suite of response-level scorers, each returning a confidence score between 0 and 1, where a higher score indicates a lower likelihood of errors or hallucinations.

Scorers are grouped into black-box scorers that measure the consistency of multiple generations from the same prompt and work with any LLM; white-box scorers that use token probabilities already returned by the model, at minimal extra cost; LLM-as-a-judge scorers that use another LLM to judge a response; ensemble scorers that combine other scorer types; and long-text scorers for claim-level comparisons across longer outputs.

It installs from PyPI with pip and is documented in the accompanying paper published in JMLR 2026.

Website: https://cvs-health.github.io/uqlm/latest/index.html
