Downloads · 30 days
75
100% of all-time downloads
Konthee/dots-mocr-w4a16-nvfp4
dots-mocr-w4a16-nvfp4 is a image-text-to-text model from Konthee. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for transformers.
This repository is a NVIDIA Model Optimizer quantized derivative of:
Downloads · 30 days
75
100% of all-time downloads
All-time downloads
75
Public
Parameters
2.4B
4.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.2 GB · 100%
How the weights are stored.
BF161.7B · 73%
From the Hugging Face model README
This repository is a NVIDIA Model Optimizer quantized derivative of:
dots-studio/dots.mocr
The checkpoint is intended for NVIDIA GPU deployment with runtimes that understand the ModelOpt Unified Hugging Face quantization format, especially vLLM.
This is a post-training-quantized model. Validate OCR/layout accuracy on your own document set before production use.
| Component | Precision / behavior |
|---|---|
| Language-model weights | NVFP4 |
| Language-model activations | BF16 / FP16 (A16) |
| Vision tower | High precision / unquantized |
| Other multimodal components | High precision / unquantized |
| KV cache | Unquantized |
| ModelOpt qformat | w4a16_nvfp4 |
| Export quantization algorithm | W4A16_NVFP4 |
| PTQ language attention implementation | eager |
| PTQ vision attention implementation | sdpa |
This variant quantizes language-model weights to NVFP4 but keeps language-model activations at 16-bit precision. It is less aggressive than W4A4 and is a useful accuracy-oriented baseline for OCR while still reducing weight memory.
ModelOpt's plain PTQ path for VLMs is used here intentionally.
The language model is quantized while the vision encoder and non-language multimodal components are kept at high precision.
No vision-quantization recipe is used.
W4A16_NVFP4 is weight-only and does not require an activation calibration forward pass. ModelOpt hf_ptq.py still constructs a dataloader and consumes one preview batch before quantization, so this build supplies one tiny local JSONL sample (calib_size=1, batch_size=1) only for that CLI plumbing. It is not activation calibration. The build intentionally uses ModelOpt plain PTQ qformat mode so the VLM language model is quantized while the vision branch remains high precision.
Build settings:
dots-studio/dots.mocr2565121eagersdpaflash_attn import does not block model loading.The following versions were used to produce this checkpoint:
2.8.0+cu1284.57.60.36.20.0.1.dev1+g87f7d1432Source revisions:
dots.mocr commit:
23f3e5612fb8066d4034d5ecfc8f33a9243533eb
NVIDIA Model Optimizer commit:
87f7d1432f6dccffe67069c84b9a18877a35019d
A recent vLLM release can load ModelOpt NVFP4 and
W4A16_NVFP4 checkpoints using:
modelopt_fp4
If this Hugging Face repository is private:
export HF_TOKEN="hf_xxx"
Then run:
docker run --rm \
--gpus all \
--ipc=host \
--shm-size=16g \
-p 8000:8000 \
-e HF_TOKEN \
vllm/vllm-openai:latest \
--model Konthee/dots-mocr-w4a16-nvfp4 \
--quantization modelopt_fp4 \
--tensor-parallel-size 1 \
--gpu-memory-utilization 0.90 \
--chat-template-content-format string \
--served-model-name model \
--trust-remote-code
For a public repository, -e HF_TOKEN can be omitted.
For W4A16_NVFP4, vLLM uses the ModelOpt FP4 runtime path. Current vLLM documentation says auto backend selection resolves to Marlin for W4A16_NVFP4. With BF16 activations, recent vLLM versions can also use --linear-backend flashinfer_cutedsl; benchmark both on your RTX 5090 and keep the faster/stable option for your workload.
The PTQ staging checkpoint uses sdpa for the
Transformers vision module so that flash-attn is not required during export.
Recent vLLM releases have a native DotsOCRForCausalLM implementation, so
this Transformers-only staging choice is not the vLLM attention backend.
It is generally better to let vLLM select the linear backend automatically first.
Do not force a backend unless you have benchmarked it on your specific GPU and vLLM version.
curl http://localhost:8000/v1/models
Expected API endpoint:
http://localhost:8000/v1
dots.mocr should be used with the prompts provided by the upstream project for best document parsing behavior.
Images can be supplied as an HTTP URL or a base64 data URL.
Example request body:
{
"model": "model",
"messages": [
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "data:image/png;base64,<BASE64_IMAGE>"
}
},
{
"type": "text",
"text": "<DOTS_MOCR_PROMPT>"
}
]
}
],
"temperature": 0,
"max_tokens": 4096
}
For document parsing, use the prompt definitions provided by the upstream dots.mocr project rather than replacing them with a generic OCR prompt.
Useful upstream locations include:
dots_mocr/utils/prompts.py
demo/demo_vllm.py
dots_mocr/model/inference.py
This checkpoint intentionally uses the following structure:
Image
|
v
Vision tower
high precision
|
v
Multimodal projection / integration
high precision
|
v
Language model
W4A16 NVFP4
|
v
Output tokens
This allows the vision side of dots.mocr to remain at higher precision while reducing the memory / compute cost of the language model.
Quantization can affect:
For production use, compare this checkpoint against the original BF16 model on a representative validation set.
Recommended comparison:
BF16 original
vs
W4A16 NVFP4
vs
W4A4 NVFP4
Useful metrics include:
Tested on 2026-09-23 against the original dots-studio/dots.mocr endpoint using the
latest Runpod concurrency sweep (20260923T112115437972Z). This checkpoint is the W4A16
variant: language-model weights use NVFP4 and activations remain BF16/FP16.
| Per-endpoint concurrency | Successful pages | Throughput (pages/s) | vs. FP16 throughput | p95 latency | CER vs. FP16 | Agreement (1 − CER) |
|---|---|---|---|---|---|---|
| 16 | 320/320 (100.00%) | 0.902 | +5.7% | 24.138 s | 0.5367% | 99.4633% |
| 32 | 319/320 (99.69%) | 1.004 | +2.2% | 48.840 s | 0.7256% | 99.2744% |
| 64 | 318/320 (99.38%) | 0.920 | +4.6% | 101.977 s | 7.9066% | 92.0934% |
Across the three disjoint 320-page sets, this model completed 957/960 requests (99.69%). The character-weighted CER was 3.0440% (96.9560% agreement) over successful FP16 reference outputs.
assets/fixtures. The three concurrency levels used disjoint image sets to avoid
vLLM prefix-cache reuse; within a level, all three model endpoints received the same
encoded images.InternalServerError on the same sample
ID. At concurrency 64, this model had one InternalServerError and one
MODEL_OUTPUT_TRUNCATED result; no retries were made.For this run, W4A16 at concurrency 32 was the recommended balance: 99.2744% agreement and 1.004 pages/s (+2.2% vs. FP16 at the same concurrency). Concurrency 16 had the lowest CER and p95 latency for W4A16, with 0.902 pages/s. Consider validating on a representative, human-labeled OCR set before selecting a production configuration.
Native NVFP4 acceleration is most relevant on NVIDIA hardware with native FP4 support, especially Blackwell-class GPUs.
Runtime behavior on other NVIDIA GPU generations depends on the kernels available in the installed vLLM version.
This repository is a quantized derivative of:
dots-studio/dots.mocr
The original model's license and usage terms continue to apply.
Review the upstream model repository before redistribution or production use.