| Format | Quantization | Recommendation | Use Case |
|---|---|---|---|
model.onnx | FP32 | Baseline | Reference / Server-side |
model_fp16.onnx | FP16 | High Performance | WebGPU (Browser) |
model_q4.onnx | 4-bit Quantized | Best Balance | General Web / Transformers.js |
model_q4f16.onnx | 4-bit with Float16 accumulation | Best Balance (Recommended) | General Web / Transformers.js |
model_bnb4.onnx | BitsAndBytes 4-bit | Ultra Light | Mobile / Low Bandwidth |
model_uint8.onnx | 8-bit Unsigned Integer | Stable | CPU / WASM |
model_qunatized.onnx | 8-bit Quantized | Not Recommended | |
model_int8.onnx | 8-bit Signed Integer | Not Recommended |
FACT_CHECK_NEEDED (Label 1): Information-seeking queries that rely on world knowledge (e.g., "What is the current price of Bitcoin?").NO_FACT_CHECK_NEEDED (Label 0): Creative, coding, opinion, or pure reasoning tasks (e.g., "Write a poem about a cat" or "How do I sort a list in Python?").| Model Used | Test Results |
|---|---|
| fp32 | Query: What is the current price of Bitcoin? Result: FACT_CHECK_NEEDED (88.73%) Query: Write a nursery rhyme about a cat. Result: NO_FACT_CHECK_NEEDED (100.00%) Query: How do I sort a list in Python? Result: NO_FACT_CHECK_NEEDED (99.97%) |
| fp16 | Query: What is the current price of Bitcoin? Result: FACT_CHECK_NEEDED (88.68%) Query: Write a nursery rhyme about a cat. Result: NO_FACT_CHECK_NEEDED (100.00%) Query: How do I sort a list in Python? Result: NO_FACT_CHECK_NEEDED (99.97%) |
| q4 | Query: What is the current price of Bitcoin? Result: FACT_CHECK_NEEDED (99.13%) Query: Write a nursery rhyme about a cat. Result: NO_FACT_CHECK_NEEDED (100.00%) Query: How do I sort a list in Python? Result: NO_FACT_CHECK_NEEDED (99.99%) |
| bnb4 | Query: What is the current price of Bitcoin? Result: FACT_CHECK_NEEDED (99.49%) Query: Write a nursery rhyme about a cat. Result: NO_FACT_CHECK_NEEDED (100.00%) Query: How do I sort a list in Python? Result: NO_FACT_CHECK_NEEDED (99.91%) |
| q4f16 | Query: What is the current price of Bitcoin? Result: FACT_CHECK_NEEDED (99.14%) Query: Write a nursery rhyme about a cat. Result: NO_FACT_CHECK_NEEDED (100.00%) Query: How do I sort a list in Python? Result: NO_FACT_CHECK_NEEDED (99.99%) |
| uint8 | Query: What is the current price of Bitcoin? Result: FACT_CHECK_NEEDED (98.92%) Query: Write a nursery rhyme about a cat. Result: NO_FACT_CHECK_NEEDED (99.97%) Query: How do I sort a list in Python? Result: NO_FACT_CHECK_NEEDED (95.22%) |
| q8, int8 (avoid) | Query: What is the current price of Bitcoin? Result: NO_FACT_CHECK_NEEDED (55.46%) Query: Write a nursery rhyme about a cat. Result: NO_FACT_CHECK_NEEDED (100.00%) Query: How do I sort a list in Python? Result: NO_FACT_CHECK_NEEDED (78.03%) |
1import { pipeline } from '@huggingface/transformers';
2
3// Load the 4-bit version for optimal performance
4const classifier = await pipeline('text-classification', 'vmanvs/halugate-sentinel-onnx', {
5 device: 'webgpu',
6 dtype: 'q4f16', // or 'bnb4' for maximum compression
7});
8
9const result = await classifier("Who won the 2020 world series?");
10console.log(result);
11// Output: [{ label: 'FACT_CHECK_NEEDED', score: 0.991... }]1import onnxruntime as ort
2from transformers import AutoTokenizer
3
4tokenizer = AutoTokenizer.from_pretrained("vmanvs/halugate-sentinel-onnx")
5session = ort.InferenceSession("model_q4f16.onnx")
6
7inputs = tokenizer("How do you implement a binary tree?", return_tensors="np")
8outputs = session.run(None, dict(inputs))
9# Process logits with softmax...
10def softmax(x):
11 """Compute softmax values for each sets of scores in x."""
12 e_x = np.exp(x - np.max(x, axis=-1, keepdims=True))
13 return e_x / e_x.sum(axis=-1, keepdims=True)
14@misc{halugate2025,
author = {LLM Semantic Router Team},
title = {HaluGate Sentinel: A Frontline Switch for Hallucination Mitigation},
year = {2025},
publisher = {Hugging Face},
journal = {Hugging Face Repository},
}