Instructions to use litert-community/MiniCPM-V-4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/MiniCPM-V-4 with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update README.md
#1
by zkh2023 - opened
README.md
CHANGED
|
@@ -1,3 +1,53 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MiniCPM-V-4 · LiteRT INT8 (on-device, Snapdragon 8850 CPU)
|
| 2 |
+
|
| 3 |
+
`MiniCPM-V-4-int8.litertlm` — an on-device [LiteRT-LM](https://github.com/google-ai-edge/LiteRT-LM) build of MiniCPM-V-4, quantized to **INT8** (weight-only, GPTQ + Hadamard rotation) and packaged as a single `.litertlm` bundle for CPU inference on **Snapdragon 8850**.
|
| 4 |
+
|
| 5 |
+
## Model
|
| 6 |
+
|
| 7 |
+
For the base model, architecture, capabilities and license, refer to the original model card:
|
| 8 |
+
|
| 9 |
+
**https://huggingface.co/openbmb/MiniCPM-V-4**
|
| 10 |
+
|
| 11 |
+
This repository only provides an **edge-optimized LiteRT deployment** of that model:
|
| 12 |
+
|
| 13 |
+
- **Format**: `.litertlm` (LiteRT-LM bundle: tokenizer + LLM prefill/decode + embedder + navit SigLIP vision encoder + resampler).
|
| 14 |
+
- **Quantization**: INT8 weight-only, per-channel, GPTQ + Hadamard rotation (activation-outlier smoothing).
|
| 15 |
+
- **Vision**: official multi-slice preprocessing (thumbnail + sub-tiles, 64 tokens per slice, up to 9 slices), navit SigLIP.
|
| 16 |
+
|
| 17 |
+
## Performance (Snapdragon 8850, CPU backend)
|
| 18 |
+
|
| 19 |
+
Measured on-device (arm64 CPU, `--backend=cpu`), single image, 4-slice input:
|
| 20 |
+
|
| 21 |
+
| Metric | Value |
|
| 22 |
+
|---|---|
|
| 23 |
+
| Prefill speed | **40.9 tokens/sec** |
|
| 24 |
+
| Decode speed | **16.6 tokens/sec** |
|
| 25 |
+
| Vision encode (4 slices) | **~2.04 s** |
|
| 26 |
+
| Time to first token | ~7.0 s (284-token prefill incl. vision) |
|
| 27 |
+
| Init (model load + compile) | ~2.2 s |
|
| 28 |
+
|
| 29 |
+
## Accuracy — MME benchmark (on-device, 8850 CPU)
|
| 30 |
+
|
| 31 |
+
Full MME evaluation running the INT8 bundle on-device:
|
| 32 |
+
|
| 33 |
+
| Group | Score |
|
| 34 |
+
|---|---|
|
| 35 |
+
| **Perception** | **1568** |
|
| 36 |
+
| **Cognition** | **491** |
|
| 37 |
+
| **Total** | **2059** |
|
| 38 |
+
|
| 39 |
+
## Usage
|
| 40 |
+
|
| 41 |
+
Run with a LiteRT-LM CPU runner:
|
| 42 |
+
|
| 43 |
+
```bash
|
| 44 |
+
LD_LIBRARY_PATH=. ./litert_lm_main \
|
| 45 |
+
--model_path=./MiniCPM-V-4-int8.litertlm \
|
| 46 |
+
--backend=cpu \
|
| 47 |
+
--image_path=./image.jpg \
|
| 48 |
+
--input_prompt="What is in this image?"
|
| 49 |
+
```
|
| 50 |
+
|
| 51 |
+
## License
|
| 52 |
+
|
| 53 |
+
Follows the license of the base model — see **https://huggingface.co/openbmb/MiniCPM-V-4**.
|