Nuqta-Arabic-OCR 4B GGUF: offline Arabic OCR for laptops and desktops
This repo holds the GGUF build of Nuqta-Arabic-OCR-4B for llama.cpp. It reads Arabic documents, copies the tashkeel that is printed and almost never adds any, and runs fully offline on Mac, Windows and Linux. It needs about 6 GB of RAM at 4-bit, so it suits laptops and desktops; for phones use Nuqta-Arabic-OCR-0.8B-GGUF.
Website and guides: https://salahalhaismawi.github.io/nuqta-ocr/ · run Arabic OCR offline
| File | Size | Use |
|---|---|---|
nuqta-ocr-4b-Q4_K_M.gguf |
2.9 GB | laptops and desktops (recommended) |
nuqta-ocr-4b-Q8_0.gguf |
4.8 GB | closest to the original |
nuqta-ocr-4b-mmproj-f16.gguf |
672 MB | vision encoder, always needed next to the model |
Accuracy against the full model
We scored Q4_K_M (llama.cpp, CPU) against the bf16 model (vLLM) with the same prompts, image sizes and scoring: greedy decoding, KITAB-Bench normalisation, character error rate (lower is better), on the same pages.
| KITAB-Bench set (first 20 images) | bf16 | Q4_K_M GGUF |
|---|---|---|
| Hindawi (book pages with tashkeel, at the recommended input size) | 0.026 | 0.022 |
| PATS-OCR (printed lines) | 0.011 | 0.014 |
| SynthesizeAR (synthetic lines) | 0.034 | 0.034 |
| Adab (poetry word crops) | 0.226 | 0.229 |
All differences are within page-to-page noise. On the full benchmarks the 4B model scores KITAB-Bench CER 0.106 and Misraj-DocOCR MARS 82.8, first on both: see the main model card.
Run it
llama-mtmd-cli -m nuqta-ocr-4b-Q4_K_M.gguf --mmproj nuqta-ocr-4b-mmproj-f16.gguf \
--image page.png --temp 0 -c 8192 --image-max-tokens 4096 \
-p "Transcribe the Arabic text in this image exactly as written. Include only the diacritics (tashkeel) that are visible in the image."
Or serve an OpenAI-compatible API (one image plus the prompt per request):
llama-server -m nuqta-ocr-4b-Q4_K_M.gguf --mmproj nuqta-ocr-4b-mmproj-f16.gguf \
-c 8192 --image-max-tokens 4096 --temp 0 --port 8080
Any app built on a recent llama.cpp with multimodal support (mtmd, Qwen3.5 architecture) can load these two
files. Tested with llama.cpp commit 5aeac37 (October 2026).
Three settings that matter
- Use the recommended input size. Enlarge page-shaped images (long side ≤ 2× short side, short side ≥ 450 px) to about 2.4 megapixels, the model's training size; leave line and word crops as they are; never go above 2.4 MP.
- Pass
--image-max-tokens 4096, so llama.cpp doesn't shrink the page again. - Set
-c 8192. It is enough for a full page and keeps memory at about 6 GB.
The model may begin its answer with an empty <think></think> block: drop it.
On your phone, as an app
nuqta-ocr/apps has ready-made Android and iPhone apps that download these files once and read pages fully offline (first words in about 2 seconds with the 0.8B). They handle the input size, read the page in strips and use the right settings for you.
In chat apps (PocketPal, LM Studio, Jan, Ollama…)
These files carry Nuqta's reading settings, so llama.cpp-based apps pick them up without any setup: greedy decoding
(temperature 0, no repeat penalty), thinking switched off in the chat template, and a minimum image size of about
1 megapixel so small pages and photos are enlarged before reading. With no settings at all, this raised a small page
from 92.9% to 98.4% of characters right in our test, and stopped the model from writing <think>.
Some apps override these with their own defaults. If the output looks wrong, set them by hand:
| Setting | Value |
|---|---|
| Temperature | 0 |
| Top-K | 1 |
| Repeat / frequency / presence penalty | off (1.0 / 0 / 0) |
| Context length | 8192 |
| Max new tokens | 4096 |
| System prompt | none |
| Thinking / reasoning | off |
Send the image together with one of the prompts below in the same message. For the best accuracy on whole pages, use the nuqta-ocr library, which also applies the recommended input size.
Prompts
| Mode | Prompt |
|---|---|
| as written (default) | Transcribe the Arabic text in this image exactly as written. Include only the diacritics (tashkeel) that are visible in the image. |
| no tashkeel | Transcribe the Arabic text in this image without any diacritics. |
| Markdown (tables, headings) | Convert this document to Markdown: headings, paragraphs, lists and tables in reading order. Include only the diacritics visible in the image. |
Speed
On a laptop CPU alone (8 threads, no GPU), Q4_K_M reads a full 2.4 MP book page in about 2.5 minutes. With a GPU (Metal on Apple silicon, CUDA or Vulkan) it is much faster; for high-volume serving use the original model with vLLM (about 1.8 s per page, batched).
Contributors
Salah AlHaismawi · Mohamed Saleh Tulib · Ahmed ElSayed Mohamed Ibrahim
License
Apache 2.0, like the original model. Built on Qwen3.5-4B.
Citation
@misc{nuqta_ocr_2026,
title = {Nuqta OCR: Accurate Arabic Document OCR with Faithful Tashkeel},
author = {Salah AlHaismawi and Mohamed Saleh Tulib and Ahmed ElSayed Mohamed Ibrahim},
year = {2026},
url = {https://huggingface.co/SalahALHaismawi/Nuqta-Arabic-OCR-4B-GGUF}
}