Instructions to use enclavelabs/olmocr-2-iter7a-vqa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use enclavelabs/olmocr-2-iter7a-vqa with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("allenai/olmOCR-2-7B-1025") model = PeftModel.from_pretrained(base_model, "enclavelabs/olmocr-2-iter7a-vqa") - Transformers
How to use enclavelabs/olmocr-2-iter7a-vqa with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="enclavelabs/olmocr-2-iter7a-vqa")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("enclavelabs/olmocr-2-iter7a-vqa", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use enclavelabs/olmocr-2-iter7a-vqa with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "enclavelabs/olmocr-2-iter7a-vqa" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "enclavelabs/olmocr-2-iter7a-vqa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/enclavelabs/olmocr-2-iter7a-vqa
- SGLang
How to use enclavelabs/olmocr-2-iter7a-vqa 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 "enclavelabs/olmocr-2-iter7a-vqa" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "enclavelabs/olmocr-2-iter7a-vqa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "enclavelabs/olmocr-2-iter7a-vqa" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "enclavelabs/olmocr-2-iter7a-vqa", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use enclavelabs/olmocr-2-iter7a-vqa with Docker Model Runner:
docker model run hf.co/enclavelabs/olmocr-2-iter7a-vqa
EnclaveScribe iter-7a β Scoped English document VQA specialist
β οΈ NOT a general OCR model. This adapter is scoped to English document VQA and short-answer document tasks. For general OCR β especially anything non-Latin (Devanagari, Chinese, Arabic, β¦) β use a different model.
Trained by Enclave Labs as part of a public, iteration-by-iteration effort to build a sovereign (fully self-hosted) alternative to Interfaze / Gemini / GPT-4V for document intelligence.
TL;DR
- What it is: a LoRA adapter (r=32, Ξ±=64) on top of
allenai/olmOCR-2-7B-1025. - What it does well: English document VQA. Answers questions asked about
a document image.
5.4Γthe OCRBench V2 F1 of base olmOCR-2-7B-1025. - What it does badly: transcribing Devanagari, or any script it wasn't substantially trained on. Regresses base's already-low Devanagari CER by ~19Γ β do not use for that.
Benchmark results (iter-8 corrected measurement, 2026-09-14)
Re-measured after fixing an eval bug that hid iter-7a's real OCRBench V2 performance (fixed-prompt "document parsing." was dropping OCRBench V2's per-task questions).
| Benchmark | Metric | iter-7a | base olmOCR-2-7B-1025 | delta |
|---|---|---|---|---|
| OCRBench V2 (300 samples, per-sample prompts) | F1 β | 0.499 | 0.093 | 5.4Γ |
OmniDocBench (250 pages, research_report @2048 tokens) |
F1 β | 0.293 | 0.291 | +0.7% |
| himalaya_500 (500 Devanagari word crops) | CER β | 4.463 (446%) β | 14.32 (1432%) β | β |
For OCRBench V2, iter-7a lands at ~71% of Interfaze's 0.707 target and ~78% of Gemini-3.5-Flash's 0.639. It is currently Enclave's strongest result on this benchmark by a wide margin.
For Devanagari, iter-7a is worse than iter-3 (enclavelabs/enclave-scribe-devanagari,
CER 0.175) and iter-4 (CER 0.231) by an order of magnitude β do not use.
Recommended use
Good fits:
- Answering questions asked about scanned documents ("What is the total amount?", "What date is on this receipt?", "Who is the sender?").
- English document short-answer extraction where the model has a specific question to answer.
- Downstream fine-tuning on further English document VQA data.
Bad fits β use a different model:
- Non-Latin scripts (Devanagari, Chinese, Arabic, Japanese, Korean, β¦).
For Devanagari, use
enclavelabs/enclave-scribe-devanagari(iter-3), CER 0.175 onhimalaya_500. - Long-form page transcription ("extract this entire page as markdown"). Iter-7a's OmniDocBench F1 (0.293) is only marginally above base olmOCR-7B (0.291); base is essentially as good and doesn't come with the Devanagari regression.
- Structural output (bounding boxes, confidence scores, layout). Not trained for it.
Prompting
Feed each sample its actual per-task question in the prompt slot, e.g.:
from transformers import AutoProcessor, AutoModelForVision2Seq
from peft import PeftModel
BASE = "allenai/olmOCR-2-7B-1025"
ADAPTER = "Enclave-Labs-Inc/olmocr-2-iter7a-vqa"
processor = AutoProcessor.from_pretrained(BASE)
model = AutoModelForVision2Seq.from_pretrained(BASE, torch_dtype="bfloat16", device_map="auto")
model = PeftModel.from_pretrained(model, ADAPTER)
messages = [{
"role": "user",
"content": [
{"type": "image", "image": "receipt.jpg"},
{"type": "text", "text": "What is the total amount?"},
],
}]
Passing the fixed prompt "document parsing." (as some pipelines do by
default) will produce weaker results β iter-7a's advantage is on tasks
with real per-sample questions.
Training
- Base model:
allenai/olmOCR-2-7B-1025(Qwen2.5-VL-7B fine-tuned by AI2 for OCR). - Method: fresh LoRA (r=32, Ξ±=64, dropout=0.05), 2 epochs, LR 1.0e-4,
bf16, gradient checkpointing, liger kernel,
max_pixels=200704(448Β²),max_length=4096. - Data (~10k filtered samples): DocVQA (
HuggingFaceM4/DocumentVQA, short-answer mode), XFUND (7 langs), IDL-WDS (historical documents), iter-4 Devanagari replay (~500). URL rot dropped the originally-planned TextOCR + HierText sources β see the report for details. - Hardware: g5.4xlarge on-demand (1Γ A10G 24GB), us-east-1.
- Cost: ~$48 as-shipped.
Full details, deviations from plan, and postmortem in
reports/iter7a/README.md.
Framework versions
- PEFT 0.20.0
- transformers 4.55.4
- torch 2.7.0+cu128
Iteration lineage
- iter-3 β Devanagari word-level specialist (
enclavelabs/enclave-scribe-devanagari). 93Γ CER improvement over base onhimalaya_500. - iter-4 β Devanagari page-level (unpublished; superseded by iter-3 for most Devanagari uses because iter-4 regressed slightly).
- iter-7a β this model. Scoped English VQA specialist. Do not use for Devanagari.
- iter-9 (in progress) β extend iter-7a's recipe with expanded VQA /
OCR-VQA corpus, targeting Interfaze / Gemini on OCRBench V2. If
successful will be published as
Enclave-Labs-Inc/enclave-scribe-iter9.
License
MIT. Same as the base allenai/olmOCR-2-7B-1025.
Citation
If you use this model, please cite the base model and the EnclaveScribe repository:
@misc{enclave-scribe-iter7a-vqa,
title={EnclaveScribe iter-7a: Scoped English document VQA LoRA on olmOCR-2-7B-1025},
author={Enclave Labs},
year={2026},
url={https://huggingface.co/Enclave-Labs-Inc/olmocr-2-iter7a-vqa}
}
- Downloads last month
- 17