MiniCPM-V-4.7-1B-RKNN3-RK1828

MiniCPM-V 4.7 1B converted to RKNN3 and running end-to-end on the Rockchip RK1828 NPU โ€” both the text tower and the vision tower, with real image questions answered on device.

โš ๏ธ Read this first. The vision tower in this repository contains a runtime-contract adapter: MiniCPM-V 4.7 natively emits 8ร—8 = 64 visual tokens per 448ร—448 image, but the RKNN3 multimodal callback requires image_ph * image_pw = 14ร—14 = **196** tokens. A nearest-neighbour 8ร—8 โ†’ 14ร—14 resample was inserted into the exported graph to satisfy that contract. This build is therefore NOT equivalent to the Hugging Face original MiniCPM-V 4.7 1B. Do not use it to benchmark or reproduce the original model's accuracy. See How it was made.

This repository is not just six binary files. It includes the launch script, request examples, conversion scripts and a deployment guide, so that the model can actually be run and reproduced.

Base model openbmb/MiniCPM-V-4.7-1B (Apache-2.0)
Hardware RK1828 / RK1820 NPU (tested RM1828MC0-F, firmware 1.1.0)
Host Windows PC or RK3588 / RK3576 board; Ubuntu x86 cannot drive the module directly
Runtime rknn3_110 (rkllm3-server), versions must match toolkit / proxy / firmware
Quantization w4a16, normal, group32, 8 cores; head w6a16
NPU footprint 1269 MB (exclusive differential measurement)

What's in the repository

Path Contents
rknn/ 6 conversion artifacts + start.cmd (1.36 GiB)
host/ send_vlm_req.cmd, two ready-made request bodies, pure-stdlib test-image generator
docs/DEPLOY.md Deployment, API contract, 10 pitfalls actually hit, verified results
convert/ Portable copies of the two vision-export scripts + the conversion recipe
SHA256SUMS Checksums of every file above

Quick start

<root>\
  rknn\                     <- this repo
  runtime\rknn3_110\bin\    <- rkllm3-server.exe
  runtime\rknn3_110\lib\    <- DLLs
cd /d <root>\rknn
start.cmd                          :: defaults 0.0.0.0:8899 (RK_HOST / RK_PORT override)
cd /d <root>\host
send_vlm_req.cmd orange            :: HTTP=200, response in resp_orange.json

The server is ready only when a real inference returns โ€” the weight-sync log can sit still for ~2 minutes. Do not poll rknn-smi during loading.

Full details (including the Session-1 requirement, proxy reuse and DLL/PATH rules) are in docs/DEPLOY.md.

API

OpenAI-compatible POST /v1/chat/completions. content must be an array; the server constructs the image placeholder tokens itself:

curl -s http://127.0.0.1:8899/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"messages":[{"role":"user","content":[
        {"type":"text","text":"ๅ›พ้‡Œๆ˜ฏไป€ไนˆ๏ผŸ"},
        {"type":"image_url","image_url":{"url":"data:image/png;base64,<BASE64>"}}
      ]}],"max_tokens":512}'

Do not put <image> / <|image_pad|> into the text. Use curl.exe --max-time; PowerShell Invoke-WebRequest hangs on this server.

A correct response has timings.prompt_n โ‰ˆ 218 = 196 visual tokens + text tokens โ€” that is the proof the vision embeddings really entered the LLM.

Verified on device

Check Result
Orange image โ†’ colour ่ฟ™ๅผ ๅ›พๆ˜ฏๆฉ™่‰ฒใ€‚
Black square โ†’ shape/colour ้ป‘่‰ฒๆญฃๆ–นๅฝข
Cross-checks (orange asked for shape; square asked for colour) correct โ€” not language-prior guessing
Pure text (capital of China) ๅŒ—ไบฌ
Chinese ASR + this VLM coexisting 3458 MB (0.6B ASR) / 3353 MB (1.7B ASR), all requests HTTP 200
Throughput ~90 tok/s generation, ~1700 tok/s prefill

finish_reason=stop on simple cases. Complex images may return length โ€” always check finish_reason, not just HTTP 200.

How it was made

  1. Text tower โ€” MiniCPM-V 4.7 reuses the Qwen3.5-0.8B architecture with vocab_size=248094 and an independent lm_head. Extraction + zoo Qwen3_5 export_llm.py / export_rknn.py. The top-level tie_word_embeddings must be set to false too โ€” otherwise HF tie_weights() silently binds the 254M-parameter head to the embedding and the model emits word salad.
  2. Vision tower โ€” vision_tower + merger exported to ONNX with transformers>=5.18 (MiniCPMV4_7ForConditionalGeneration), then RKNN with uint8 NHWC input and mean/std = 0.5*255. Output is 3D [1, N, 1024]; a 2D [N,1024] export is mis-parsed as "N images of 1024 tokens".
  3. 196-token adapter โ€” nearest-neighbour resample 8ร—8 โ†’ 14ร—14 inside the graph (Gather/Reshape only, no Resize op). This changes graph structure only: the .weight SHA256 is byte-identical to the unadapted 64-token build, because no weights are touched.

See convert/README.md for the recipe and docs/DEPLOY.md ยง5 for the pitfalls.

Limitations

  • Not equivalent to the original 4.7 (196-token adapter, see the warning above).
  • canvas mRoPE, multi-resolution tiling, high-resolution OCR and dense multi-object counting were not verified.
  • OCR is "characters readable" at best (RK1828 โ†’ RKโ‚โ‚ˆโ‚‚โ‚ˆ).
  • Only 448ร—448 single-image input was tested.
  • 1B model with a <think> chain: raising max_tokens is not monotonically safer (256 worked on one OCR case where 512 stalled inside <think>).
  • Known upstream issue: on ASR device error, NPU memory can leak (mem_sync ret=-10 retry loop); workaround is to kill the ASR process.

Checksums

sha256sum -c SHA256SUMS
File SHA256
MiniCPM-V-4.7-1B-llm.rknn 948e487bff9b2324b3016c665aa071feff05ac735e078c20ecb4a0ac7b825a1b
MiniCPM-V-4.7-1B-llm.weight 72fd0b16b8016d63a7d8b92f8d159ad7ea68a783eaca89b915bd0e240ae22dab
MiniCPM-V-4.7-1B-llm.embed.bin 511c5794dbf3d927fb17c5efc0052fababafdd35185be2961f6a855c1852b335
MiniCPM-V-4.7-1B-llm.tokenizer.gguf e028b0a11710ee5e0402c3829e871c3bd5c568540fe377febdd1a515d45b1544
MiniCPM-V-4.7-1B-vision.rknn 9e081464857fad825281ae8778defb882424cbf5d46a37acb6de59dd5cbc99d6
MiniCPM-V-4.7-1B-vision.weight 9c1939dd21e511c72ef6fa6333d43d962acc067d5302ed625815abeaf1cc1c03

License & attribution

Apache-2.0, inherited from openbmb/MiniCPM-V-4.7-1B. Please credit OpenBMB for the original model. The RKNN3 conversion, the 196-token adapter and the host scripts in this repository are provided under the same license, without warranty.

Built with airockchip/rknn3-model-zoo V1.1.0.


ไธญๆ–‡ๆ‘˜่ฆ

ๆŠŠ openbmb/MiniCPM-V-4.7-1B ่ฝฌๆˆ RKNN3๏ผŒๅœจ RK1828 ไธŠ่ท‘้€šๅฎŒๆ•ดๅ›พๆ–‡้“พ่ทฏ ๏ผˆๆ–‡ๆœฌๅก” + ่ง†่ง‰ๅก” + rkllm3-server --model2๏ผ‰๏ผŒ็œŸๆœบ 5/5 ๅธฆๅ›พไธŽ็บฏๆ–‡ๆœฌ่ฏทๆฑ‚ ๅ…จ้ƒจ HTTP 200๏ผŒNPU ็‹ฌๅ ๅ ็”จ 1269 MBใ€‚

ๅฟ…้กป็Ÿฅ้“็š„ๅ–่ˆ๏ผš4.7 ่ง†่ง‰ๅก”ๅŽŸ็”Ÿๅชๅ‡บ 8ร—8=64 ไธช่ง†่ง‰ token๏ผŒ่€Œ RKNN3 runtime ็š„ multimodal ๅ›ž่ฐƒ่ฆๆฑ‚ image_ph * image_pw = 14ร—14 = 196ใ€‚ไธบๆปก่ถณๅฅ‘็บฆ๏ผŒ ๅฏผๅ‡บๅ›พ้‡ŒๅŠ ไบ† 8ร—8โ†’14ร—14 ็š„ๆœ€่ฟ‘้‚ป้‡้‡‡ๆ ท้€‚้…ๅฑ‚๏ผˆๅชๆ”นๅ›พ็ป“ๆž„ใ€ไธๆ”นๆƒ้‡๏ผŒ .weight ็š„ SHA256 ไธŽ 64-token ็‰ˆๅฎŒๅ…จ็›ธๅŒ๏ผ‰ใ€‚ๅ› ๆญค ๆœฌไบง็‰ฉไธ็ญ‰ไปทไบŽ HF ๅŽŸ็‰ˆ 4.7๏ผŒไธ่ƒฝๆ‹ฟๅฎƒๅค็ŽฐๅŽŸ็‰ˆ็ฒพๅบฆ๏ผ› canvas mRoPE / ๅคšๅˆ†่พจ็އๅˆ‡็ – / ้ซ˜ๅˆ†่พจ OCR / ๅฏ†้›†่ฎกๆ•ฐๅ‡ๆœช้ชŒ่ฏใ€‚

้กน ็ป“ๆžœ
ๆฉ™ๅ›พ้—ฎ้ขœ่‰ฒ ่ฟ™ๅผ ๅ›พๆ˜ฏๆฉ™่‰ฒใ€‚
้ป‘ๆ–นๅ— ้ป‘่‰ฒๆญฃๆ–นๅฝข
ไบคๅ‰ๅฏน็…ง๏ผˆๆŽ’้™ค่ฏญ่จ€ๅ…ˆ้ชŒ็Œœ็ญ”ๆกˆ๏ผ‰ ๆญฃ็กฎ
็บฏๆ–‡ๆœฌ ๅŒ—ไบฌ
ไธŽ ASR ๅ…ฑๅญ˜ 0.6B 3458 MB / 1.7B 3353 MB๏ผˆA/B/A ๅฏๅค็Žฐ๏ผ‰
่ง†่ง‰ token ๆณจๅ…ฅ่ฏๆฎ timings.prompt_n โ‰ˆ 218

ไป“ๅบ“ๅซ 6 ไธช่ฝฌๆขไบง็‰ฉ + start.cmd + ่ฏทๆฑ‚่„šๆœฌ + ่ฝฌๆข่„šๆœฌ + ้ƒจ็ฝฒๆ–‡ๆกฃ๏ผŒ ๆ‹ฟๅˆฐๅณๅฏ่ท‘๏ผ›้ƒจ็ฝฒไธŽๅไธชๅฎžๆต‹่ธฉ่ฟ‡็š„ๅ‘่ง docs/DEPLOY.mdใ€‚ ๅคๆ‚ๅ›พๅŠกๅฟ…็œ‹ finish_reason๏ผŒๅˆซๅช็œ‹ HTTP 200ใ€‚

Downloads last month
73
GGUF
Model size
0 params
Architecture
qwen35
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for jj90/MiniCPM-V-4.7-1B-RKNN3-RK1828

Quantized
(55)
this model