Skip to page content
SAVRN
Search Plan a project

Open-weight model · Image and text to text

LightOnOCR-3-4B-ONNX

by superPDF superpdf/LightOnOCR-3-4B-ONNX

LightOnOCR-3-4B-ONNX is an open-weight model for image and text to text from superPDF, released under Apache License 2.0. It has 262,144-token context. Its published files total 3.8 GB.

lightonai/LightOnOCR-3-4B by LightOn, converted to ONNX for superPDF, where it powers high-accuracy reading in the command-line tool and MCP server (--model 4b, model: "4b"). It runs with Transformers.js on ONNX Runtime (WebGPU), in the browser and in Node.

Parameters—
Context262,144
Weights1.1 MB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads—

Model Card

By superPDF, published under apache-2.0, revision 9f8d405bbad1.

lightonai/LightOnOCR-3-4B by LightOn, converted to ONNX for superPDF, where it powers high-accuracy reading in the command-line tool and MCP server (--model 4b, model: "4b"). It runs with Transformers.js on ONNX Runtime (WebGPU), in the browser and in Node. from the unused multi-token-prediction layer). Every weight in those graphs is recomputed from LightOn's weights and written at the same place, so the graphs themselves are unchanged. asymmetric with zero points, computed with ONNX Runtime's own quantizematmul4bits); vision encoder float16. Norm weights are stored as 1 + w and the gated delta net's A as -exp(Alog), as the builder expects. - Converted by superPDF with the converter below.…

Read superPDF's full model card

lightonai/LightOnOCR-3-4B by LightOn, converted to ONNX for superPDF, where it powers high-accuracy reading in the command-line tool and MCP server (--model 4b, model: "4b"). It runs with Transformers.js on ONNX Runtime (WebGPU), in the browser and in Node.

Conversion

  • Base weights: lightonai/LightOnOCR-3-4B at revision b71010f095dc3735de7ee6b9969bff8f8f50b39a (safetensors, bfloat16).
  • Graphs: onnx-community/Qwen3.5-4B-ONNX-OPT at revision 2e351a8a534116289140e31f351c5e9790cae2db (LightOnOCR-3 uses the Qwen3.5 architecture; the configurations match apart from the unused multi-token-prediction layer). Every weight in those graphs is recomputed from LightOn's weights and written at the same place, so the graphs themselves are unchanged.
  • Quantisation: decoder and token embeddings 4-bit (ONNX Runtime MatMulNBits / GatherBlockQuantized, block size 32, asymmetric with zero points, computed with ONNX Runtime's own quantize_matmul_4bits); vision encoder float16. Norm weights are stored as 1 + w and the gated delta net's A as -exp(A_log), as the builder expects.
  • Converter: scripts/models/convert-lightonocr.py in the superPDF repository (to be published with the open-source release).
  • Converted by superPDF with the converter below.

config.json is LightOn's with the transformers.js_config block of the onnx-community repository; tokenizer and processor files are the onnx-community ones (same Qwen3.5 vocabulary).

Use

Transcription with boxes (LightOn's grounding prompt), greedy decoding, pages rendered with their longest side at 1540 to 2048 pixels:

import { AutoProcessor, Qwen3_5ForConditionalGeneration, RawImage } from '@huggingface/transformers';
const id = 'superpdf/LightOnOCR-3-4B-ONNX';
const processor = await AutoProcessor.from_pretrained(id);
const model = await Qwen3_5ForConditionalGeneration.from_pretrained(id, { device: 'webgpu', dtype: { embed_tokens: 'q4', decoder_model_merged: 'q4', vision_encoder: 'fp16' } });
const prompt = processor.apply_chat_template([{ role: 'user', content: [{ type: 'image' }, { type: 'text', text: 'grounding' }] }], { add_generation_prompt: true, enable_thinking: false });
const inputs = await processor(prompt, await RawImage.read('page.png'));
const output = await model.generate({ ...inputs, max_new_tokens: 6144, do_sample: false });

Files and SHA-256

File Bytes SHA-256
chat_template.jinja 7756 a4aee8afcf2e0711942cf848899be66016f8d14a889ff9ede07bca099c28f715
config.json 3317 9573132702b2289ca6ea4615faae0ede96f70f19e7f9064c50acfd1768954dca
generation_config.json 204 8ce51af0baac298c116b7db144efe1ebd78b0b792d084002634fd3ed63f4d515
onnx/decoder_model_merged_q4.onnx 771821 327c73159341412221e3a38425fdeaa100efbf95901b976f2f3e52eaede929f0
onnx/decoder_model_merged_q4.onnx_data 2097044992 b38f3bb43eea40c4151c6e31de26bbe96e6828991db834172c3b7b28ce0ea3dc
onnx/decoder_model_merged_q4.onnx_data_1 600476160 181e556427080e7c1257d9c0ecd70142d42a4c0121e176fdb421f75f8dd8be54
onnx/embed_tokens_q4.onnx 857 b72feb6947db92d643f70abc6a4d3e5398a9535470a97685e3b1ab3b05047146
onnx/embed_tokens_q4.onnx_data 407244800 56bd464ce04b3975f83af6f664f140c94862f00bc6f3cbb8a02b173fc45f6ade
onnx/vision_encoder_fp16.onnx 345836 fb2e2684c8c5914299a100fba847831a11911d8c0458079c27f5ab26142a2f55
onnx/vision_encoder_fp16.onnx_data 671943680 b3235ddcd3dfef9b4c1b9a9276840f2da247ed26b0ddedea100114d30957fed0
preprocessor_config.json 336 6a970fd06f30e6943b3e2c14d5d3b42d49b06cf99b99103d56689bef462d90f8
processor_config.json 1300 14932921ca485d458a04dafd8069fbb0a4505622a48208d19ed247115801385b
tokenizer.json 19226111 89da80cc6689bef4d90cc1028249436975ffb0814618f1d93c65310e05801a9b
tokenizer_config.json 10061 5d35dd3e7792dcbc1082a2f4eeb10731d78b5c7824c004c230af860b1d44e214

Also in SHA256SUMS (check with shasum -a 256 -c SHA256SUMS).

Licence

Apache License 2.0, as the original model. See LICENSE and NOTICE. Scores and model details: see LightOn's model card for lightonai/LightOnOCR-3-4B.

Configuration

Architecture
Qwen3_5ForConditionalGeneration
Context length (tokens)
262,144
Layers
32
Hidden size
2,560
Feed-forward size
9,216
Attention heads
16
Key/value heads
4
Head dimension
256
Vocabulary size
248,320
Model type
qwen3_5

Identity and Version

Repository
superpdf/LightOnOCR-3-4B-ONNX
Publisher
superPDF
Task
Image and text to text
Modality
Image and text
Library
transformers.js
Parameters
Not stated by the source
Languages
ocr
Revision
9f8d405bbad1820841318b659c922b63f0e01ebc
First published
2026-10-12
Last updated
2026-10-12

Files and Weights

19 files, 3.8 GB in total. The weights are 3 files totalling 1.1 MB in onnx.

Weights3 files · 1.1 MB
Configuration4 files · 5.2 KB
Tokenizer2 files · 19.2 MB
Documentation3 files · 16.6 KB
Other6 files · 3.8 GB
Repository1 file · 1.9 KB
Every file
FileTypeSizeSHA-256
onnx/decoder_model_merged_q4.onnxWeights771.8 KB 327c73159341
onnx/embed_tokens_q4.onnxWeights857 B b72feb6947db
onnx/vision_encoder_fp16.onnxWeights345.8 KB fb2e2684c8c5
config.jsonConfiguration3.3 KB —
generation_config.jsonConfiguration204 B —
preprocessor_config.jsonConfiguration336 B —
processor_config.jsonConfiguration1.3 KB —
LICENSEDocumentation11.4 KB —
NOTICEDocumentation704 B —
README.mdDocumentation4.5 KB —
SHA256SUMSOther1.5 KB —
chat_template.jinjaOther7.8 KB —
onnx/decoder_model_merged_q4.onnx_dataOther2.1 GB b38f3bb43eea
onnx/decoder_model_merged_q4.onnx_data_1Other600.5 MB 181e55642708
onnx/embed_tokens_q4.onnx_dataOther407.2 MB 56bd464ce04b
onnx/vision_encoder_fp16.onnx_dataOther671.9 MB b3235ddcd3df
.gitattributesRepository1.9 KB —
tokenizer.jsonTokenizer19.2 MB 89da80cc6689
tokenizer_config.jsonTokenizer10.1 KB —

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
1.1 MB
Download from superPDF

Released by superPDF through its official repository on Hugging Face. Read the license.

Built From

  • Derived from lightonai/LightOnOCR-3-4B
  • Quantized from lightonai/LightOnOCR-3-4B

Memory Requirements

PrecisionWeights in memory
As published1.1 MB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About LightOnOCR-3-4B-ONNX

Can I use LightOnOCR-3-4B-ONNX commercially?

Yes. LightOnOCR-3-4B-ONNX is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is LightOnOCR-3-4B-ONNX's context length?

262,144 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Non-uniform GGUF quantizations of a 512-expert MoE, produced with GSQ and RCO, with a vision projector for multimodal use. This repository provides GGUF quantizations of Qwen3.8-Flash-Next at four sizes, together with the model's vision projector (mmproj) for multimodal use. In contrast to uniform quantization, which applies a single quantization type to all weight tensors, each model here assigns a separate quantization type to every tensor. The assignment is obtained by a gradient-based search that allocates precision according to per-tensor sensitivity, subject to a total size budget. The resulting files are standard GGUF and run unmodified in llama.cpp, Ollama, and LM Studio. A…

Open weights apache-2.0 gguf

Model · Image and text to text

Huihui-Qwen3.8-27B-abliterated-GGUF

Huihui.ai

This is an uncensored version of Qwen/Qwen3.8-27B created with abliteration (see remove-refusals-with-transformers to know more about it). This is a crude, proof-of-concept implementation to remove refusals from an LLM model without using TransformerLens. The newly added Huihui-Qwen3.8-27B-abliterated-Underdog-Saluki series come from ConwayResearch/Underdog-Saluki-27B-1.0 and ukisai/Swift-1.5-Qwen3.8-27B-GSQ-RCO-GGUF. Only layers 22 to 52 (0-based indexing) have been ablated, while the other layers remain unablated. It may come with a small disclaimer warning. Due to ConwayResearch/Underdog-Saluki-27B-1.0 not providing an imatrix file, we will attempt to perform ablation by mixing the GGUF…

Open weights apache-2.0 transformers

Qwen3.8-27B uncensored by HauhauCS 0/465 Refusals. This is the Aggressive variant: direct answers, no refusal behavior, and minimal preamble on hard prompts. Every text GGUF preserves Qwen3.8's native NextN head, and this release adds HauhauCS FastMTP: a specific acceleration sidecar qualified across the complete quant lineup at maximum native context. Vision is included through the separate BF16 projector. No changes to datasets or intended capabilities. This release preserves Qwen3.8-27B's text, reasoning, agentic, image, and video capabilities while applying the HauhauCS Aggressive uncensoring profile. Pick Aggressive when you specifically want the model to get to the answer without…

Open weights apache-2.0

Model · Image and text to text

Qwen3.8-27B-iMatrix-NVFP4-MTP-GGUF

Michał Piszczek

I built this quant because the ready-made FP4 file answered the wrong question. It was fast, but on my short WikiText-2 control it scored 6.4949 PPL. Plain Q40 scored 6.3798. The first higher-quality hybrid went too far the other way: good perplexity, 34.19 tok/s, and no comfortable room for 256K plus vision. This is the build that survived both gates. It is a 17.1 GB, 5.01 BPW mixed-precision GGUF of Qwen/Qwen3.8-27B. It keeps large, tolerant matrices in native NVFP4 and spends more bits on selected attention, Gated DeltaNet, and late FFN tensors. The trained MTP layer remains embedded in the same GGUF. This is not a fine-tune. I built the private calibration workload from 5,472 messages…

Open weights apache-2.0

Model · Image and text to text

Qwen3.8-27B-GGUF

GGML Org

Run it in the Llama app: https://llama.app - https://huggingface.co/Qwen/Qwen3.8-27B - https://huggingface.co/incoai/Qwen3.8-27B-DFlash2 - add info

Open weights apache-2.0

lm mmap --lazy-mode on -ngl 99 -c 32768 \ mmproj-Qwen3.8-Flash-Next-BF16.gguf --local-dir. llama-mtmd-cli -m IQ3S/Qwen3.8-Flash-Next-GSQ-RCO-abliterated-IQ3S-00001-of-00002.gguf \ --mmproj mmproj-Qwen3.8-Flash-Next-BF16.gguf -lm mmap --lazy-mode on \ -md mtp-Qwen3.8-Flash-Next-Q80.gguf --draft-max 4 -lm mmap --lazy-mode on -ngl 99 -lm mmap --lazy-mode on keeps the n-gram table memory-mapped on disk: it is 28.8 GB and one row is read per token. Shard 1 wants to be resident (VRAM or RAM); shard 2 is fine on an SSD. The vision projector is a standard clip GGUF shared with the upstream tiers, 0.91 GB. Native context is 262,144 tokens and the KV cache grows with it, so start at -c 32768 and work…

Open weights apache-2.0 gguf