OXR-1.0 — MLX (bf16)
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 | bfloat16 (same as the original weights) |
| Size | 2.8 GB |
| Converted with | mlx_vlm.convert (--dtype bfloat16) |
Usage
Requires mlx-vlm 0.7.11 or later (OXR support landed in PR #2560):
pip install -U "mlx-vlm>=0.7.11"
mlx_vlm.generate --model bxespinozar/OXR-1.0-mlx-bf16 --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-bf16")
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): token-identical to the PyTorch reference on text, formula, handwriting and the 3,603-token table; code and whole-page outputs identical to an independently validated MLX implementation.
- 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).
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}
}