Image-Text-to-Text
MLX
Safetensors
qwen3_5
optiq
vision
vlm
lora
chartqa
apple-silicon
conversational
4-bit precision
Instructions to use mlx-community/chartreader-0.8B-OptiQ-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/chartreader-0.8B-OptiQ-4bit 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("mlx-community/chartreader-0.8B-OptiQ-4bit") config = load_config("mlx-community/chartreader-0.8B-OptiQ-4bit") # 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 mlx-community/chartreader-0.8B-OptiQ-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/chartreader-0.8B-OptiQ-4bit"
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": "mlx-community/chartreader-0.8B-OptiQ-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mlx-community/chartreader-0.8B-OptiQ-4bit 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 "mlx-community/chartreader-0.8B-OptiQ-4bit"
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 mlx-community/chartreader-0.8B-OptiQ-4bit
Run Hermes
hermes
- OpenClaw new
How to use mlx-community/chartreader-0.8B-OptiQ-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/chartreader-0.8B-OptiQ-4bit"
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 "mlx-community/chartreader-0.8B-OptiQ-4bit" \ --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"
| license: apache-2.0 | |
| library_name: mlx | |
| pipeline_tag: image-text-to-text | |
| base_model: mlx-community/Qwen3.5-0.8B-OptiQ-4bit | |
| tags: | |
| - mlx | |
| - optiq | |
| - vision | |
| - vlm | |
| - lora | |
| - chartqa | |
| - apple-silicon | |
| # chartreader-0.8B-OptiQ-4bit | |
| **A 0.8B vision-language model that reads charts, fine-tuned on a Mac.** | |
| This is the OptiQ 4-bit quant of `Qwen3.5-0.8B` bundled with **ChartReader**, an | |
| image+text LoRA trained on ChartQA. The vision tower stays frozen; the LoRA | |
| adapts the language tower to answer chart questions the way ChartQA wants: | |
| short, exact, just the value. The base + sidecar keep full image+text | |
| inference, so the same repo works for general VLM tasks too. | |
| ## Results | |
| 80 held-out ChartQA questions, base vs. base + ChartReader, images letterboxed | |
| to a 512 px canvas. | |
| | Metric | Base 0.8B | + ChartReader | Δ | | |
| |---|---|---|---| | |
| | Relaxed accuracy | 50.0% | 55.0% | +5.0 pp | | |
| | **Exact match** | 26.2% | **40.0%** | **+13.8 pp** | | |
| | Output similarity | 0.385 | 0.598 | +0.21 | | |
| The base reads charts loosely and verbosely ("There are 10 food items shown in | |
| the bar graph"); ChartReader answers concisely ("3"). The big win is format and | |
| exact-match; the relaxed-accuracy gain is smaller but real. | |
| ## Files | |
| ``` | |
| config.json, model.safetensors the base Qwen3.5-0.8B OptiQ-4bit quant | |
| optiq_vision.safetensors vision sidecar (full image+text inference) | |
| mtp.safetensors multi-token-prediction draft head | |
| adapters/chartreader/ the ChartQA LoRA (adapters.safetensors) | |
| ``` | |
| The LoRA is **not merged into the weights** — it rides alongside and applies at | |
| serve time, so you keep the plain base quant plus the ChartReader behavior. | |
| ## Use | |
| ```bash | |
| pip install mlx-optiq | |
| huggingface-cli download mlx-community/chartreader-0.8B-OptiQ-4bit --local-dir ./chartreader | |
| optiq serve --model ./chartreader --adapter ./chartreader/adapters/chartreader | |
| ``` | |
| Then send an image + a chart question to the OpenAI-compatible endpoint on | |
| `localhost:8080`. Without the `--adapter`, the same repo serves as the plain | |
| image+text base model. | |
| ## How it was made | |
| Image+text LoRA on the language tower, vision tower frozen: | |
| ```bash | |
| optiq lora train mlx-community/Qwen3.5-0.8B-OptiQ-4bit \ | |
| --vision --data ./chartqa/train.jsonl \ | |
| --rank 8 --iters 800 --learning-rate 5e-5 --output ./chartreader | |
| ``` | |
| Trained on a 24 GB Apple Silicon Mac. Every image is letterboxed to a uniform | |
| 512 px canvas (uniform shape keeps training memory bounded), gradient | |
| checkpointing fits the hybrid gated-delta backward, and gradient clipping + | |
| a 5e-5 learning rate prevent the mode collapse short targets otherwise cause. | |
| The whole flow — build the dataset, run the LoRA — is also available in the | |
| OptiQ Lab. | |
| Full write-up: [Fine-tuning a vision model on a Mac](https://mlx-optiq.com/blog/vision-lora-on-a-mac). | |
| --- | |
| Built with [OptiQ](https://mlx-optiq.com) — mixed-precision quantization, | |
| LoRA, and an OpenAI-compatible server for LLMs and VLMs on Apple Silicon. | |
| `pip install mlx-optiq`. | |