Image-Text-to-Text
MLX
Safetensors
qwen3_5
ocr
pdf
markdown
layout
8bit
quantized
conversational
8-bit precision
Instructions to use jwindle47/chandra-ocr-2-8bit-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use jwindle47/chandra-ocr-2-8bit-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("jwindle47/chandra-ocr-2-8bit-mlx") config = load_config("jwindle47/chandra-ocr-2-8bit-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
- LM Studio
- Pi new
How to use jwindle47/chandra-ocr-2-8bit-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 "jwindle47/chandra-ocr-2-8bit-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": "jwindle47/chandra-ocr-2-8bit-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use jwindle47/chandra-ocr-2-8bit-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 "jwindle47/chandra-ocr-2-8bit-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 jwindle47/chandra-ocr-2-8bit-mlx
Run Hermes
hermes
| library_name: mlx | |
| license: other | |
| license_name: modified-openrail-m | |
| license_link: LICENSE | |
| tags: | |
| - ocr | |
| - markdown | |
| - layout | |
| - mlx | |
| - 8bit | |
| - quantized | |
| pipeline_tag: image-text-to-text | |
| base_model: datalab-to/chandra-ocr-2 | |
| # Chandra OCR 2 — 8-bit MLX Quantization | |
| This is an **8-bit MLX quantization** of [datalab-to/chandra-ocr-2](https://huggingface.co/datalab-to/chandra-ocr-2), converted for efficient inference on Apple Silicon using the [mlx-vlm](https://github.com/Blaizzy/mlx-vlm) framework. | |
| **Original model**: [datalab-to/chandra-ocr-2](https://huggingface.co/datalab-to/chandra-ocr-2) | |
| **Quantization**: 8-bit affine, group size 64 | |
| **Framework**: MLX (Apple Silicon) | |
| **Modified files**: The weight file (`model.safetensors`) has been quantized from the original bfloat16 weights. All other files are unchanged from the original repository. | |
| ## About Chandra OCR 2 | |
| Chandra 2 is a state-of-the-art OCR model from [Datalab](https://www.datalab.to) that outputs markdown, HTML, and JSON. It is highly accurate at extracting text from images and PDFs while preserving layout information. | |
| ### What's New in Chandra 2 | |
| - 85.9% olmocr bench score (SOTA), 77.8% multilingual bench score (12% improvement over Chandra 1) | |
| - Significant improvements to math, tables, and complex layouts | |
| - Improved layout, especially on wider documents | |
| - Significantly better image captioning | |
| - 90+ language support with major accuracy gains | |
| ### Features | |
| - Convert documents to markdown, HTML, or JSON with detailed layout information | |
| - Excellent handwriting support | |
| - Reconstructs forms accurately, including checkboxes | |
| - Strong performance with tables, math, and complex layouts | |
| - Extracts images and diagrams with captions and structured data | |
| - Support for 90+ languages | |
| ## Usage with mlx-vlm | |
| ### Installation | |
| ```bash | |
| pip install mlx-vlm | |
| ``` | |
| ### Inference | |
| ```python | |
| from mlx_vlm import load | |
| from mlx_vlm.utils import generate_step | |
| from PIL import Image | |
| model, processor = load("jacobwindle/chandra-ocr-2-8bit-mlx") | |
| image = Image.open("document.png") | |
| prompt = "Convert this image to markdown." | |
| output = generate_step( | |
| model=model, | |
| processor=processor, | |
| image=image, | |
| prompt=prompt, | |
| max_tokens=4096, | |
| ) | |
| print(output) | |
| ``` | |
| ### Command-line | |
| ```bash | |
| python -m mlx_vlm.generate --model jacobwindle/chandra-ocr-2-8bit-mlx --image document.png --prompt "Convert this image to markdown." --max-tokens 4096 | |
| ``` | |
| ## Quantization Details | |
| | Parameter | Value | | |
| |-----------|-------| | |
| | Bits | 8 | | |
| | Group size | 64 | | |
| | Mode | Affine | | |
| | Original dtype | bfloat16 | | |
| | Quantized size | ~4.8 GB | | |
| Converted using: | |
| ```bash | |
| python -m mlx_vlm.convert --model datalab-to/chandra-ocr-2 --mlx-path models/chandra-ocr-2-8bit -q --q-bits 8 | |
| ``` | |
| ## Attribution | |
| This is a derivative work of [datalab-to/chandra-ocr-2](https://huggingface.co/datalab-to/chandra-ocr-2). The original model was created by [Datalab](https://www.datalab.to). The weights in this repository have been modified (8-bit quantized) from the original release. All credit for the model architecture, training data, and original weights belongs to the original authors. | |
| ## License | |
| This model inherits the **modified OpenRAIL-M license** from the original [datalab-to/chandra-ocr-2](https://huggingface.co/datalab-to/chandra-ocr-2). As a derivative work, the same license terms apply, including the share-alike requirement (Section III, paragraph 8) and use-based restrictions (Attachment A). | |
| Key restrictions from the original license: | |
| - Free for research, personal use, and startups under $2M funding/revenue | |
| - Cannot be used competitively with the Datalab API | |
| - Derivative works must retain the same license | |
| For broader commercial licensing, see [Datalab pricing](https://www.datalab.to/pricing). |