Views
No views yet
| File | Size | Description |
|---|---|---|
LightOnOCR-2-1B-f16.gguf | 1.1 GB | Language model (F16, highest quality) |
LightOnOCR-2-1B-Q8_0.gguf | 610 MB | Language model (Q8_0, near-lossless) |
LightOnOCR-2-1B-Q4_K_M.gguf | 378 MB | Language model (Q4_K_M, balanced) |
LightOnOCR-2-1B-mmproj-f16.gguf | 781 MB | Vision encoder + projector (required) |
Note: The vision encoder (mmproj) should NOT be quantized as it significantly impacts image understanding quality.
1git clone https://github.com/ggml-org/llama.cpp
2cd llama.cpp
3cmake -B build
4cmake --build build --config Release1# Using F16 (highest quality)
2./build/bin/llama-mtmd-cli \
3 -m LightOnOCR-2-1B-f16.gguf \
4 --mmproj LightOnOCR-2-1B-mmproj-f16.gguf \
5 --image your-document.png \
6 -ngl 99 \
7 -c 4096 \
8 -n 1000 \
9 --temp 0.2 \
10 --repeat-penalty 1.15 \
11 --repeat-last-n 128
12
13# Using Q4_K_M (smaller, faster)
14./build/bin/llama-mtmd-cli \
15 -m LightOnOCR-2-1B-Q4_K_M.gguf \
16 --mmproj LightOnOCR-2-1B-mmproj-f16.gguf \
17 --image your-document.png \
18 -ngl 99 \
19 -c 4096 \
20 -n 1000 \
21 --temp 0.2 \
22 --repeat-penalty 1.15
23
24## Recommended Parameters
25
26| Parameter | Value | Description |
27|-----------|-------|-------------|
28| `--temp` | 0.2 | Official recommended temperature |
29| `--repeat-penalty` | 1.15 | Prevents repetition (1.1-1.2 optimal) |
30| `--repeat-last-n` | 128 | Tokens to consider for penalty |
31| `-n` | 1000 | Max output tokens (avoid >1500) |
32| `-ngl` | 99 | GPU layers (use all for best speed) |
33
34### Parameter Notes
35
36- **repeat-penalty**: Values above 1.2 may reduce OCR quality
37- **-n (max tokens)**: Limiting to ~1000 prevents repetition at end of long documents
38- **Image preprocessing**: Render PDFs to PNG at 1540px longest edge
39
40## Performance (Apple M4 Max)
41
42| Metric | Value |
43|--------|-------|
44| Image encoding | ~435 ms |
45| Image decoding | ~45 ms |
46| Prompt processing | ~1,850 tokens/s |
47| Text generation | ~228 tokens/s |
48| Total time (1000 tokens) | ~8-10 sec |
49
50## Quantization Details
51
52| Format | Bits/Weight | Size Reduction | Quality Impact |
53|--------|-------------|----------------|----------------|
54| F16 | 16 | - | Baseline |
55| Q8_0 | 8 | 45% | Nearly lossless |
56| Q4_K_M | 4.5 | 66% | Minimal |
57
58## Credits
59
60- Original model: [lightonai/LightOnOCR-2-1B](https://huggingface.co/lightonai/LightOnOCR-2-1B)
61- GGUF conversion: Using [llama.cpp](https://github.com/ggml-org/llama.cpp) convert tools
62- Paper: [LightOnOCR: A 1B End-to-End Multilingual Vision-Language Model](https://arxiv.org/pdf/2601.14251)
63
64## License
65
66Apache License 2.0 (same as original model)
67
68## Citation
69
70```bibtex
71@misc{lightonocr2_2026,
72 title = {LightOnOCR: A 1B End-to-End Multilingual Vision-Language Model for State-of-the-Art OCR},
73 author = {Said Taghadouini and Adrien Cavaill\`{e}s and Baptiste Aubertin},
74 year = {2026},
75 howpublished = {\url{https://arxiv.org/pdf/2601.14251}}
76}