Instructions to use playstonex/Unlimited-OCR-2-4bit-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use playstonex/Unlimited-OCR-2-4bit-mlx 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("playstonex/Unlimited-OCR-2-4bit-mlx") config = load_config("playstonex/Unlimited-OCR-2-4bit-mlx") # 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
- Atomic Chat
Unlimited-OCR-2 — 4-bit MLX
A 4-bit MLX quantization of baidu/Unlimited-OCR-2, Baidu ERNIE's OCR / document-parsing vision-language model.
- Size: ~1.9 GB (from ~6.4 GB bf16).
- Quantization: affine, 4-bit, group size 64. Experts quantized; the SAM
vision branch kept in bf16 (
quantized_sam=false). Seequantization.jsonfor the exact per-tensor layout. - Runs on: Apple Silicon via MLX.
Architecture note
Unlimited-OCR-2 uses a custom architecture (page2d two-axis RoPE, DASH
block-sparse attention, stacked quantized MoE experts, a SAM+CLIP vision front
end). It is not loadable by generic mlx-vlm / transformers auto classes.
A native MLX-Swift decoder for it ships in
MlxOCRKit and is numerically aligned
with the Python/MLX reference.
Usage — Swift (MlxOCRKit)
minerukit uocr2 --model ./Unlimited-OCR-2-4bit-mlx --image page.png \
--prompt "Multi page parsing." --max-tokens 512
Output follows the model's block protocol
(<PAGE><BLOCK>type[x0, y0, x1, y1]<FORK> ...).
License & attribution
MIT, inherited from the base model. This repo only re-quantizes the weights to 4-bit MLX; all model credit goes to the original authors (Baidu). See the original model card.
- Downloads last month
- -
4-bit
Model tree for playstonex/Unlimited-OCR-2-4bit-mlx
Base model
baidu/Unlimited-OCR-2