NVFP4A16 (4-bit weight, 16-bit activation) quantization of
datalab-to/chandra-ocr-2
produced with
llm-compressor
and packed as
compressed-tensors
for native vLLM inference.
For the original model description, intended uses, accuracy benchmarks
(olmOCR-bench, 90-language) and license terms, see the upstream card:
https://huggingface.co/datalab-to/chandra-ocr-2.
1# recipe.yaml (shipped in this repo)
2default_stage:
3 default_modifiers:
4 QuantizationModifier:
5 targets: [Linear]
6 ignore:
7 - lm_head
8 - 're:.*visual.*' # keep vision tower in bf16
9 - 're:.*linear_attn.*' # keep linear-attn fp16
10 scheme: NVFP4A16
Test bed: RTX PRO 6000 Blackwell Max-Q (96 GB), 14-page Vietnamese
financial-statement PDF, vLLM 0.19.1, max-num-seqs=128,
max-num-batched-tokens=32768, kv-cache=fp8.
1vllm serve dangvansam/chandra-ocr-2-NVFP4A16 \
2 --served-model-name chandra \
3 --max-model-len 16384 \
4 --max-num-seqs 128 \
5 --max-num-batched-tokens 32768 \
6 --kv-cache-dtype fp8 \
7 --gpu-memory-utilization 0.92 \
8 --enable-prefix-caching \
9 --enable-chunked-prefill \
10 --trust-remote-code \
11 --mm-processor-kwargs '{"min_pixels": 3136, "max_pixels": 6291456}'
1# Client — call exactly like the bf16 original
2from openai import OpenAI
3import base64, pathlib
4
5client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
6img_b64 = base64.b64encode(pathlib.Path("page.png").read_bytes()).decode()
7
8resp = client.chat.completions.create(
9 model="chandra",
10 messages=[{
11 "role": "user",
12 "content": [
13 {"type": "image_url",
14 "image_url": {"url": f"data:image/png;base64,{img_b64}"}},
15 {"type": "text", "text": "<ocr_layout>"},
16 ],
17 }],
18 max_tokens=12000,
19 temperature=0.0,
20)
21print(resp.choices[0].message.content)
The vision tower is left in bf16, so
transformers ≥ 5.2 loads this
checkpoint identically to the upstream — only the LLM-side weights are
4-bit. Use the snippet from the
upstream card,
replacing
"datalab-to/chandra-ocr-2" with
"dangvansam/chandra-ocr-2-NVFP4A16".
Inherits the upstream
OpenRAIL-M license from
datalab-to/chandra-ocr-2. Free for research, personal use, and
startups <$2M;
not for use competing with Datalab's hosted API.
For broader commercial use see
Datalab pricing.
1@misc{chandra_ocr_2,
2 author = {Datalab},
3 title = {Chandra OCR 2},
4 year = {2026},
5 url = {https://huggingface.co/datalab-to/chandra-ocr-2}
6}