Text Generation
Transformers
Safetensors
English
multilingual
qwen3_5
image-text-to-text
hallucination-detection
groundedness
rag
llm-as-a-judge
verification
structured-outputs
rlvr
grpo
flintglass
prismverify
conversational
Instructions to use flintglass/PrismVerify-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flintglass/PrismVerify-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="flintglass/PrismVerify-9B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("flintglass/PrismVerify-9B") model = AutoModelForMultimodalLM.from_pretrained("flintglass/PrismVerify-9B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use flintglass/PrismVerify-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flintglass/PrismVerify-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "flintglass/PrismVerify-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/flintglass/PrismVerify-9B
- SGLang
How to use flintglass/PrismVerify-9B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "flintglass/PrismVerify-9B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "flintglass/PrismVerify-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "flintglass/PrismVerify-9B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "flintglass/PrismVerify-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use flintglass/PrismVerify-9B with Docker Model Runner:
docker model run hf.co/flintglass/PrismVerify-9B
Set Flintglass PrismVerify-9B model card (+9.83 pts RAGTruth F1, beats 3x larger Base Qwen3.8-27B)
f40ade3 verified |
Download README.md from flintglass/PrismVerify-9B: direct link, hf CLI and curl.
- Browser
- Download file 7.32 kB
-
https://huggingface.co/flintglass/PrismVerify-9B/resolve/main/README.md
- Command line
-
hf download hf://flintglass/PrismVerify-9B/README.md
-
curl -L -o README.md https://huggingface.co/flintglass/PrismVerify-9B/resolve/main/README.md
7.32 kB
| license: apache-2.0 | |
| language: | |
| - en | |
| - multilingual | |
| base_model: Qwen/Qwen3.5-9B | |
| base_model_relation: finetune | |
| datasets: | |
| - flintglass/PrismVerify-Corpus | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| tags: | |
| - qwen3_5 | |
| - hallucination-detection | |
| - groundedness | |
| - rag | |
| - llm-as-a-judge | |
| - verification | |
| - structured-outputs | |
| - rlvr | |
| - grpo | |
| - flintglass | |
| - prismverify | |
| # Flintglass PrismVerify-9B | |
| **Flintglass PrismVerify-9B** is a **Pure On-Policy RLVR (PPO-Clipped GRPO)** RAG groundedness & hallucination verification judge built on [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) (9.65B params, 262K context, Apache-2.0). | |
| Given a retrieved `[CONTEXT]` and a candidate `[CLAIM]`, it outputs a **strict, 100% schema-valid JSON verdict** with a concise, evidence-based justification (`~55` tokens, `<1s` on consumer GPUs): | |
| ```json | |
| {"verdict": "CONTRADICTION", "hallucinated": true, "reason": "Context reports Q3 revenue of $42M, whereas the claim states $58M."} | |
| ``` | |
| Across **8,857 strictly held-out zero-leakage RAG verification tasks (5 benchmarks)**, Pure On-Policy GRPO boosts `Qwen/Qwen3.5-9B` by **`+9.83 pts` on RAGTruth F1 (`0.7027 -> 0.8010`)**, **`+8.98 pts` on 5-Benchmark Macro F1 (`0.6802 -> 0.7700`)**, and **`+5.31 pts` on out-of-domain Financial QA (`FinQA-OOD`)**, improving **every single benchmark simultaneously**—and **outperforming 3× larger Base `Qwen/Qwen3.8-27B` on RAGTruth (`+4.92 pts`), DocNLI, LongRAG-8K, and overall 5-Benchmark Macro F1 (`0.7700` vs `0.7559`)**! | |
| - **Quantized GGUFs (`Q4_K_M`, `Q5_K_M`, `Q6_K`, `Q8_0`)**: [flintglass/PrismVerify-9B-GGUF](https://huggingface.co/flintglass/PrismVerify-9B-GGUF) | |
| - **Zero-Leakage Training Dataset (`68.6K` rows)**: [flintglass/PrismVerify-Corpus](https://huggingface.co/datasets/flintglass/PrismVerify-Corpus) | |
| - **Fast Encoder Companion (`16 ms` CPU) & Live Demo**: [PrismVerify-Large](https://huggingface.co/flintglass/PrismVerify-Large) | [PrismVerify-Multilingual](https://huggingface.co/flintglass/PrismVerify-Multilingual) | [Live Demo](https://huggingface.co/spaces/flintglass/PrismVerify-Demo) | |
| - **Standalone PEFT LoRA (`r=64`)**: Included in [`lora/`](./lora/) alongside full merged **BF16 Safetensors**. | |
| --- | |
| ## Strictly Held-Out 5-Benchmark Results (8,857 Tasks) | |
| All evaluations were run deterministically (`temperature=0.0`, non-thinking mode) on the exact same zero-leakage 8,857-task benchmark suite (3,646 training overlaps strictly blocked prior to training). | |
| | Benchmark (Held-Out Tasks) | Base `Qwen3.5-9B` F1 | Base `Qwen3.8-27B` (3× Larger) F1 | **PrismVerify-9B F1** | Delta vs 9B Base | **PrismVerify-9B Macro F1** | Valid JSON | Avg Tok | | |
| |---|---:|---:|---:|---:|---:|---:|---:| | |
| | **RAGTruth Test** (2,700) | 0.7027 | 0.7518 | **0.8010** | **+9.83%** | **0.8447** | 99.96% | 52.9 | | |
| | **HaluEval Test** (1,500) | 0.7193 | 0.7425 | **0.7359** | **+1.66%** | **0.7249** | 100.0% | 45.5 | | |
| | **DocNLI Test** (2,000) | 0.7996 | 0.7995 | **0.8059** | **+0.63%** | **0.8085** | 100.0% | 54.7 | | |
| | **FinQA-OOD** (1,657) | 0.2663 | 0.3938 | **0.3194** | **+5.31%** | **0.5361** | 99.88% | 57.6 | | |
| | **LongRAG-8K Bench** (1,000) | 0.9339 | 0.9341 | **0.9376** | **+0.37%** | **0.9360** | 100.0% | 53.8 | | |
| | **5-Benchmark Average** | **0.6844** | **0.7243** | **0.7200** | **+3.56%** | **0.7700 (+8.98% vs 9B, +1.41% vs 27B)** | **99.97%** | **52.9** | | |
| > *Why Macro F1 jumped +8.98%*: Base `Qwen/Qwen3.5-9B` over-flagged faithful responses on `RAGTruth` and `FinQA-OOD`. Pure On-Policy GRPO sharply calibrated both precision and recall across all 5 benchmarks while maintaining `~99.9%` strict JSON schema validity. | |
| --- | |
| ## Quickstart | |
| ### Local Inference (`llama.cpp` / Ollama — 5.5 GB VRAM!) | |
| ```bash | |
| llama-server -hf flintglass/PrismVerify-9B-GGUF:Q4_K_M --jinja --ctx-size 32768 --port 8080 | |
| ``` | |
| ### Python (`transformers`) | |
| ```python | |
| import json, torch | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_id = "flintglass/PrismVerify-9B" | |
| tok = AutoTokenizer.from_pretrained(model_id) | |
| model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto") | |
| SYSTEM = ( | |
| "You are Flintglass PrismVerify, a strict RAG groundedness and hallucination verifier. " | |
| "Compare the [CLAIM] against the [CONTEXT] ONLY (never rely on outside knowledge). " | |
| 'Respond ONLY with a valid JSON object matching this exact schema:\n' | |
| '{"verdict": "FAITHFUL" | "UNSUPPORTED" | "CONTRADICTION", "hallucinated": false | true, "reason": "concise evidence-based justification (<=30 words)"}\n' | |
| "Rules:\n" | |
| "- FAITHFUL (hallucinated=false): Every factual claim is directly supported by [CONTEXT].\n" | |
| "- UNSUPPORTED (hallucinated=true): Introduces facts, numbers, or entities absent from [CONTEXT].\n" | |
| "- CONTRADICTION (hallucinated=true): Directly contradicts information stated in [CONTEXT]." | |
| ) | |
| messages = [ | |
| {"role": "system", "content": SYSTEM}, | |
| {"role": "user", "content": "[CONTEXT]\nAcme Corp reported Q3 revenue of $42M, up 10% YoY.\n\n[CLAIM]\nAcme Corp reported Q3 revenue of $58M."}, | |
| ] | |
| prompt = tok.apply_chat_template(messages, enable_thinking=False, tokenize=False, add_generation_prompt=True) | |
| inputs = tok(prompt, return_tensors="pt").to(model.device) | |
| out = model.generate(**inputs, max_new_tokens=160, do_sample=False) | |
| verdict = json.loads(tok.decode(out[0][inputs.input_ids.shape[1]:], skip_special_tokens=True)) | |
| print(verdict) | |
| ``` | |
| --- | |
| ## The Complete 6-Pillar Flintglass Prism Open-Source Agent & RAG Stack | |
| All models are **100% Apache-2.0** and evaluated on zero-leakage held-out benchmarks: | |
| 1. **Ingest**: [PrismParse-4B](https://huggingface.co/flintglass/PrismParse-4B) / [PrismParse-2B](https://huggingface.co/flintglass/PrismParse-2B) | |
| 2. **Embed**: [PrismEmbed-Multilingual](https://huggingface.co/flintglass/PrismEmbed-Multilingual) | [PrismEmbed-Large](https://huggingface.co/flintglass/PrismEmbed-Large) | [PrismEmbed-Small](https://huggingface.co/flintglass/PrismEmbed-Small) ([Live Demo](https://huggingface.co/spaces/flintglass/PrismEmbed-Demo)) | |
| 3. **Rerank**: [PrismRerank-Large](https://huggingface.co/flintglass/PrismRerank-Large) | [PrismRerank-Multilingual](https://huggingface.co/flintglass/PrismRerank-Multilingual) | [PrismRerank-Small](https://huggingface.co/flintglass/PrismRerank-Small) ([Live Demo](https://huggingface.co/spaces/flintglass/PrismRerank-Demo)) | |
| 4. **Protect**: [PrismGuard-Multilingual](https://huggingface.co/flintglass/PrismGuard-Multilingual) ([Live Demo](https://huggingface.co/spaces/flintglass/PrismGuard-Demo)) | |
| 5. **Execute**: [Inkling-2-Mini-PrismAgent](https://huggingface.co/flintglass/Inkling-2-Mini-PrismAgent) | [PrismAgent-27B](https://huggingface.co/flintglass/PrismAgent-27B) | [PrismAgent-35B-A3B](https://huggingface.co/flintglass/PrismAgent-35B-A3B) | [PrismAgent-9B](https://huggingface.co/flintglass/PrismAgent-9B) | [PrismAgent-8B](https://huggingface.co/flintglass/PrismAgent-8B) | |
| 6. **Verify**: **PrismVerify-9B** | [PrismVerify-4B](https://huggingface.co/flintglass/PrismVerify-4B) | [PrismVerify-Large](https://huggingface.co/flintglass/PrismVerify-Large) | [PrismVerify-Multilingual](https://huggingface.co/flintglass/PrismVerify-Multilingual) ([Live Demo](https://huggingface.co/spaces/flintglass/PrismVerify-Demo)) | |
| ## License | |
| Released under **Apache-2.0**. | |