Instructions to use btbtyler09/shrew-ocr-preview-GPTQ-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Local Apps Settings
- vLLM
How to use btbtyler09/shrew-ocr-preview-GPTQ-8bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "btbtyler09/shrew-ocr-preview-GPTQ-8bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "btbtyler09/shrew-ocr-preview-GPTQ-8bit", "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/btbtyler09/shrew-ocr-preview-GPTQ-8bit
- SGLang
How to use btbtyler09/shrew-ocr-preview-GPTQ-8bit 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 "btbtyler09/shrew-ocr-preview-GPTQ-8bit" \ --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": "btbtyler09/shrew-ocr-preview-GPTQ-8bit", "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 "btbtyler09/shrew-ocr-preview-GPTQ-8bit" \ --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": "btbtyler09/shrew-ocr-preview-GPTQ-8bit", "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 btbtyler09/shrew-ocr-preview-GPTQ-8bit with Docker Model Runner:
docker model run hf.co/btbtyler09/shrew-ocr-preview-GPTQ-8bit
shrew-ocr-preview-GPTQ-8bit
INT8 quantization of shrew-ocr-preview for vLLM, v0.5: page image in, structured JSON out. Language model only (sym, group_size 32, desc_act=False); vision tower and projectors stay bf16. Benchmarks, schema, decoding and input contract are on the main card. The training mix of the base model includes synthetic document renders (see Attribution).
New in v0.5: the v0.5 weights of the main card (two further SFT stages plus a loop edit), with the quantization recipe unchanged. The OmniDocBench and localization numbers on the main card are for bf16; none were measured on this INT8 build.
Preview: weights update in place under this name. Pin the tag
v0.5or a commit (revision=) to reproduce.
Quick start
Needs shrew-server โฅ 0.5.0. Image: btbtyler09/vllm-rocm-gfx908:v0.27.2rc1.dev was the validated image for v0.4.1; validated on vLLM 0.27.2; not on newer images. v0.5 boot check: not completed. On btbtyler09/vllm-rocm-gfx908:v0.28.0rc10.dev-q38fn both this package and, as a control, the v0.4.1 package fail at engine start with qzeros shape mismatch, so that image does not load these GPTQ checkpoints. This package has the same tensor names, shapes and dtypes (0 differences in 1,924 tensors) and the same quantization settings as v0.4.1, so use the v0.27.2 image above; these v0.5 weights have not yet been booted on any image.
vllm serve btbtyler09/shrew-ocr-preview-GPTQ-8bit --revision v0.5 --trust-remote-code --dtype half \
--served-model-name shrew-ocr-preview \
--max-model-len 32768 --limit-mm-per-prompt '{"image":1}' --no-enable-prefix-caching
VLM_URL=http://localhost:8000 VLM_MODEL=shrew-ocr-preview shrew serve
curl -X POST localhost:8080/v1/convert -F file=@doc.pdf -F pipeline_mode=structured
--dtype half, not bfloat16: the fast GPTQ kernel path is fp16-only, measured output-neutral for an earlier release of this model.- vLLM v0.27+ needed for multimodal, partially quantized checkpoints; it detects the layout itself.
- Decode with temperature 0.4 and presence_penalty 0.3, never greedy; output budgets are on the main card.
INT8 parity
Earlier releases, reference server at its shipped defaults, single GPU, --dtype half. No parity measurement was made for v0.5; its boot check is above.
| release | pages | first pass clean | retries | failed | notes |
|---|---|---|---|---|---|
| v0.4.1 | 134 frozen OmniDocBench | 134/134 | 0 | 0 empty | one pass, gate count only; v0.4 GPTQ on the same pages 133/134 |
| v0.4 | 24 (4 documents) | 24/24 | 0 | 0 | 119 s |
| v0.3, INT8 vs bf16 | 215 paired | 92.6 % vs 93.5 % | empty 6.5 % vs 5.6 % | single RTX 3060, --gpu-memory-utilization 0.85 --max-num-seqs 4 |
- v0.3 detail: coerced 0.9 % vs 0.9 %; repetition aborts 4.7 % vs 4.2 %; on 199 pages both parsed, text similarity median 1.000, 93.5 % of pairs โฅ 0.90,
section_typeagreement 0.986. - Two re-runs of the same INT8 weights differ by the same margins (2 of 40 hard pages flip), so the gap is serving nondeterminism, not quantization.
- Corpus-wide INT8 retrieval was not re-measured for v0.3, v0.4, v0.4.1 or v0.5. The v0.2 card measured INT8 at or above bf16 on 5 of 7 evidence types and +0.25 % domain perplexity.
- ~1.8ร serving throughput, 7.9 GB VRAM idle at those flags on a 12 GB card (measured on an earlier release).
- Which pages loop is sensitive to serving numerics (tensor- vs data-parallel layout,
torch.compile, kernels); the loop rate stayed constant.
Quantization
GPTQModel 6.0.3, bits 8, group size 32, symmetric, FOEM error compensation, MSE-tuned (mse 2.0), 176 calibration sequences (up to 8,192 tokens each). Scope: the language model's linear layers only; the vision tower stays bf16. The recipe is unchanged from v0.3 through v0.5.
Files
| file | size | for |
|---|---|---|
model-00001-of-00002.safetensors, model-00002-of-00002.safetensors |
5.1 GB | INT8 language model, bf16 vision |
quantize_config.json |
small | GPTQ settings |
config, tokenizer and modeling.py files |
small | model definition; needs --trust-remote-code |
SHA256SUMS.v0.5-GPTQ-8bit.txt |
small | verify downloads |
Other variants: main card.
Limitations
- Dense broadsheets, low-resolution dense scans and pages the vision tower cannot resolve can still loop or stop early; the guard makes these detectable failures.
- v0.5 splits large tables (and occasionally figures) into stacked strips more often than v0.4.x, has more far false positives on figures and tables, and lower figure recall (bf16 numbers on the main card); the loop edit's effect is not statistically significant on held-out pages.
- Retrieval, reliability, reading order on broadsheets and INT8 parity were not re-run for v0.5.
- Character accuracy on dense Chinese is below Latin print. Cyrillic and Arabic were not evaluated: treat as unsupported. Handwriting has limited evaluation (a separate 300-page check) and no published score.
- Boxes come from model-generated labels: pad them outward when cropping; edges are not pixel-exact.
- One page per request: no cross-page state, so assemble multi-page documents downstream.
Changelog
Per-version detail is on the main card.
- v0.5 (2026-11-14): quantized from the v0.5 weights, same recipe; not yet booted on any image (see Quick start).
- v0.4.1 (2026-11-06): the loop-fix weights, same recipe; 134/134 above.
Attribution
Text from the following OpenStax books (Rice University and named co-authors), each retrieved 2026-10-11 under the Creative Commons Attribution 4.0 International licence (https://creativecommons.org/licenses/by/4.0/), is used as prose in some synthetic document renders, and as original page images in a tables-and-formulas training set. Only the books whose licence was CC BY 4.0 at retrieval were used; the CC BY-NC-SA books were never fetched. No OpenStax photographs or third-party credited figures are used; OpenStax's own graphs, diagrams and tables appear only as printed on the original pages described in the Changes note.
Changes: some rows use passages excerpted and re-typeset into synthetic document renders (tables, layout and surrounding content are our own); other rows are original OpenStax book pages (CC BY 4.0), full pages rasterised at 200 dpi and otherwise unmodified, with the page text, tables, graphs, diagrams and illustrations as printed, each such row carrying its own attribution (book title, licence, licence URL, page); for every row the chunk boundaries and titles, summaries, keywords and descriptions are ours; photographs and figures credited to a third party (courtesy, flickr/wikimedia/getty-style credits) are refused and not used, while OpenStax's own tables and graphs that cite a data source are kept as printed with that citation.
- Algebra and Trigonometry, OpenStax, Rice University (openstax.org/details/books/algebra-and-trigonometry) - CC BY 4.0
- American Government, OpenStax, Rice University (openstax.org/details/books/american-government) - CC BY 4.0
- American Government 2e, OpenStax, Rice University (openstax.org/details/books/american-government-2e) - CC BY 4.0
- American Government 3e, OpenStax, Rice University (openstax.org/details/books/american-government-3e) - CC BY 4.0
- Anatomy and Physiology, OpenStax, Rice University (openstax.org/details/books/anatomy-and-physiology) - CC BY 4.0
- The AP Physics Collection, OpenStax, Rice University (openstax.org/details/books/college-physics-ap-courses) - CC BY 4.0
- Astronomy, OpenStax, Rice University (openstax.org/details/books/astronomy) - CC BY 4.0
- Biology, OpenStax, Rice University (openstax.org/details/books/biology) - CC BY 4.0
- Chemistry, OpenStax, Rice University (openstax.org/details/books/chemistry) - CC BY 4.0
- Chemistry: Atoms First, OpenStax, Rice University (openstax.org/details/books/chemistry-atoms-first) - CC BY 4.0
- College Algebra, OpenStax, Rice University (openstax.org/details/books/college-algebra) - CC BY 4.0
- College Algebra with Corequisite Support, OpenStax, Rice University (openstax.org/details/books/college-algebra-corequisite-support) - CC BY 4.0
- College Physics, OpenStax, Rice University (openstax.org/details/books/college-physics) - CC BY 4.0
- Elementary Algebra, OpenStax, Rice University (openstax.org/details/books/elementary-algebra) - CC BY 4.0
- Intermediate Algebra, OpenStax, Rice University (openstax.org/details/books/intermediate-algebra) - CC BY 4.0
- Introduction to Intellectual Property, OpenStax, Rice University (openstax.org/details/books/introduction-intellectual-property) - CC BY 4.0
- Introduction to Sociology 2e, OpenStax, Rice University (openstax.org/details/books/introduction-sociology-2e) - CC BY 4.0
- Introductory Business Statistics, OpenStax, Rice University (openstax.org/details/books/introductory-business-statistics) - CC BY 4.0
- Introductory Statistics, OpenStax, Rice University (openstax.org/details/books/introductory-statistics) - CC BY 4.0
- Physics, OpenStax, Rice University (openstax.org/details/books/physics) - CC BY 4.0
- Prealgebra, OpenStax, Rice University (openstax.org/details/books/prealgebra) - CC BY 4.0
- Precalculus, OpenStax, Rice University (openstax.org/details/books/precalculus) - CC BY 4.0
- Principles of Economics, OpenStax, Rice University (openstax.org/details/books/principles-economics) - CC BY 4.0
- Principles of Economics 2e, OpenStax, Rice University (openstax.org/details/books/principles-economics-2e) - CC BY 4.0
- Principles of Macroeconomics, OpenStax, Rice University (openstax.org/details/books/principles-macroeconomics) - CC BY 4.0
- Principles of Macroeconomics 2e, OpenStax, Rice University (openstax.org/details/books/principles-macroeconomics-2e) - CC BY 4.0
- Principles of Macroeconomics for APยฎ Courses, OpenStax, Rice University (openstax.org/details/books/principles-macroeconomics-ap-courses) - CC BY 4.0
- Principles of Macroeconomics for APยฎ Courses 2e, OpenStax, Rice University (openstax.org/details/books/principles-macroeconomics-ap-courses-2e) - CC BY 4.0
- Principles of Microeconomics, OpenStax, Rice University (openstax.org/details/books/principles-microeconomics) - CC BY 4.0
- Principles of Microeconomics 2e, OpenStax, Rice University (openstax.org/details/books/principles-microeconomics-2e) - CC BY 4.0
- Principles of Microeconomics for APยฎ Courses, OpenStax, Rice University (openstax.org/details/books/principles-microeconomics-ap-courses) - CC BY 4.0
- Principles of Microeconomics for APยฎ Courses 2e, OpenStax, Rice University (openstax.org/details/books/principles-microeconomics-ap-courses-2e) - CC BY 4.0
- Psychology, OpenStax, Rice University (openstax.org/details/books/psychology) - CC BY 4.0
- Statistics, OpenStax, Rice University (openstax.org/details/books/statistics) - CC BY 4.0
- Fรญsica universitaria volumen 1, OpenStax, Rice University (openstax.org/details/books/fรญsica-universitaria-volumen-1) - CC BY 4.0
License and citation
Apache-2.0. Base: ibm-granite/granite-vision-4.1-4b (Apache 2.0).
@misc{shrew-ocr-preview,
title = {shrew-ocr-preview: page image to structured JSON},
author = {btbtyler09},
year = {2026},
howpublished = {\url{https://huggingface.co/btbtyler09/shrew-ocr-preview}},
note = {Version v0.5}
}
- Downloads last month
- 115
Model tree for btbtyler09/shrew-ocr-preview-GPTQ-8bit
Base model
ibm-granite/granite-vision-4.1-4b