Skip to main content
Back to Showcase

MiniCPM5-1B LiteRT-LM: On-Device Build and Iberian-Language Evaluation

Author:luispoveda93Model:MiniCPM5-1B

INT8 LiteRT-LM build plus Spanish, Catalan, Basque and Galician evals

A community contribution that packages MiniCPM5-1B in the .litertlm format so it runs fully on-device — Android, iOS, desktop and IoT — with Google's LiteRT-LM framework, with no internet connection required at inference time. The author also independently benchmarked MiniCPM5-1B 0-shot on Spanish, Catalan, Basque and Galician.

This is a personal community contribution, not an official OpenBMB or Google release. An INT4 (wi4b32) variant with a smaller footprint is available from the official litert-community/MiniCPM5-1B repo.

Files​

FileWhat it isWho it's for
MiniCPM5-1B.litertlmThe ready-to-run model (INT8, ~1.1 GB)Everyone — this is the default
chat_template.jinjaThe chat format (auto-used by the runtime)Advanced / reference

Quick Start​

Desktop, one command:

Bash
uv tool install litert-lm
uvx litert-lm run --from-huggingface-repo=luispoveda93/MiniCPM5-1B MiniCPM5-1B.litertlm --prompt="What is the capital of France?"

Android phone:

  1. Install the Google AI Edge Gallery app.
  2. Open Model manager → “+” → Import from HF, paste the repo link, and download MiniCPM5-1B.litertlm.

See the Edge Gallery wiki for details.

Model Details​

MiniCPM5-1B is a compact 1B decoder-only model from OpenBMB (standard LlamaForCausalLM), built for local assistants, coding agents and tool use, with a hybrid <think> chat mode and long-context support.

ItemValue
Parameters1,080,632,832 (~1B)
Layers24
Attention (GQA)16 query heads / 2 KV heads
Context length131,072
QuantizationINT8 dynamic-range (weights), FP32 activations
Signaturesprefill_128, prefill_512, decode (KV-cache 1280)

Recommended sampling (from the source model card):

ModeParamsEnable
Thinktemperature=0.9, top_p=0.95enable_thinking=True
No Thinktemperature=0.7, top_p=0.95enable_thinking=False

How It Was Built​

Converted from the BF16 source openbmb/MiniCPM5-1B with Google AI Edge tooling:

  • Re-authoring + TFLite conversion: ai-edge-torch Generative API. MiniCPM5-1B maps onto the standard decoder-only building blocks (hidden 1536, 24 layers, GQA 16/2, head_dim 128, RMSNorm 1e-6, RoPE θ=5e6, untied lm_head, vocab 130560).
  • Quantization: INT8 dynamic-range, weight-only.
  • Packaging: litert-lm-builder, native minicpm5 runtime type, source Hugging Face tokenizer, start token <s>, stop tokens [1, 130073] (</s>, <|im_end|>), a thought reasoning channel, and an ExecutorMetadata section declaring all 48 KV-cache state buffers (required for on-device prefill).
  • Verification: the re-authored model was checked against the original transformers implementation — last-token logits matched with cosine 1.0000, identical argmax, 5/5 top-5 overlap, and an exactly matching parameter count. The packaged bundle was also run end-to-end with litert-lm run and generates correctly, with the reasoning channel parsing as expected.

Community Evaluation: Spanish, Catalan, Basque, Galician (0-shot)​

This section is a community addition that does not appear in the official MiniCPM5-1B model card. It was benchmarked independently by the repo maintainer and is not an official OpenBMB result.

To see how this compact EN/ZH-pretrained 1B model performs on Spain's co-official languages, the author ran the exact task selection published on the Salamandra-2b-instruct model card — a 2.25B model whose pretraining oversampled these languages 2x — using the same LM Evaluation Harness task suite (SpanishBench, CatalanBench, BasqueBench, GalicianBench), 0-shot, with the chat template applied. Evaluation used the BF16 source model (openbmb/MiniCPM5-1B), not the on-device .litertlm build. The Salamandra-2B column is transcribed verbatim from its published card and was not re-run.

Bold values indicate MiniCPM5-1B matches or exceeds the published Salamandra-2B-instruct baseline.

Spanish​

CategoryTaskMetricMiniCPM5-1BSalamandra-2B
Commonsense Reasoningxstorycloze_esacc51.6961.95
NLIwnli_esacc43.6649.30
NLIxnli_esacc42.4948.52
Paraphrasingpaws_esacc57.3057.10
QAxquad_esf1 (see note)0.0029.60
Translationflores_esbleu0.0015.92

Note: Salamandra's card lists this task under metric "acc"; the installed xquad_es task only computes f1/exact_match, so f1 is reported for MiniCPM5-1B.

Catalan​

CategoryTaskMetricMiniCPM5-1BSalamandra-2B
Commonsense Reasoningcopa_caacc50.8071.00
Commonsense Reasoningxstorycloze_caacc48.6461.61
NLIwnli_caacc54.9356.34
NLIxnli_caacc37.8352.54
Paraphrasingparafrasejaacc56.7564.48
Paraphrasingpaws_caacc56.4560.30
QAarc_ca_easyacc28.8752.15
QAarc_ca_challengeacc20.2230.03
QAopenbookqa_caacc21.8029.20
QApiqa_caacc53.3263.93
QAsiqa_caacc33.7642.32
Translationflores_cableu0.0020.04

Basque​

CategoryTaskMetricMiniCPM5-1BSalamandra-2B
Commonsense Reasoningxcopa_euacc48.2055.20
Commonsense Reasoningxstorycloze_euacc49.7755.26
NLIwnli_euacc52.1152.11
NLIxnli_euacc33.9145.89
QAeus_exams (see note)acc24.4024.94
QAeus_proficiencyacc24.2825.15
QAeus_triviaacc30.4427.35
Reading Comprehensioneus_readingacc25.8528.69
Translationflores_eubleu0.007.93

Note: eus_exams is a group of 29 exam sub-tasks; MiniCPM5-1B's score is the sample-count-weighted average across all sub-tasks.

Galician​

CategoryTaskMetricMiniCPM5-1BSalamandra-2B
Paraphrasingparafrases_glacc52.7253.40
Paraphrasingpaws_glacc53.9556.85
QAopenbookqa_glacc21.6026.20
Translationflores_glbleu0.0017.53

Interpretation​

MiniCPM5-1B has no targeted Spanish/Catalan/Basque/Galician pretraining data. The gaps on Basque and Galician — and on all FLORES/BLEU translation tasks, which scored ≈0 in every language — are the expected result of that mismatch, not a defect in the on-device conversion. The comparison is offered as context for anyone considering MiniCPM5-1B for these languages; it is not a claim of official parity with Salamandra.

Project info

Author
luispoveda93