Instructions to use bxespinozar/OXR-1.0-mlx-bf16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use bxespinozar/OXR-1.0-mlx-bf16 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("bxespinozar/OXR-1.0-mlx-bf16") config = load_config("bxespinozar/OXR-1.0-mlx-bf16") # 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 (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}
}
- Downloads last month
- 544
Quantized
Model tree for bxespinozar/OXR-1.0-mlx-bf16
Base model
SoMarkAI/OXR-1.0