Instructions to use npario/OXR-1.0-mlx-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use npario/OXR-1.0-mlx-8bit 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("npario/OXR-1.0-mlx-8bit") config = load_config("npario/OXR-1.0-mlx-8bit") # 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
OXR-1.0 — MLX (8-bit)
MLX conversion of SoMarkAI/OXR-1.0, the document-parsing model from the SoMark team (#1 on olmOCR-Bench, OmniDocBench and DocParsingBench), for Apple Silicon via mlx-vlm.
This is an unofficial community conversion. All credit for the model goes to SoMark; see the official repository.
| Base model | SoMarkAI/OXR-1.0 (1.3B, BF16) |
| Precision | 8-bit affine (group size 64) for the Qwen3 decoder; the visual tokenizer (ViT, visual head, visual embedding table) stays in bfloat16 |
| Size | 2.1 GB |
| Converted with | mlx_vlm.convert (-q --q-bits 8 --q-group-size 64) |
Usage
Requires an mlx-vlm build with OXR support
(PR #2560 pending; until it is released install the branch
pip install git+https://github.com/bxespinozar/mlx-vlm@add-oxr).
mlx_vlm.generate --model bxespinozar/OXR-1.0-mlx-8bit --image formula.png \
--prompt "Recognize the formula of the image into KaTex format." \
--max-tokens 2048 --temperature 0.0
from mlx_vlm import generate, load
from mlx_vlm.prompt_utils import apply_chat_template
model, processor = load("bxespinozar/OXR-1.0-mlx-8bit")
prompt = apply_chat_template(processor, model.config,
"Recognize the table of the image into html format.", num_images=1)
print(generate(model, processor, prompt, image=["table.png"], max_tokens=8192,
temperature=0.0).text)
Task prompts used by the official pipeline:
| Task | Prompt |
|---|---|
| Text / handwriting | Recognize the content of the image. |
| Formula (LaTeX) | Recognize the formula of the image into KaTex format. |
| Table (HTML) | Recognize the table of the image into html format. |
| Code | Recognize the code of the image into markdown code format. |
| Chemical structure | Recognize the chemical structure of the image into SMILES. |
| Whole page | Recognize the whole page content of the image. |
For full-document parsing (layout analysis → per-block recognition → reading order), run the
official OXR pipeline with an OpenAI-compatible MLX server in
place of vLLM; the layout model weights are in the base repository (layout_analysis/).
Validation
- Greedy outputs compared with the reference PyTorch implementation (fp32, CPU) on text, LaTeX formula, code, handwriting, a whole page (1,859 tokens) and a complex HTML table (3,603 tokens): identical to the bf16 conversion on 5 of 6 samples (incl. the 1,859- and 3,603-token outputs); one handwriting sample differs by one word.
- Full OXR pipeline with an MLX backend on olmOCR-Bench (official
olmocr==0.4.27evaluator, 596 pages / 3,849 tests, bf16): 87.6 ± 1.0 overall vs 87.84 reported for OXR-1.0 — ArXiv 91.2 (92.76), Headers/Footers 95.8 (94.34), Long Tiny Text 91.0 (90.95), Multi Column 84.1 (85.18), Old Scans 58.9 (59.32), Old Scans Math 89.3 (89.74), Tables 93.3 (93.05), Baseline 97.1 (97.35).
The olmOCR-Bench numbers above were measured with bf16 weights. The 8-bit decoder is ~35% faster on long outputs; no full benchmark run was done for it yet — prefer the bf16 repo when exactness matters.
License
Distributed under the OXR Open Source License
(Apache-2.0 with additional terms), included in this repository as LICENSE and NOTICE. In
short: commercial use is permitted below USD 2M total funding and USD 2M annual revenue (otherwise a
commercial license from SoMark is required), online services must prominently identify
"SoMark OXR", and offering a hosted API that competes with SoMark's is not permitted. Read the full
terms before use.
Citation
@misc{somark2026oxr,
author = {{SoMark}},
title = {{OXR-1.0}},
url = {https://github.com/SoMarkAI/OXR},
note = {GitHub repository}
}
- Downloads last month
- -
8-bit
Model tree for npario/OXR-1.0-mlx-8bit
Base model
SoMarkAI/OXR-1.0