Image-to-Text
MLX
mlx-vision
ocr
apple-silicon
speculative-decoding
dspark
deepseek-ocr
glm-ocr
vision-language-model
Instructions to use will702/mlx-vision with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use will702/mlx-vision with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir mlx-vision will702/mlx-vision
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
File size: 1,959 Bytes
7c1b44a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | ---
title: mlx-vision
emoji: 👁️
colorFrom: blue
colorTo: green
sdk: static
pinned: false
license: mit
tags:
- mlx
- ocr
- apple-silicon
- speculative-decoding
- dspark
- deepseek-ocr
- glm-ocr
- vision-language-model
- region:us
library_name: mlx-vision
pipeline_tag: image-to-text
---
# mlx-vision
**DSpark-style faster OCR on Apple Silicon (MLX).**
Speculative decoding for OCR VLMs — DeepSeek-OCR-2, GLM-OCR, Unlimited-OCR.
Vision/OCR counterpart to [mlx-dspark](https://github.com/ARahim3/mlx-dspark).
| Resource | Link |
|----------|------|
| **Code** | [github.com/will702/mlx-vision](https://github.com/will702/mlx-vision) |
| **Agents** | [AGENTS.md](https://github.com/will702/mlx-vision/blob/main/AGENTS.md) · [llms.txt](https://github.com/will702/mlx-vision/blob/main/llms.txt) |
| **Weights used** | [`mlx-community/DeepSeek-OCR-2-8bit`](https://huggingface.co/mlx-community/DeepSeek-OCR-2-8bit), [`GLM-OCR`](https://huggingface.co/mlx-community/GLM-OCR-bf16), [`Unlimited-OCR`](https://huggingface.co/baidu/Unlimited-OCR) |
## Install
```bash
pip install git+https://github.com/will702/mlx-vision.git
# with PDF support:
pip install "mlx-vision[pdf] @ git+https://github.com/will702/mlx-vision.git"
```
## Quick start
```python
from mlx_vision import ocr
result = ocr("document.png", model="deepseek-ocr-2", mode="auto")
print(result.text)
```
```bash
mlx-vision -m deepseek-ocr-2 -i page.png --mode dspark -v
mlx-vision -m deepseek-ocr-2 -i doc.pdf --page 0 --dpi 200
```
## Modes
- `baseline` — mlx-vlm generate
- `dspark` / `lookup` — training-free semi-AR draft + confidence schedule (OCR DSpark weights not public yet)
- `dflash` / `eagle3` / `mtp` — neural speculation via mlx-vlm (`--drafter`)
- `auto` — best available path
## Cite
See [CITATION.cff](https://github.com/will702/mlx-vision/blob/main/CITATION.cff). Related paper: [DSpark](https://arxiv.org/abs/2607.05147).
## License
MIT
|