How to Run MiniCPM V 4.7 1B Locally
Built from openbmb's original weights with our own importance matrix. The calibration corpora behind our builds are public.
- You can now run MiniCPM in Atomic Chat.
- See our quantization analysis below for measurements and instructions.
Pick a file
Every number below is measured, not estimated. How we measured it is at the
bottom, and the raw logs are in
the metrics repo
so you can check any of it yourself.
KL divergence is how far the quantized model's predictions drift from the
original weights. Lower is better, and zero means identical. top-1 is how
often it picks the same next word the original would have picked.
A 1B model loses more per bit than a large one: even Q8_0 agrees with the original on 96.6% of tokens
here. Below AD-IQ4_XS-IQ3_S the files drop under 75% top-1, so they are not published (their numbers
are in the metrics repo).
AD- marks an Atomic Dynamic layout. The name says what the two largest
tensor groups got: AD-<ffn_down>-<ffn_up>, collapsed to one name when both
match. Nothing is named after a type it does not contain.
Against llama.cpp's plain presets
The same reference, held-out text, machine and llama.cpp build; the plain presets are made with no
importance matrix:
At 4 and 5 bits the AD files are smaller and drift half to three quarters as far. At 6 bits the plain
preset wins. Half of this model is the embedding and the output head (a 248k vocabulary on 1,024
dimensions, a quarter of the weights each), and our 6-bit layouts have not found a better split for
them yet. So Q6_K stays in this repo, and Q4_K_M, Q5_K_M and AD-Q6_K-Q5_K are only in this table.
Which one fits your card
The file has to fit, and so does the context. This model keeps 12 KB of
attention cache per token, which is 0.1 GB at 8k context and 0.4 GB at 32k. Budget
for both.
Every file here fits a 2 GB card with 32k of context.
Running it
The chat template is inside every file, llama.cpp applies it on its own. With --jinja it starts every answer in thinking mode; turn it off per request with "chat_template_kwargs": {"enable_thinking": false}.
Images and video
This model reads images, not only text. That needs one extra file, the vision
projector, which is separate from the quant and shared by all of them:
mmproj-MiniCPM-V-4.7-1B-F16.gguf for most people
mmproj-MiniCPM-V-4.7-1B-BF16.gguf if your setup prefers bfloat16
Download it once alongside whichever quant you picked:
The calibration data
Our importance matrix comes from a corpus we built for this model and
published: AtomicChat/calib-corpora,
recipe minicpm-v-4.7. It is 4,942,284 tokens across 3,107 documents:
Every conversation is rendered through this model's own chat template, so
the chat markup appears as the single tokens the model actually sees.
[!IMPORTANT]
If you build your own importance matrix from this corpus, pass
--parse-special to llama-imatrix. Without it the chat markup is read as
ordinary punctuation.
How we measured
Reference: the original BF16 weights, converted to GGUF and run unquantized.
Perplexity on the held-out set is 15.9138 plus or minus 0.11294.
Held-out text: eval_neutral from our calibration dataset, never used for
calibration. 87 chunks at 4096 context.
Metric: per-token KL divergence of each file's predictions against the
reference, plus top-1 agreement.
Hardware: 4x H100 80GB HBM3.
The raw logits of the reference are published in the metrics repo, split into
parts because of the file size limit. With them you can measure your own build
against exactly the same point we did:
Reproducing a file
The importance matrix was collected on the BF16 weights rather than on a
quantized copy, in one run:
Then, for AD-Q6_K:
The rules for every other file are in ladder/ in the metrics repo, next to
its quantization log. The first rule that matches a tensor wins.
Model details
24 layers, hidden size 1024, feed-forward size 3584, vocabulary 248,094, context 262,144.
Needs llama.cpp at or after 69f201a (MiniCPM-V 4.7 support, ggml-org/llama.cpp#29416); older builds run text only and get image positions wrong. Built and tested with llama.cpp b11574 (8bb3cf0d2).