LettuceDetect: A Hallucination Detection Framework for RAG Applications
Paper
• 2502.17125 • Published
• 13
Pre-exported ONNX files for KRLabsOrg/lettucedect-base-modernbert-en-v1, a ModernBERT-based token classifier that detects hallucinations in RAG answers.
This repo exists so you can use the model without needing Python, torch, or transformers installed. Just download and run with any ONNX Runtime binding.
| File | Size | Description |
|---|---|---|
model.onnx |
~2.8 MB | ONNX model graph |
model.onnx.data |
~598 MB | Model weights (external data) |
tokenizer.json |
~3.6 MB | HuggingFace tokenizer |
tokenizer_config.json |
~350 B | Tokenizer config |
mix arcana.ground.setup
Downloads all files to priv/models/lettucedect/ and configures them for use with Arcana.Agent.ground/2.
from lettucedetect.models.inference import HallucinationDetector
import onnx
detector = HallucinationDetector(
method="transformer",
model_path="KRLabsOrg/lettucedect-base-modernbert-en-v1"
)
# export via torch
import torch
torch.onnx.export(detector.model, ..., "model.onnx", opset_version=14)
See scripts/export_lettuce_onnx.py in the Arcana repo for the full export script.
MIT, same as the original model.
@misc{Kovacs:2025,
title={LettuceDetect: A Hallucination Detection Framework for RAG Applications},
author={Ádám Kovács and Gábor Recski},
year={2025},
eprint={2502.17125},
archivePrefix={arXiv},
primaryClass={cs.CL},
}
Base model
answerdotai/ModernBERT-base