Image-Text-to-Text
Transformers
Safetensors
qwen3_5
decision-model
system-one
flide
ocr
pdf
document-understanding
hf_jobs
conversational
Run this model with HF Jobs
Run davanstrien/ocr-decision-0.8b on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/davanstrien/ocr-decision-0.8b. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/davanstrien/ocr-decision-0.8b on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/davanstrien/ocr-decision-0.8b. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/davanstrien/ocr-decision-0.8b. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use davanstrien/ocr-decision-0.8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use davanstrien/ocr-decision-0.8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="davanstrien/ocr-decision-0.8b") 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("davanstrien/ocr-decision-0.8b") model = AutoModelForMultimodalLM.from_pretrained("davanstrien/ocr-decision-0.8b", 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 davanstrien/ocr-decision-0.8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "davanstrien/ocr-decision-0.8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "davanstrien/ocr-decision-0.8b", "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/davanstrien/ocr-decision-0.8b
- SGLang
How to use davanstrien/ocr-decision-0.8b 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 "davanstrien/ocr-decision-0.8b" \ --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": "davanstrien/ocr-decision-0.8b", "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 "davanstrien/ocr-decision-0.8b" \ --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": "davanstrien/ocr-decision-0.8b", "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 davanstrien/ocr-decision-0.8b with Docker Model Runner:
docker model run hf.co/davanstrien/ocr-decision-0.8b
Use hf_jobs tag, plain mojibake wording, and cite HF Jobs in case study & throughput
Browse files10 unmodified lines1112131415161725 unmodified lines43444546474849159 unmodified lines20921021121221321421577 unmodified lines29329429529629729829910 unmodified lines- ocr- document-understanding- hf-jobs- qwen3_5language:- en25 unmodified lines## Why & what it is forRunning a generative VLM OCR model on every page of a large PDF or archival collection is expensive, while cheap character-count heuristics miss broken embedded text layers (such as CP1251 mojibake) and VLM OCR outputs still fail silently with repetition loops, hallucinations, or dropped blocks. A small decision model lets you run multiple routing and verification checks on a page in ~22–27 ms — or label a few thousand pages in 90 seconds to distil a pure-CPU router:- **Pre-OCR triage & routing:** detect blank pages, rotation, tables, figures, equations, handwriting, blackletter/Fraktur, script, and document type before choosing an OCR or extraction pipeline.- **PDF text-layer auditing:** check whether a PDF's free embedded text layer (e.g. from `pypdfium2`) is usable, missing, garbled (mojibake), or partial before paying for GPU OCR.159 unmodified lines## Case study: distilling a CPU-only PDF router for $0.28You do not necessarily need to run a 0.8B vision model on every page in production. To test routing on real 2026 Common Crawl PDFs (`CC-MAIN-2026-43`, never seen during training), running `ocr-decision-0.8b` for **90 seconds on one RTX PRO 6000 (~$0.28)** labelled 6,560 pages from 2,400 PDFs, which were then distilled into a pure-CPU XGBoost page classifier using only cheap `pypdfium2` page statistics.Evaluated on an untouched 200-PDF / 865-page test set (silver ground truth from `LightOnOCR-3` comparing embedded text layers against VLM OCR) and weighted across 44,335 crawl pages:77 unmodified lines### 6. Throughput & costMeasured via `flide serve` (BF16, `max_side=1024`, pre-encoded real 2026 PDF pages with an average OCR text length of ~2,100 chars; actual throughput depends on image resolution and transcription length). Because `flide` encodes the page image once and shares the KV prefix across every question on that page, asking 9 triage questions instead of 1 adds only **~2.6 ms** single-stream on an RTX PRO 6000:| Workload (`flide serve`, BF16, `1024px`) | NVIDIA L4 (24 GB, ~$0.80/hr) | NVIDIA RTX PRO 6000 (96 GB, ~$2.75/hr) ||---|---:|---:|10 unmodified lines1112131415161725 unmodified lines43444546474849159 unmodified lines20921021121221321421577 unmodified lines29329429529629729829910 unmodified lines- ocr- document-understanding- hf_jobs- qwen3_5language:- en25 unmodified lines## Why & what it is forRunning a generative VLM OCR model on every page of a large PDF or archival collection is expensive, while cheap character-count heuristics miss broken embedded text layers (garbled encodings / mojibake) and VLM OCR outputs still fail silently with repetition loops, hallucinations, or dropped blocks. A small decision model lets you run multiple routing and verification checks on a page in ~22–27 ms — or label a few thousand pages in 90 seconds to distil a pure-CPU router:- **Pre-OCR triage & routing:** detect blank pages, rotation, tables, figures, equations, handwriting, blackletter/Fraktur, script, and document type before choosing an OCR or extraction pipeline.- **PDF text-layer auditing:** check whether a PDF's free embedded text layer (e.g. from `pypdfium2`) is usable, missing, garbled (mojibake), or partial before paying for GPU OCR.159 unmodified lines## Case study: distilling a CPU-only PDF router for $0.28You do not necessarily need to run a 0.8B vision model on every page in production. To test routing on real 2026 Common Crawl PDFs (`CC-MAIN-2026-43`, never seen during training), running `ocr-decision-0.8b` for **90 seconds on one RTX PRO 6000 on [Hugging Face Jobs](https://huggingface.co/docs/huggingface_hub/guides/jobs) (~$0.28)** labelled 6,560 pages from 2,400 PDFs, which were then distilled into a pure-CPU XGBoost page classifier using only cheap `pypdfium2` page statistics.Evaluated on an untouched 200-PDF / 865-page test set (silver ground truth from `LightOnOCR-3` comparing embedded text layers against VLM OCR) and weighted across 44,335 crawl pages:77 unmodified lines### 6. Throughput & costMeasured on [Hugging Face Jobs](https://huggingface.co/docs/huggingface_hub/guides/jobs) via `flide serve` (BF16, `max_side=1024`, pre-encoded real 2026 PDF pages with an average OCR text length of ~2,100 chars; actual throughput depends on image resolution and transcription length). Because `flide` encodes the page image once and shares the KV prefix across every question on that page, asking 9 triage questions instead of 1 adds only **~2.6 ms** single-stream on an RTX PRO 6000:| Workload (`flide serve`, BF16, `1024px`) | NVIDIA L4 (24 GB, ~$0.80/hr) | NVIDIA RTX PRO 6000 (96 GB, ~$2.75/hr) ||---|---:|---:|
README.md+4-4