Instructions to use mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B 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/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B") config = load_config("mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B") # 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/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B 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/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B"
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": "mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B 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/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B"
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/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B 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/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B"
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/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B" \ --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"
mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B
Built with mlx-optiq, the MLX-native toolkit to quantize, fine-tune, and serve LLMs locally on Apple Silicon, no PyTorch and no cloud. All OptiQ quants ยท Docs
19B parameters at 13.5 GB, down from 35B at 24.4 GB, trading Capability Score 87.61 for 81.91.
Half the routed experts are gone. Each of the 40 language layers kept 128 of its 256 experts; top-8 routing is unchanged, so every token still activates 8 experts plus the shared one. The retained experts were copied bit-for-bit from the parent quant, nothing re-quantized or retrained. The cost is uneven: MMLU falls from 86.2 to 63.8, a 22.4 point drop, while GSM8K holds at 90.0, IFEval at 79.9, BFCL at 92.0, and HumanEval at 87.8. Knowledge questions suffer; skills largely survive. Pick it over the parent on a 24 GB Mac, where the parent doesn't fit in memory; pick the parent if knowledge questions matter.
| Parent | This model | ||
|---|---|---|---|
| Language tower on disk | 24.4 GB | 13.5 GB | โ45% |
| Vision sidecar | 1.1 GB | 1.1 GB | |
| Parameters | 35.2B | 18.9B | โ46% |
| Capability Score | 87.61 | 81.91 | โ5.70 |
It works on image and text
Both ran through this quantized model with optiq serve, MLX only:
Image (the words "OPTIQ 42" on a white background, "What text is in the image?"):
OPTIQ 42
Text ("What is the capital of France? One word."):
Paris
What pruning costs
| Benchmark | Parent | This model | ฮ |
|---|---|---|---|
| MMLU | 86.2 | 63.8 | โ22.4 |
| GSM8K | 94.6 | 90.0 | โ4.6 |
| IFEval | 85.0 | 79.9 | โ5.1 |
| BFCL-V3 | 93.0 | 92.0 | โ1.0 |
| HumanEval | 90.9 | 87.8 | โ3.1 |
| HashHop | 76.0 | 78.0 | +2.0 |
| Capability Score | 87.61 | 81.91 | โ5.70 |
Details
| Property | Value |
|---|---|
| Parent | mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit |
| Experts retained | 128 of 256 per layer, every layer |
| Active experts per token | 8 + 1 shared (unchanged) |
| Selection | REAP, conditional mean of router weight ร expert output norm |
| KL vs the unpruned parent | 0.077 |
| Calibration | optiq six-domain mix, 8 samples; expert coverage min 95.3%, median 100% |
| Vision tower | bf16 sidecar, unchanged from the parent |
| KV cache | kv_config.json, mixed 4/8-bit on the full-attention layers |
Run it
MiniCPM-V 4.7 needs OptiQ 0.5.25 or later. Stock mlx-lm does not know the minicpmv4_7 architecture, so import optiq registers it, and OptiQ loads the vision sidecar.
pip install "mlx-optiq>=0.5.25"
For image input, serve it with an OpenAI- and Anthropic-compatible endpoint:
optiq serve --model mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B
For the measured mixed-precision KV cache, fetch kv_config.json from this repo and pass it in:
hf download mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B kv_config.json --local-dir .
optiq serve --model mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B --kv-config kv_config.json
Then send an image as image_url content. Text-only generation also loads directly:
import optiq # registers minicpmv4_7 and the vision sidecar
from mlx_lm import load, generate
model, tok = load("mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B")
msgs = [{"role": "user", "content": "Explain why the sky is blue."}]
prompt = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
print(generate(model, tok, prompt=prompt, max_tokens=512))
Method
Expert pruning follows REAP (Cerebras Research, ICLR 2026, REAP the Experts: Why Pruning Prevails for One-Shot MoE Compression). OptiQ applies it in the quantized domain, directly on the quantized checkpoint with no bf16 parent, via optiq prune-experts. See the pruning docs.
Links
- Project website: mlx-optiq.com
- Family guide: mlx-optiq.com/docs/minicpm
- All OptiQ quants: mlx-optiq.com/models
- Base model: openbmb/MiniCPM-V-4.7-35B-A3B
- Downloads last month
- 1,662
4-bit
Model tree for mlx-community/MiniCPM-V-4.7-35B-A3B-OptiQ-4bit-REAP-19B
Base model
openbmb/MiniCPM-V-4.7-35B-A3B