Instructions to use flintglass/PrismParse-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use flintglass/PrismParse-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="flintglass/PrismParse-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/PrismParse-9B") model = AutoModelForMultimodalLM.from_pretrained("flintglass/PrismParse-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/PrismParse-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "flintglass/PrismParse-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/PrismParse-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/flintglass/PrismParse-9B
- SGLang
How to use flintglass/PrismParse-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/PrismParse-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/PrismParse-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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/PrismParse-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/PrismParse-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use flintglass/PrismParse-9B with Docker Model Runner:
docker model run hf.co/flintglass/PrismParse-9B
Flintglass PrismParse-9B
Flintglass PrismParse-9B is our flagship Apache-2.0 9B Vision-Language Document Parsing & OCR specialist built on Qwen/Qwen3.5-9B. Trained with full-parameter BF16 SFT on 40,044 zero-leakage, strictly permissively licensed document images across five core production ingestion tasks, PrismParse-9B achieves 91.16% average accuracy across our 2,244-image held-out benchmark suite (+37.10 pts over Base Qwen/Qwen3.5-9B) β our strongest document parser across receipts (89.01% Field F1, 100% valid JSON), invoices (91.84% Field F1, 100% valid JSON), scientific PDF tables (85.50% Cell F1 / 93.87% HTML 1-NED), and DocVQA (93.67% ANLS / 87.30% Exact Match).
- GGUF +
mmprojquantizations (llama.cpp / Ollama / LM Studio):flintglass/PrismParse-9B-GGUF(Q4_K_M5.3 GB Β·Q6_K6.9 GB Β·Q8_08.9 GB Β·mmproj-F16876 MB) - Compact siblings:
flintglass/PrismParse-4B(90.05%Avg, GGUF) Β·flintglass/PrismParse-2B(88.44%Avg, GGUF)
Zero-Leakage 5-Benchmark Evaluation (2,244 Held-Out Document Images)
All models below were evaluated identically with deterministic greedy decoding (temperature=0, enable_thinking=False) across 2,244 strictly held-out document images with zero page or expression overlap (482 LaTeX eval leaks caught and removed from training splits):
| Model (All Apache 2.0) | Avg 5-Bench | CORD-v2 Receipts (Field F1 / Valid JSON) | Invoices (Field F1 / Valid JSON) | PubTabNet Tables (Cell F1 / HTML 1-NED) | LaTeX-OCR Math (1-NED / Exact) | DocVQA (ANLS) |
|---|---|---|---|---|---|---|
Qwen/Qwen3.5-2B (Base) |
49.65% | 2.87% / 99.0% | 3.08% / 100% | 61.99% / 64.50% | 90.71% / 37.68% | 89.62% |
Qwen/Qwen3.5-4B (Base) |
53.83% | 7.75% / 100% | 3.60% / 78.9% | 72.84% / 67.84% | 91.59% / 40.67% | 93.36% |
Qwen/Qwen3.5-9B (Base) |
54.06% | 4.64% / 100% | 2.35% / 76.3% | 76.81% / 70.92% | 92.52% / 46.65% | 94.00% |
flintglass/PrismParse-2B (2.2B) |
88.44% | 87.27% / 100% | 91.45% / 100% | 79.58% / 90.98% | 95.07% / 57.04% | 88.82% |
flintglass/PrismParse-4B (4.5B) |
90.05% | 87.61% / 100% | 91.18% / 100% | 83.95% / 93.00% | 95.80% / 59.33% | 91.69% |
flintglass/PrismParse-9B (9B) |
91.16% | 89.01% / 100% | 91.84% / 100% | 85.50% / 93.87% | 95.76% / 58.27% | 93.67% |
LaTeX-OCR Breakdown (Printed vs. Handwritten Math)
| Model | Printed Math (n=500, 1-NED / Exact) |
Handwritten Math (n=68, 1-NED / Exact) |
|---|---|---|
Qwen/Qwen3.5-9B (Base) |
92.23% / 42.60% | 94.64% / 76.47% |
flintglass/PrismParse-2B |
95.26% / 54.40% | 93.63% / 76.47% |
flintglass/PrismParse-4B |
95.79% / 56.80% | 95.89% / 77.94% |
flintglass/PrismParse-9B |
95.96% / 56.20% | 94.30% / 73.53% |
Transparency Note: On CORD-v2 and Invoices, base
Qwen3.5-9Boften emits valid JSON with arbitrary invented key names rather than the strict target schema (nm,cnt,price,header,items,summary). On schema-free benchmarks,PrismParse-9Bstill delivers +8.69 pts PubTabNet Cell F1 (76.81% -> 85.50%), +22.95 pts HTML 1-NED (70.92% -> 93.87%,92.0%valid HTML), and +11.62 pts LaTeX Exact Match (46.65% -> 58.27%) while preserving near-base DocVQA (93.67%ANLS,87.30%Exact Match,+1.98pts overPrismParse-4B). On CORD-v2 it reaches 44.0% full-receipt Exact JSON Match (100%valid JSON).
Quickstart (transformers)
import torch
from PIL import Image
from transformers import AutoModelForImageTextToText, AutoProcessor
model_id = "flintglass/PrismParse-9B"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForImageTextToText.from_pretrained(
model_id, torch_dtype=torch.bfloat16, device_map="auto"
)
image = Image.open("table_or_receipt.png").convert("RGB")
prompt = (
"Convert this table image into clean, accurate HTML table markup "
"(<table><thead>...</thead><tbody>...</tbody></table>). Output ONLY the HTML table."
)
messages = [{"role": "user", "content": [{"type": "image", "image": image}, {"type": "text", "text": prompt}]}]
inputs = processor.apply_chat_template(
messages, tokenize=True, add_generation_prompt=True,
return_dict=True, return_tensors="pt", enable_thinking=False
).to(model.device)
out = model.generate(**inputs, max_new_tokens=1536, do_sample=False)
print(processor.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Recommended Task Prompts
| Mode | Prompt |
|---|---|
| PDF / Scientific Table -> HTML | Convert this table image into clean, accurate HTML table markup (<table><thead>...</thead><tbody>...</tbody></table>). Output ONLY the HTML table. |
| Receipt -> Structured JSON | Extract all structured fields from this receipt image as a single valid JSON object (with keys such as menu, sub_total, total). Output ONLY valid JSON with no markdown or extra text. |
| Invoice -> Structured JSON | Extract all structured fields from this invoice image as a single valid JSON object (with keys: header, items, summary). Output ONLY valid JSON with no markdown or extra text. |
| Math Formula -> LaTeX | Transcribe this mathematical expression into exact LaTeX. Output ONLY the raw LaTeX expression. |
| Full-Page Reading-Order OCR | Transcribe all readable text in this document image in natural top-to-bottom reading order. Output ONLY the extracted text. |
| Document QA | Answer the question concisely using ONLY the text visible in this document image. Output ONLY the exact answer.\nQuestion: <your question> |
Training & Permissive Data Provenance
Full-parameter BF16 SFT (2 epochs, ZeRO-1 DDP on 4Γ NVIDIA B200, final val_loss=0.0672) trained exclusively on explicitly permissively licensed upstream datasets (zero proprietary distillation, zero NC/GPL/SA training data):
naver-clova-ix/cord-v2(CC-BY-4.0, train+val only)katanaml-org/invoices-donut-data-v1(MIT, train only)apoidea/pubtabnet-html(CDLA-Permissive-1.0, train only)linxy/LaTeX_OCR(Apache-2.0, train only, deduplicated against test)pixparse/docvqa-single-page-questions(MIT, train only β QA + reading-order full-page OCR)
The Complete 6-Pillar Flintglass Prism Open-Source Agent & RAG Stack
All Apache-2.0, commercial-safe, and locally deployable:
- Ingest (
PrismParse):PrismParse-9B(GGUF) Β·PrismParse-4B(GGUF) Β·PrismParse-2B(GGUF) - Embed (
PrismEmbed, Zero MS MARCO, 8K, 1,800+ langs):PrismEmbed-MultilingualΒ·PrismEmbed-LargeΒ·PrismEmbed-SmallΒ· Live Demo - Rerank (
PrismRerank, Zero MS MARCO, 8K, 1,800+ langs):PrismRerank-LargeΒ·PrismRerank-MultilingualΒ·PrismRerank-SmallΒ· Live Demo - Protect (
PrismGuard, 8K Prompt-Injection Firewall):PrismGuard-MultilingualΒ·PrismGuard-LargeΒ·PrismGuard-SmallΒ· Live Demo - Execute (
PrismAgent, Pure On-Policy RLVR):Inkling-2-Mini-PrismAgent(GGUF) Β·PrismAgent-27BΒ·PrismAgent-35B-A3BΒ·PrismAgent-9BΒ·PrismAgent-8B - Verify (
PrismVerify, 8K RAG Hallucination Detection):PrismVerify-9BΒ·PrismVerify-4BΒ·PrismVerify-LargeΒ·PrismVerify-MultilingualΒ·PrismVerify-SmallΒ· Live Demo
License
Apache 2.0. Built by Flintglass Labs.
- Downloads last month
- 20