Downloads · 30 days
262
6% of all-time downloads
sahilchachra/unlimited-ocr-mxfp8-mlx
unlimited-ocr-mxfp8-mlx is a image-text-to-text model from sahilchachra. 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 mlx. The card lists the license as mit.
MLX quantization of baidu/Unlimited-OCR, a 3B vision-language OCR model that pushes DeepSeek-OCR one step further (one-shot, long-horizon document parsing). This variant uses Block float MX FP8 quantization (9.19 effe…
Downloads · 30 days
262
6% of all-time downloads
All-time downloads
4.6K
Public
Parameters
3.3B
3.8 GB on disk
Likes
15
Public
Click a slice to open those files.
.safetensors3.8 GB · 100%
How the weights are stored.
U322.9B · 88%
From the Hugging Face model README
MLX quantization of baidu/Unlimited-OCR, a 3B vision-language OCR model that pushes DeepSeek-OCR one step further (one-shot, long-horizon document parsing). This variant uses Block float MX FP8 quantization (9.19 effective bits/weight).
Quantized by: sahilchachra
Note on effective bpw: mlx-vlm's quantizers only act on the language tower's linear weights. The vision encoder and embeddings stay at bf16, so the on-disk size averages the quantized text decoder with the full-precision vision components.
Evaluated on Apple M4 Pro (24 GB) with MLX on the FUNSD test set (50 scanned form images).
| Block float MX FP8 | FP16 baseline | |
|---|---|---|
| FUNSD CER ↓ | 1.4556 | 1.7588 |
| Decode tok/s | 205.6 | 146.2 |
| Peak memory | 4.98 GB | 7.62 GB |
| Disk size | 3660 MB | 6464 MB |
| Variant | CER ↓ | Tok/s | Memory | Disk |
|---|---|---|---|---|
| FP16 (baseline) | 1.7588 | 146.2 | 7.62 GB | 6464 MB |
| MXFP8 | 1.4556 | 205.6 | 4.98 GB | 3660 MB |
| Int8 | 1.5720 | 205.2 | 5.06 GB | 3747 MB |
| MXFP4 | 2.3944 | 251.9 | 3.61 GB | 2260 MB |
| Int4 | 2.2879 | 252.6 | 3.7 GB | 2347 MB |
pip install mlx-vlm
from mlx_vlm import load, generate
model, processor = load("sahilchachra/unlimited-ocr-mxfp8-mlx")
# Single-image OCR (Gundam mode)
response = generate(model, processor,
prompt="<image>document parsing.",
image="path/to/document.jpg",
max_tokens=4096, verbose=True)
Unlimited-OCR uses the DeepSeek-OCR prompt vocabulary. The prompt is just an instruction;
prefix it with <|grounding|> whenever you also want bounding boxes for what was read.
| Task | Prompt |
|---|---|
| Document → Markdown (layout-aware, with boxes) | `<image>< |
| Plain text OCR (just the text, no layout) | <image>Free OCR. |
| OCR with bounding boxes | `<image>< |
| Native parse | <image>document parsing. |
| Parse a figure / chart / diagram | <image>Parse the figure. |
| Describe the image (general VQA) | <image>Describe this image in detail. |
Note: Unlike the GGUF/llama.cpp workflow, mlx-vlm requires the literal
<image>token in the prompt and a separateimage=argument pointing to the file path.
With <|grounding|>, the model interleaves the recognized text with detection boxes:
<|det|>title [37, 64, 464, 132]<|/det|>INVOICE #2026-0623
<|det|>text [37, 194, 350, 247]<|/det|>Bill To: Sahil Chachra
<|det|>text [37, 483, 329, 543]<|/det|>Total Due: $44.00
Each [x1, y1, x2, y2] is the bounding box (top-left → bottom-right) of that span. Drop the
<|det|>...<|/det|> tags if you only want the text, or parse them to overlay boxes / build a layout.
Tip — long documents: For multi-page scans, run page-by-page and concatenate.
The original baidu/Unlimited-OCR uses model_type: "unlimited-ocr" which is not directly
recognized by mlx-vlm. This quantized variant ships with the config already patched:
config.json → "model_type": "deepseekocr" (was "unlimited-ocr"), auto_map removedprocessor_config.json → "processor_class": "DeepseekOCRProcessor" (was "UnlimitedOCRHFProcessor")No manual patching needed — just load() and go.
If you are converting the original model yourself, apply these two changes before running
mlx_vlm convert.
| Model | Variant | Disk |
|---|---|---|
| sahilchachra/unlimited-ocr-4bit-mlx | Affine int4 | 2347 MB |
| sahilchachra/unlimited-ocr-8bit-mlx | Affine int8 | 3747 MB |
| sahilchachra/unlimited-ocr-mxfp4-mlx | Block float MX FP4 | 2260 MB |
| sahilchachra/unlimited-ocr-mxfp8-mlx | Block float MX FP8 ← this model | 3660 MB |
| Model | Notes |
|---|---|
| sahilchachra/Unlimited-OCR-GGUF | K-quants & i-quants (BF16 → IQ2_M). Requires llama.cpp PR #17400. |