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
| File | What it is | Who it's for |
|---|---|---|
MiniCPM5-1B.litertlm | The ready-to-run model (INT8, ~1.1 GB) | Everyone — this is the default |
chat_template.jinja | The chat format (auto-used by the runtime) | Advanced / reference |
Quick Start
Desktop, one command:
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:
- Install the Google AI Edge Gallery app.
- 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.
| Item | Value |
|---|---|
| Parameters | 1,080,632,832 (~1B) |
| Layers | 24 |
| Attention (GQA) | 16 query heads / 2 KV heads |
| Context length | 131,072 |
| Quantization | INT8 dynamic-range (weights), FP32 activations |
| Signatures | prefill_128, prefill_512, decode (KV-cache 1280) |
Recommended sampling (from the source model card):
| Mode | Params | Enable |
|---|---|---|
| Think | temperature=0.9, top_p=0.95 | enable_thinking=True |
| No Think | temperature=0.7, top_p=0.95 | enable_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-torchGenerative 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, untiedlm_head, vocab 130560). - Quantization: INT8 dynamic-range, weight-only.
- Packaging:
litert-lm-builder, nativeminicpm5runtime type, source Hugging Face tokenizer, start token<s>, stop tokens[1, 130073](</s>,<|im_end|>), athoughtreasoning channel, and anExecutorMetadatasection declaring all 48 KV-cache state buffers (required for on-device prefill). - Verification: the re-authored model was checked against the original
transformersimplementation — 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 withlitert-lm runand 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
| Category | Task | Metric | MiniCPM5-1B | Salamandra-2B |
|---|---|---|---|---|
| Commonsense Reasoning | xstorycloze_es | acc | 51.69 | 61.95 |
| NLI | wnli_es | acc | 43.66 | 49.30 |
| NLI | xnli_es | acc | 42.49 | 48.52 |
| Paraphrasing | paws_es | acc | 57.30 | 57.10 |
| QA | xquad_es | f1 (see note) | 0.00 | 29.60 |
| Translation | flores_es | bleu | 0.00 | 15.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
| Category | Task | Metric | MiniCPM5-1B | Salamandra-2B |
|---|---|---|---|---|
| Commonsense Reasoning | copa_ca | acc | 50.80 | 71.00 |
| Commonsense Reasoning | xstorycloze_ca | acc | 48.64 | 61.61 |
| NLI | wnli_ca | acc | 54.93 | 56.34 |
| NLI | xnli_ca | acc | 37.83 | 52.54 |
| Paraphrasing | parafraseja | acc | 56.75 | 64.48 |
| Paraphrasing | paws_ca | acc | 56.45 | 60.30 |
| QA | arc_ca_easy | acc | 28.87 | 52.15 |
| QA | arc_ca_challenge | acc | 20.22 | 30.03 |
| QA | openbookqa_ca | acc | 21.80 | 29.20 |
| QA | piqa_ca | acc | 53.32 | 63.93 |
| QA | siqa_ca | acc | 33.76 | 42.32 |
| Translation | flores_ca | bleu | 0.00 | 20.04 |
Basque
| Category | Task | Metric | MiniCPM5-1B | Salamandra-2B |
|---|---|---|---|---|
| Commonsense Reasoning | xcopa_eu | acc | 48.20 | 55.20 |
| Commonsense Reasoning | xstorycloze_eu | acc | 49.77 | 55.26 |
| NLI | wnli_eu | acc | 52.11 | 52.11 |
| NLI | xnli_eu | acc | 33.91 | 45.89 |
| QA | eus_exams (see note) | acc | 24.40 | 24.94 |
| QA | eus_proficiency | acc | 24.28 | 25.15 |
| QA | eus_trivia | acc | 30.44 | 27.35 |
| Reading Comprehension | eus_reading | acc | 25.85 | 28.69 |
| Translation | flores_eu | bleu | 0.00 | 7.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
| Category | Task | Metric | MiniCPM5-1B | Salamandra-2B |
|---|---|---|---|---|
| Paraphrasing | parafrases_gl | acc | 52.72 | 53.40 |
| Paraphrasing | paws_gl | acc | 53.95 | 56.85 |
| QA | openbookqa_gl | acc | 21.60 | 26.20 |
| Translation | flores_gl | bleu | 0.00 | 17.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.
Links
- Hugging Face: luispoveda93/MiniCPM5-1B
- Official INT4 LiteRT build: litert-community/MiniCPM5-1B
- Source model: openbmb/MiniCPM5-1B
