Instructions to use Vignesh-5756/Unlimited-OCR-mlx-fp16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Vignesh-5756/Unlimited-OCR-mlx-fp16 with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("Vignesh-5756/Unlimited-OCR-mlx-fp16") config = load_config("Vignesh-5756/Unlimited-OCR-mlx-fp16") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
Unlimited-OCR (DeepSeek-OCR) — MLX, fp16
Apple MLX conversion of baidu/Unlimited-OCR,
a 3.3B-parameter vision-language model for document OCR, layout parsing, and
grounding (SAM ViT-B + CLIP ViT-L encoders → linear projector → DeepSeek-V2 MoE
LLM). Runs natively on Apple Silicon — no PyTorch or CUDA at inference time.
Converted with convert.py
from the upstream bfloat16 checkpoint: MoE experts stacked to
[n_experts, out, in] for batched gather_mm, Conv2d weights transposed
OIHW → OHWI, stored in float16.
Use
git clone https://github.com/vignesh-kumar-v/mlx-ocr-unlimited
cd mlx-ocr-unlimited && pip install -r requirements.txt
# Single image
python ocr.py --model Vignesh-5756/Unlimited-OCR-mlx-fp16 --image doc.png --prompt "<image>Free OCR."
# Multi-page PDF -> markdown
python ocr.py --model Vignesh-5756/Unlimited-OCR-mlx-fp16 --pdf paper.pdf --output out.md
Fidelity & performance
Compared against the reference PyTorch/CUDA implementation on a 15-page arXiv
PDF: 0.99 output similarity in fp16 (this repo), 0.9998 when run with
--dtype fp32. Decodes at ~175 tok/s (single image) / ~120 tok/s (multi-page)
on an M5 Pro, ~6 GB resident in fp16.
Notes
- Load the tokenizer with
PreTrainedTokenizerFast(the project's loader does this):AutoTokenizermisroutes this checkpoint toLlamaTokenizerand corrupts the byte-level BPE. - The checkpoint omits
norm_topk_prob, which must default toFalse.
Code, tests, and implementation notes: https://github.com/vignesh-kumar-v/mlx-ocr-unlimited
- Downloads last month
- 46
Quantized
Model tree for Vignesh-5756/Unlimited-OCR-mlx-fp16
Base model
baidu/Unlimited-OCR