Tdamre/MiniCPM5-1B-litert-lm
MiniCPM5-1B LiteRT-LM
This repository contains LiteRT-LM conversions of openbmb/MiniCPM5-1B for local on-device inference.
The source model is a Llama-architecture dense 1B checkpoint intended for on-device and resource-constrained use. These artifacts were exported locally from the Hugging Face safetensors checkpoint with LiteRT Torch and packaged as .litertlm files for the LiteRT-LM runtime.
Files
The CPU/GPU .litertlm files include a compressed Hugging Face tokenizer, LLM metadata, a quantized prefill/decode TFLite model, and a quantized external embedder. The Qualcomm files replace the prefill/decode model with an SM8750 AOT-compiled NPU model and keep the same external embedder packaging.
The May 31, 2026 refresh rebuilds all .litertlm containers with a minimal mobile-compatible ChatML template embedded in LLM metadata. This fixes Android template failures such as unknown method: string has no method named strip.
Run With LiteRT-LM
Install the LiteRT-LM CLI:
uv tool install litert-lmRun the generic artifact:
litert-lm run \
--from-huggingface-repo Tdamre/MiniCPM5-1B-litert-lm \
MiniCPM5-1B.litertlm \
--backend=cpu \
--prompt="What is 2+2?"Run the lower-cache artifact:
litert-lm run \
--from-huggingface-repo Tdamre/MiniCPM5-1B-litert-lm \
MiniCPM5-1B-web.litertlm \
--backend=cpu \
--prompt="What is 2+2?"Run the 32k-context artifact:
litert-lm run \
--from-huggingface-repo Tdamre/MiniCPM5-1B-litert-lm \
MiniCPM5-1B-c32k.litertlm \
--backend=cpu \
--prompt="What is 2+2?"Run the 64k-context artifact:
litert-lm run \
--from-huggingface-repo Tdamre/MiniCPM5-1B-litert-lm \
MiniCPM5-1B-c64k.litertlm \
--backend=cpu \
--prompt="What is 2+2?"Android Validation
Test device:
Nubia Redmagic 10 Pro / NX789J
Android 16, API 36
SoC: Qualcomm SM8750
GPU: Adreno 830
ABI: arm64-v8aAndroid runner:
LiteRT-LM v0.12.0 source build
Bazel 7.6.1 via Bazelisk
Android NDK r28b
Target: //runtime/engine:litert_lm_main --config=android_arm64Smoke prompt:
What is 2+2? Answer with just the number.Results:
The Qualcomm AOT artifacts are included for reproducibility and follow-up runtime work. They should not be treated as validated NPU inference artifacts for this stock Redmagic shell environment yet.
Conversion Summary
Source model revision:
openbmb/MiniCPM5-1B@4e9de7a0778dc1c362e983e6858f0e77542cbdcaCPU/GPU conversion command pattern:
litert-torch export_hf \
model-cache/openbmb-MiniCPM5-1B \
<output_dir> \
--keep_temporary_files=True \
--prefill_lengths=128,1024 \
--cache_length=<2048-or-4096-or-32768-or-65536> \
--externalize_embedder=True \
--quantization_recipe=dynamic_wi8_afp32Qualcomm AOT conversion used ai_edge_litert.aot targeting SocManufacturer.QUALCOMM and SocModel.SM8750, then repackaged the compiled TFLite model into the .litertlm container with backend_constraint=npu.
Toolchain:
Python 3.12.12
litert-torch 0.9.1
litert-lm 0.12.0
ai-edge-litert 2.1.5
ai-edge-litert-sdk-qualcomm 2.1.5
ai-edge-quantizer 0.7.0
torch 2.12.0+cu130
transformers 5.9.0
QNN SDK/runtime 2.44.0 from the Qualcomm LiteRT SDK wheelNot Included
MediaPipe .task was not uploaded. The current MediaPipe GenAI bundler documents SentencePiece tokenizer.model support, while MiniCPM5-1B ships an HF tokenizer.json and no tokenizer.model; uploading an unverified .task would be misleading.
Intel NPU AOT was not produced in this local run because this request targeted the connected Qualcomm SM8750/Adreno phone.
