Instructions to use jefflaporte/chandra-ocr-2-MLX-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use jefflaporte/chandra-ocr-2-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("jefflaporte/chandra-ocr-2-MLX-8bit") config = load_config("jefflaporte/chandra-ocr-2-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
- Pi
How to use jefflaporte/chandra-ocr-2-MLX-8bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jefflaporte/chandra-ocr-2-MLX-8bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "jefflaporte/chandra-ocr-2-MLX-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use jefflaporte/chandra-ocr-2-MLX-8bit 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 "jefflaporte/chandra-ocr-2-MLX-8bit"
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 jefflaporte/chandra-ocr-2-MLX-8bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use jefflaporte/chandra-ocr-2-MLX-8bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "jefflaporte/chandra-ocr-2-MLX-8bit"
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 "jefflaporte/chandra-ocr-2-MLX-8bit" \ --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"
Chandra OCR 2 — MLX 8-bit
An MLX 8-bit quantization of Chandra OCR 2 by Datalab, for Apple Silicon.
These files are modified: the language model's weights are quantized from the original BF16 checkpoint. The vision tower is unchanged (BF16), and so are the tokenizer, chat template and processor configuration. All credit for the model belongs to Datalab; see the original model card for what Chandra does and how it was evaluated.
Chandra OCR 2 is built on Qwen3.5-4B by the Qwen team,
Alibaba Cloud, licensed under the Apache License 2.0, a copy of which is included as
LICENSE-Qwen.
License and use restrictions
This derivative is distributed under the same license as the original, included as
LICENSE (a modified OpenRAIL-M). Its use restrictions apply to these files too,
including the commercial restrictions in Attachment A: no use by an organization with more than
$2M in annual revenue or in total funding, except personal or research use, and no use by a
competitor of Datalab. Commercial licenses are available from Datalab at https://www.datalab.to/.
Quantization
Every language-model projection and the token table (which is also the output head: the model ties them) are affine 8-bit in groups of 64, rounded to nearest with no calibration. The vision tower stays BF16. 4.8 GB.
Made with mlx-vlm 0.7.6 (see quantization.json for the exact source revision and tools):
mlx_vlm convert --hf-path datalab-to/chandra-ocr-2 --mlx-path chandra-ocr-2-MLX-8bit \
-q --q-bits 8 --q-group-size 64
mlx-vlm rewrites the processor configuration on conversion; the original
preprocessor_config.json, processor_config.json and video_preprocessor_config.json were
restored, since vLLM rejects the rewritten ones and the preprocessing is the original model's.
Quality
On nine scanned 1940s typewritten documents (memos, letters, an expense ledger), its text matched the original BF16 model's on every page; bounding boxes moved by at most a pixel.
This is a spot check, not a benchmark: run your own evaluation (for example olmOCR-bench) before relying on it.
Usage
With vllm-metal and Chandra's own client
(pip install chandra-ocr):
vllm serve jefflaporte/chandra-ocr-2-MLX-8bit --served-model-name chandra \
--mm-processor-kwargs '{"min_pixels": 3136, "max_pixels": 6291456}'
chandra input.pdf ./output --method vllm
With mlx-vlm:
python -m mlx_vlm.server --model jefflaporte/chandra-ocr-2-MLX-8bit
Chandra reads a page at up to 6,291,456 pixels; a server that caps images lower can lose the layout of dense pages.
- Downloads last month
- 19
8-bit
Model tree for jefflaporte/chandra-ocr-2-MLX-8bit
Base model
datalab-to/chandra-ocr-2