Skip to main content

quality_metrics()

Returns a quality score, grade, and noise ratio for a block of text.

noise_ratio()

Returns only the noise ratio (0.0–1.0) — the proportion of the text that is non-informative.
A noise ratio above 0.20 triggers a quality penalty. Above 0.50, a warning is added to the result.

Grade thresholds


estimate_tokens()

Estimate token count before sending to an LLM — no tiktoken required: