Introduction
ModelBest has open-sourced its MoE model, MiniCPM5-15B-A2.5B. The Zhongzhi FlagOS community completed Day 0 cross-chip adaptation. Built on FlagOS’ unified multi-chip software stack, the model supports 10 platforms: T-Head, NVIDIA, Huawei Ascend, Hygon, Kunlun, Metax, Moore Threads, Iluvatar, Mac (M5), and CIX P1. BF16 variants are available for eight AI chip platforms, while W4A8 variants are offered for the CPU platforms of Mac (M5) and CIX P1. Model packages are released via the FlagRelease portals on ModelScope and Hugging Face. This adaptation extends the MiniCPM5 series’ cloud-to-edge deployment roadmap, enabling developers to select either data center or ARM edge deployment options based on their existing computing infrastructure and local runtime requirements.
MiniCPM5-15B-A2.5B is a native edge-agent base model developed by ModelBest for devices such as smartphones and PCs. It adopts a sparse MoE architecture with 15B total parameters and 2.5B activated parameters, delivering advanced reasoning and general agent capabilities. The model can interface with mainstream agent frameworks including Codex and Claude Code, and perform multi-step tasks such as code development and document analysis through local inference and tool calling. According to benchmark results published by ModelBest, the model scored 11 on the Artificial Analysis Intelligence Index (AA-Index), ranking first among models under 20B parameters. Using a “generate–verify–refine” test-time scaling approach, it achieved 123 out of 126 points in the 2026 Chinese Mathematical Olympiad (CMO 2026) final and received official gold medal recognition. In self-assessment for IMO 2026, it scored 32 points, exceeding the gold medal cutoff of 29 points.
MiniCPM5-15B-A2.5B W4A8 G32 — FlagOS
MiniCPM5-15B-A2.5B runs text generation and chat on Apple M5 Pro and CIX P1 CPUs. The first decoder layer uses a dense feed-forward network. Each of the next 27 layers selects 16 of 160 routed experts per token and also evaluates one shared expert.
Arm CPU optimizations
RC2 ran the W4A8 G32 model on both CPUs with a BF16 output head. RC4 uses the same model-body format. Three changes reduced work for each generated token.
- Scoring the vocabulary. Both runtimes prepare the checkpoint's BF16 output head for W8A8 execution at startup. Each decode step reads 8-bit weights to score the 130,560 candidate tokens.
- Calling each decoder layer. The plugin groups operations within each layer while vLLM continues to handle CPU attention and its key/value cache. Both runtimes reuse the views that locate keys and values in that cache. The plugin rebuilds the views if the backing storage or layout changes.
- Running the selected experts. On M5 Pro, the 16 experts selected in a layer share one 8-bit input conversion and packing step for their first projection. Each expert uses its own weights. On CIX P1, the plugin's layer path reuses compiled Triton TLE Raw entry points to call the packaged KleidiAI expert kernels.
End-to-end comparison with native llama.cpp Q4_0. With one 512-token prompt and 128 generated tokens, RC4 delivered 253.22 vs 205.16 tok/s on M5 Pro (+23.4%) and 42.09 vs 23.85 tok/s on CIX P1 (+76.5%). The largest difference was in processing the prompt, at 1.76× and 2.79× the llama.cpp rate respectively. RC4 decode was 1.0% slower on M5 Pro and 2.1% faster on P1. The measurement table gives the absolute rates for both quantization formats.
Model and quantization contract
| Item | Value |
|---|---|
| Architecture | MiniCPM5MoEForCausalLM (minicpm5_moe), text only |
| Decoder | 28 layers, hidden size 2,048, gated query output, 32 attention heads, 2 KV heads |
| Model-body weights | Symmetric INT4, packed; each group of 32 weights along the input dimension shares one BF16 scale per output row |
| Input activations | Dynamic per-token INT8. The checkpoint declares symmetric A8. The optimized Arm KleidiAI kernels use asymmetric A8 at execution. |
| Checkpoint format | compressed-tensors, pack-quantized; 29 indexed shards (28 layer shards and one for the remaining tensors) |
| Quantized linear layers | 13,156, including 12,960 routed-expert linear layers |
| Embeddings and output head | Both are stored in BF16. Embeddings execute in BF16. The Mac and P1 RC4 profiles prepare the target output head for W8A8 execution at startup. |
| Router | Weights are stored as BF16 and prepared for FP32 scoring. The correction bias affects expert selection; mixture weights come from the original sigmoid scores. |
| Context | This guide uses 2,048 tokens. The checkpoint declares 524,288 tokens. |
| Generation | One sequence at a time. Ordinary decoding is the default. |
Keep the complete model directory together, including its configuration, tokenizer, chat template, bundled model code, index and weight shards.
User guide
| Platform | Tested deployment |
|---|---|
| Mac | Apple M5 Pro (Mac17,9), macOS 27.0 arm64, 64 GiB unified memory. Native CPU runtime with vLLM 0.24.0+cpu. |
| Linux | CIX P1, Linux aarch64, 32 GB-class board. Harbor Docker image with vLLM package 0.24.0+cpu (server banner 0.24.0), restricted to eight Cortex-A720 cores. |
Both packages use the same model, layer dispatcher and Arm layer source. They include vLLM, vLLM-plugin-FL, FlagGems and the FlagTree-CPU runtime. The release manifests identify FlagGems 96029bf9aa16 and vLLM-plugin-FL d96834f27851 and include the patches against RC3. The platform builds supply the native FlagGems library for their respective operating system. Model weights are distributed separately.
Choose the offline package
| Host | RC4 file in the delivery folder | Install with |
|---|---|---|
| Apple M5 Pro, macOS arm64 | macos-m5pro/flagos-minicpm5-15b-w4a8-g32-macos-arm64-unified-rc4.tar.gz |
Extract the native runtime in step 2B. |
| CIX P1, Linux aarch64 | linux-cix-p1/minicpm5-15b-a2.5b-w4a8-g32-cix-p1-unified-rc4.docker.tar.gz |
Load the Docker image in step 2A. |
The Mac archive has a matching .sha256 file. The P1 delivery includes p1.SHA256SUMS and IMAGE_REF beside the archive. The two packages run the same separately supplied W4A8 G32 target checkpoint. RC4 uses W8A8 execution for the target output head on both platforms.
Release downloads
| Artifact | Download |
|---|---|
| Target checkpoint (W4A8 G32) | Use the separate model directory verified in step 1. |
| Linux / CIX P1 container image | Harbor tag harbor.baai.ac.cn/flagrelease-public/flagrelease-minicpm5-15b-a2.5b-w4a8-g32-arm-tree_3.7.2-gems_96029bf9aa16-vllm_0.24.0_cpu-plugin_d96834f27851-cx_none-python_3.11.2-torch_2.11.0_cpu-pcp_none-gpu_cpu-arc_arm64-driver_none:202612022357. The digest-pinned pull command is in step 2A. |
| macOS / M5 Pro native runtime | RC4 Release · Runtime archive · SHA-256 |
1. Prepare the checkpoint on either platform
In the directory containing the supplied model folder, run:
export MODEL_DIR="$PWD/MiniCPM5-15B-A2.5B-W4A8-G32-FlagOS"
python3 - <<'PYMODEL'
import json, os
from pathlib import Path
m = Path(os.environ["MODEL_DIR"])
cfg = json.loads((m / "config.json").read_text())
assert cfg["architectures"] == ["MiniCPM5MoEForCausalLM"]
q = cfg["quantization_config"]["config_groups"]["w4a8_g32_token"]
assert (q["weights"]["num_bits"], q["weights"]["group_size"], q["input_activations"]["num_bits"]) == (4, 32, 8)
index = json.loads((m / "model.safetensors.index.json").read_text())
shards = set(index["weight_map"].values())
assert len(shards) == 29 and all((m / name).is_file() for name in shards)
assert all((m / name).is_file() for name in ("tokenizer.json", "tokenizer_config.json", "chat_template.jinja"))
print("MiniCPM5-15B-A2.5B W4A8 G32:", len(shards), "shards present")
PYMODEL
Follow the section for your host. Use a dedicated writable cache for this checkpoint and runtime version. First startup compiles kernels and prepares approximately 7.3 GiB of expert weights on disk. Allow at least 10 GiB of free cache space before the first launch. Reuse the cache with the same model path and files. A cache prepared with a different path can fail its checkpoint identity check; use a fresh cache in that case.
2A. Linux / CIX P1 · Docker
On the tested P1, the eight Cortex-A720 CPUs are numbered 0,1,6,7,8,9,10,11. Check your board with lscpu -e=CPU,CORE,ONLINE,MAXMHZ before using that CPU list. Allow room for the image, model and 10 GiB of writable cache. If the image is already loaded, go directly to the image identity check.
Harbor installation. If project credentials are required, first run sudo docker login harbor.baai.ac.cn. Pull the verified release on the P1:
export CIX_IMAGE='harbor.baai.ac.cn/flagrelease-public/flagrelease-minicpm5-15b-a2.5b-w4a8-g32-arm-tree_3.7.2-gems_96029bf9aa16-vllm_0.24.0_cpu-plugin_d96834f27851-cx_none-python_3.11.2-torch_2.11.0_cpu-pcp_none-gpu_cpu-arc_arm64-driver_none@sha256:4c1b2bc6b60e596d88ee317e6cb371a72dfe912facab3e0ddeba0753364e530d'
sudo docker pull "$CIX_IMAGE" || exit 1
Offline alternative. From the supplied linux-cix-p1 directory:
export IMAGE_ARCHIVE=minicpm5-15b-a2.5b-w4a8-g32-cix-p1-unified-rc4.docker.tar.gz
sha256sum -c p1.SHA256SUMS && sudo docker load --input "$IMAGE_ARCHIVE" || exit 1
export CIX_IMAGE="$(cat IMAGE_REF)"
After either installation, verify the image ID and start the server in the same shell. Keep MODEL_DIR from step 1. Docker creates the named cache volume on first use. The only host folder the engine reads is the model directory.
test "$(sudo docker image inspect "$CIX_IMAGE" --format '{{.Id}}')" = \
'sha256:22f1f92193dae9c8793598f7674ea212e146c1e58135e562e2fa3dddd7a65095' || exit 1
sudo docker run -d --name minicpm15-p1 \
--cpuset-cpus 0,1,6,7,8,9,10,11 -p 127.0.0.1:18085:8000 \
--mount type=bind,src="$MODEL_DIR",dst=/model,readonly \
--mount type=volume,src=minicpm15-p1-rc4-cache,dst=/cache \
"$CIX_IMAGE"
Run step 3 on the P1. To follow first startup, use sudo docker logs -f minicpm15-p1. The image defaults to ordinary decoding, eight threads for prefill and decode, 2,048 tokens of context, one concurrent sequence and a 512 MiB KV-cache budget. The model-specific cache volume can be reused after restarting this image with the same checkpoint.
2B. Mac / M5 Pro · Native runtime
Confirm the host reports arm64 and Mac17,9. Apple Command Line Tools supply the compiler and linker used by the CPU JIT.
uname -m
sysctl -n hw.model
xcrun --find clang
Keep MODEL_DIR from step 1. Download and verify the RC4 runtime from GitHub Releases, then extract it and check the vLLM version.
export RT="$HOME/Library/FlagOS/minicpm5-15b-unified-rc4"
(
set -eu
base=https://github.com/kevinzs2048/flagos-macos-runtime/releases/download/minicpm5-15b-m5pro-rc4
pkg=flagos-minicpm5-15b-w4a8-g32-macos-arm64-unified-rc4.tar.gz
mkdir -p "$HOME/Downloads/FlagOS/minicpm5-15b-rc4"
cd "$HOME/Downloads/FlagOS/minicpm5-15b-rc4"
curl -fL --retry 3 -o "$pkg.sha256" "$base/$pkg.sha256"
curl -fL --retry 3 -o "$pkg" "$base/$pkg"
shasum -a 256 -c "$pkg.sha256"
if [ ! -e "$RT" ]; then
mkdir -p "$(dirname "$RT")"
stage=$(mktemp -d "$(dirname "$RT")/.minicpm5-15b.XXXXXX")
(umask 022; tar --no-same-permissions -xzf "$pkg" -C "$stage")
mv "$stage" "$RT"
fi
printf '%s %s\n' 'bb271ebaf11d75338d4b1bfaca24c3c6f4dfdc357d45725a45b5f40010504146' "$RT/share/minicpm15/mac-rc4.json" | shasum -a 256 -c -
python3 - "$RT" <<'PYVERIFY'
import hashlib, json, sys
from pathlib import Path
root = Path(sys.argv[1])
files = json.loads((root / "share/minicpm15/mac-rc4.json").read_text())["files_sha256"]
for name, expected in files.items():
if hashlib.sha256((root / name).read_bytes()).hexdigest() != expected:
raise SystemExit(f"Runtime checksum mismatch: {name}")
PYVERIFY
"$RT/bin/flagos-vllm" --version
)
Expected version: 0.24.0+cpu. Define the following function once in the serving terminal. The launcher selects the decode thread count.
export FLAGOS_CACHE_DIR="$HOME/Library/Caches/FlagOS/minicpm5-15b-mac-rc4"
serve_minicpm15() {
"$RT/bin/flagos-vllm" "$@" serve "$MODEL_DIR" \
--served-model-name minicpm5-15b --host 127.0.0.1 --port 18085 \
--dtype bfloat16 --max-model-len 2048 --max-num-batched-tokens 512 \
--max-num-seqs 1 --kv-cache-memory-bytes 536870912 \
--distributed-executor-backend uni \
--worker-cls vllm_fl.worker.cpu_phase_worker.CPUPhaseWorker \
--enforce-eager --no-enable-prefix-caching --generation-config vllm
}
Ordinary decoding. Run serve_minicpm15 and leave the terminal open.
3. Verify the HTTP service on either platform
On the same host, open another terminal. This checks that the served model is registered, sends a deterministic text request and saves the response. The expected answer is 42.
export RUN_DIR="$HOME/flagos-runs/minicpm15-$(date +%Y%m%d-%H%M%S)"
(
set -eu
API=http://127.0.0.1:18085
mkdir -p "$RUN_DIR"
ready=0
for attempt in $(seq 1 180); do
if curl --noproxy '*' -fsS --max-time 3 "$API/v1/models" > "$RUN_DIR/models.json" 2>/dev/null; then ready=1; break; fi
sleep 5
done
if [ "$ready" -ne 1 ]; then echo "Service did not become ready; check the server log." >&2; exit 1; fi
python3 - "$RUN_DIR/models.json" <<'PY'
import json, sys
assert "minicpm5-15b" in [m["id"] for m in json.load(open(sys.argv[1]))["data"]]
PY
curl --noproxy '*' -fsS --max-time 300 "$API/v1/chat/completions" \
-H 'Content-Type: application/json' \
-d '{"model":"minicpm5-15b","messages":[{"role":"user","content":"What is 17 + 25? Reply with just the number."}],"chat_template_kwargs":{"enable_thinking":false},"temperature":0,"max_tokens":32}' \
> "$RUN_DIR/chat.json"
python3 - "$RUN_DIR/chat.json" <<'PY'
import json, sys
r = json.load(open(sys.argv[1]))
answer = r["choices"][0]["message"]["content"].strip()
assert r["model"] == "minicpm5-15b" and r["usage"]["completion_tokens"] > 0
assert answer == "42", answer
print(answer)
PY
)
4. Stop the service
On Mac, press Ctrl-C in the serving terminal. On P1, use the terminal from step 3, where RUN_DIR is set, to save the log and remove the test container:
sudo docker logs minicpm15-p1 > "$RUN_DIR/server.log" 2>&1
sudo docker stop -t 30 minicpm15-p1
sudo docker rm minicpm15-p1
Validation and performance
Loopback HTTP, batch size 1, 512 input IDs and 128 generated tokens. Each start used one warm-up and three timed fixed requests. Medians below combine two independent starts per Mac configuration and one per P1 configuration. RC4 was tested from the packaged runtimes. The Q4_0 GGUF was built from the same BF16 source and verified by SHA-256 on both platforms.
| CPU | Engine | PP512 (tok/s) | TG128 (tok/s) | Total (tok/s) |
|---|---|---|---|---|
| Apple M5 Pro | FlagOS RC3 · W4A8 G32 | 635.42 | 69.73 | 242.98 |
| Apple M5 Pro | FlagOS RC4 · W4A8 G32 | 627.86 | 74.23 | 253.22 |
| Apple M5 Pro | llama.cpp · Q4_0 | 357.18 | 74.95 | 205.16 |
| CIX P1 | FlagOS RC3 · W4A8 G32 | 80.16 | 13.15 | 39.90 |
| CIX P1 | FlagOS RC4 · W4A8 G32 | 80.39 | 14.34 | 42.09 |
| CIX P1 | llama.cpp · Q4_0 | 28.77 | 14.04 | 23.85 |
PP512 is 512 divided by time to first token. TG128 is 127 divided by time between the first and last token. Total is 640 divided by time from request submission to the last token. On each platform, the RC4 and RC3 outputs matched on all 768 generated IDs per measured set. Both release packages correctly answered five Chinese capital-city questions with natural stops.
- Downloads last month
- 4