Downloads · 30 days
1.2K
9% of all-time downloads
vllm-sr/halugate-sentinel
halugate-sentinel is a text classification model from vllm-sr. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
HaluGate Sentinel is a ModernBERT + LoRA classifier that decides whether an incoming user prompt requires factual verification.
Downloads · 30 days
1.2K
9% of all-time downloads
All-time downloads
12.9K
Public
Parameters
150M
598 MB on disk
Likes
11
Public
Click a slice to open those files.
.safetensors598 MB · 99%
From the Hugging Face model README
HaluGate Sentinel is a ModernBERT + LoRA classifier that decides whether an incoming user prompt requires factual verification.
It does not check facts itself. Instead, it acts as a frontline switch in an LLM routing / gateway system, deciding whether a request should enter a fact-checking / RAG / hallucination-mitigation pipeline.
The model classifies prompts into:
FACT_CHECK_NEEDED:
Information-seeking queries that depend on external/world knowledge
NO_FACT_CHECK_NEEDED:
Creative, coding, opinion, or pure reasoning/math tasks
This model is part of the Hallucination Gatekeeper stack for vllm-sr.
HaluGate Sentinelvllm-sr/halugate-sentinel0 → NO_FACT_CHECK_NEEDED1 → FACT_CHECK_NEEDEDanswerdotai/ModernBERT-baseHaluGate Sentinel is designed as Stage 0 in a multi-stage hallucination mitigation architecture:
Stage 0 — HaluGate Sentinel (this model)
Classifies user prompts and decides whether fact-checking is needed:
NO_FACT_CHECK_NEEDED → Route directly to LLM generation.FACT_CHECK_NEEDED → Route into the Hallucination Gatekeeper path (RAG, tools, verifiers).Stage 1+ — Answer-level hallucination models (e.g., “HaluGate Verifier”)
Operate on (query, answer, evidence) to detect hallucinations and enforce trust policies.
HaluGate Sentinel focuses solely on prompt intent classification to minimize unnecessary compute while preserving safety for factual queries.
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
MODEL_ID = "vllm-sr/halugate-sentinel"
model = AutoModelForSequenceClassification.from_pretrained(MODEL_ID)
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
id2label = model.config.id2label # {0: 'NO_FACT_CHECK_NEEDED', 1: 'FACT_CHECK_NEEDED'}
def classify_prompt(text: str):
inputs = tokenizer(
text,
return_tensors="pt",
truncation=True,
max_length=512,
)
with torch.no_grad():
outputs = model(**inputs)
probs = torch.softmax(outputs.logits, dim=-1)[0]
pred_id = int(torch.argmax(probs).item())
label = id2label.get(pred_id, str(pred_id))
confidence = float(probs[pred_id].item())
return label, confidence
# Examples
print(classify_prompt("When was the Eiffel Tower built?"))
# → ('FACT_CHECK_NEEDED', 0.99...)
print(classify_prompt("Write a poem about spring"))
# → ('NO_FACT_CHECK_NEEDED', 0.98...)
print(classify_prompt("Implement a binary search in Python"))
# → ('NO_FACT_CHECK_NEEDED', 0.97...)
Pseudocode for a routing decision:
label, prob = classify_prompt(user_prompt)
FACT_CHECK_THRESHOLD = 0.6 # configurable based on your risk appetite
if label == "FACT_CHECK_NEEDED" and prob >= FACT_CHECK_THRESHOLD:
route = "hallucination_gatekeeper" # RAG / tools / verifiers
else:
route = "direct_generation"
# Use `route` to select downstream pipelines in your LLM gateway.
Balanced dataset of 50,000 prompts:
Information-seeking and knowledge-intensive questions drawn from:
Tasks that typically do not require external factual verification:
The objective is to approximate “does this prompt require world knowledge / external facts?” rather than “is the answer true?”.
LLM Gateway / Router
Hallucination Gatekeeper Frontline
FACT_CHECK_NEEDED.Traffic Analytics & Risk Scoring
Architecture:
[CLS] / pooled representationFine-tuning:
Decision Boundary:
Language:
Borderline Queries:
Domain Coverage:
Not a Verifier:
Risk Trade-off:
NO_FACT_CHECK_NEEDED may reduce safety for borderline factual tasks.FACT_CHECK_NEEDED increases compute cost but is safer in high-risk environments.Deployment Recommendation:
If you use HaluGate Sentinel in academic work or production systems, please cite:
@software{halugate_sentinel_2024,
title = {HaluGate Sentinel: Prompt-Level Fact-Check Switch for Hallucination Gatekeepers},
author = {vLLM Project},
year = {2024},
url = {https://github.com/vllm-project/semantic-router}
}
answerdotai/ModernBERT-base