Image-Text-to-Text
MLX
Safetensors
English
Chinese
qwen3_5
mlx-vlm
quantized
apple-silicon
ocr
document-parsing
markdown
tables
formulas
conversational
8-bit precision
Instructions to use sahilchachra/ovisocr2-int8-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use sahilchachra/ovisocr2-int8-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("sahilchachra/ovisocr2-int8-mlx") config = load_config("sahilchachra/ovisocr2-int8-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
- Pi
How to use sahilchachra/ovisocr2-int8-mlx with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "sahilchachra/ovisocr2-int8-mlx"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "sahilchachra/ovisocr2-int8-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use sahilchachra/ovisocr2-int8-mlx with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "sahilchachra/ovisocr2-int8-mlx"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default sahilchachra/ovisocr2-int8-mlx
Run Hermes
hermes
- OpenClaw new
How to use sahilchachra/ovisocr2-int8-mlx with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "sahilchachra/ovisocr2-int8-mlx"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "sahilchachra/ovisocr2-int8-mlx" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload int8 MLX quantization
Browse files
README.md
CHANGED
|
@@ -79,12 +79,13 @@ regions in reading order. Each variant ran the model's own documented OCR prompt
|
|
| 79 |
truth with two metrics: character-level similarity (`difflib.SequenceMatcher`) and word
|
| 80 |
recall (fraction of ground-truth words present in the output).
|
| 81 |
|
| 82 |
-
| Variant | Mean similarity | Mean word recall | Degenerate outputs | Agreement with FP16 |
|
| 83 |
-
|---|---|---|---|---|
|
| 84 |
-
| fp16 | 63.4% | 92.9% | 0/15 | — |
|
| 85 |
-
| mxfp4 | 63.2% | 93.1% | 0/15 | 96.5% |
|
| 86 |
-
|
|
| 87 |
-
|
|
|
|
|
| 88 |
|
| 89 |
- **Word recall (~93%) is the more reliable signal here** — character-level similarity is
|
| 90 |
pulled down by cosmetic LaTeX-formatting differences (e.g. the model emits `$...$` compact
|
|
@@ -93,16 +94,20 @@ recall (fraction of ground-truth words present in the output).
|
|
| 93 |
equation block, sim≈3%) confirmed the model's output was in fact a faithful, correctly
|
| 94 |
ordered transcription — the metric penalizes LaTeX style, not content.
|
| 95 |
- **Zero degenerate outputs** (no repetition loops, no empty/near-empty generations) across
|
| 96 |
-
all
|
| 97 |
-
- All
|
| 98 |
-
time — quantization barely perturbs the transcription, even at 4-bit.
|
| 99 |
-
-
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
| 101 |
|
| 102 |
|
| 103 |
## Other MLX variants
|
| 104 |
|
| 105 |
- [ovisocr2-mxfp4-mlx](https://huggingface.co/sahilchachra/ovisocr2-mxfp4-mlx)
|
|
|
|
| 106 |
- [ovisocr2-mxfp8-mlx](https://huggingface.co/sahilchachra/ovisocr2-mxfp8-mlx)
|
| 107 |
- [ovisocr2-int8-mlx](https://huggingface.co/sahilchachra/ovisocr2-int8-mlx)
|
| 108 |
|
|
|
|
| 79 |
truth with two metrics: character-level similarity (`difflib.SequenceMatcher`) and word
|
| 80 |
recall (fraction of ground-truth words present in the output).
|
| 81 |
|
| 82 |
+
| Variant | Bits/weight | Disk size | Mean similarity | Mean word recall | Degenerate outputs | Agreement with FP16 | Eval time (15 pages) |
|
| 83 |
+
|---|---|---|---|---|---|---|---|
|
| 84 |
+
| fp16 | 16 | 1.6 GB | 63.4% | 92.9% | 0/15 | — | 212.4s |
|
| 85 |
+
| mxfp4 | 5.643 | 599 MB | 63.2% | 93.1% | 0/15 | 96.5% | 138.1s |
|
| 86 |
+
| int4 | 5.863 | 622 MB | 63.5% | 93.2% | 0/15 | 96.1% | 140.7s |
|
| 87 |
+
| mxfp8 | 9.168 | 958 MB | 63.0% | 92.9% | 0/15 | 97.7% | 166.8s |
|
| 88 |
+
| int8 | 9.389 | 980 MB | 63.9% | 93.1% | 0/15 | 99.2% | 165.1s |
|
| 89 |
|
| 90 |
- **Word recall (~93%) is the more reliable signal here** — character-level similarity is
|
| 91 |
pulled down by cosmetic LaTeX-formatting differences (e.g. the model emits `$...$` compact
|
|
|
|
| 94 |
equation block, sim≈3%) confirmed the model's output was in fact a faithful, correctly
|
| 95 |
ordered transcription — the metric penalizes LaTeX style, not content.
|
| 96 |
- **Zero degenerate outputs** (no repetition loops, no empty/near-empty generations) across
|
| 97 |
+
all 75 generations (15 pages × 5 variants, including the fp16 baseline).
|
| 98 |
+
- **All four quantized variants agree with FP16's output at the character level 96–99% of the
|
| 99 |
+
time** — quantization barely perturbs the transcription, even at 4-bit (both mxfp4 and int4).
|
| 100 |
+
- **4-bit vs 8-bit is a wash on quality here**: mxfp4/int4 score essentially the same word
|
| 101 |
+
recall as mxfp8/int8 on this OCR task, while being ~35% faster and roughly 40% smaller on
|
| 102 |
+
disk — for OvisOCR2 specifically, the 4-bit variants are the better default.
|
| 103 |
+
- mxfp4 and int4 are nearly identical to each other in every metric; pick whichever fits your
|
| 104 |
+
serving stack (MX FP4 vs plain affine int4) — there's no accuracy reason to prefer one.
|
| 105 |
|
| 106 |
|
| 107 |
## Other MLX variants
|
| 108 |
|
| 109 |
- [ovisocr2-mxfp4-mlx](https://huggingface.co/sahilchachra/ovisocr2-mxfp4-mlx)
|
| 110 |
+
- [ovisocr2-int4-mlx](https://huggingface.co/sahilchachra/ovisocr2-int4-mlx)
|
| 111 |
- [ovisocr2-mxfp8-mlx](https://huggingface.co/sahilchachra/ovisocr2-mxfp8-mlx)
|
| 112 |
- [ovisocr2-int8-mlx](https://huggingface.co/sahilchachra/ovisocr2-int8-mlx)
|
| 113 |
|