Instructions to use AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0 # Run inference directly in the terminal: llama cli -hf AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0 # Run inference directly in the terminal: llama cli -hf AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0 # Run inference directly in the terminal: ./build/bin/llama cli -hf AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0
Use Docker
docker model run hf.co/AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0
- Llama new
- LM Studio
- Jan
- Ollama
How to use AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp with Ollama:
ollama run hf.co/AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0
- Unsloth Desktop
- Pi
How to use AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp with Docker Model Runner:
docker model run hf.co/AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0
- Lemonade
How to use AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0
Run and chat with the model
lemonade run user.MiniCPM5-2B-AX8860-llama.cpp-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "AXERA-TECH/MiniCPM5-2B-AX8860-llama.cpp:Q8_0" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
README: align with the other AX8860 packages
Browse files- PACKAGE.md5 +1 -1
- README.md +48 -44
- SHA256SUMS +1 -1
PACKAGE.md5
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
dda465045fe83467593a756c86c7e0be BIN_COMMIT
|
| 2 |
57e37e3fd7758a9e4f7c687cf5c0e257 MiniCPM5-2B-Q8_0.gguf
|
| 3 |
-
|
| 4 |
8736973eb22670a9cce4a51d895363c2 WEIGHTS.md5
|
| 5 |
d9ab3d8341082333481876b7e5d98d9f bench.sh
|
| 6 |
8b8d2651ef667dc715582f816984997c bin/llama-bench
|
|
|
|
| 1 |
dda465045fe83467593a756c86c7e0be BIN_COMMIT
|
| 2 |
57e37e3fd7758a9e4f7c687cf5c0e257 MiniCPM5-2B-Q8_0.gguf
|
| 3 |
+
6bfa5d88c690341ae90e9175e28eb78b README.md
|
| 4 |
8736973eb22670a9cce4a51d895363c2 WEIGHTS.md5
|
| 5 |
d9ab3d8341082333481876b7e5d98d9f bench.sh
|
| 6 |
8b8d2651ef667dc715582f816984997c bin/llama-bench
|
README.md
CHANGED
|
@@ -5,36 +5,26 @@ library_name: llama.cpp
|
|
| 5 |
|
| 6 |
# MiniCPM5-2B on AX8860 (llama.cpp + ggml-axera)
|
| 7 |
|
| 8 |
-
在爱芯 AX8860 的 NPU 上用 llama.cpp 运行 MiniCPM5-2B
|
| 9 |
-
MiniCPM5-2B on the Axera AX8860 NPU with llama.cpp: text
|
| 10 |
-
|
| 11 |
-
## 模型 / Model
|
| 12 |
-
|
| 13 |
-
42 层 Llama(GQA 16 Q / 2 KV,head_dim 128,SwiGLU 6144,vocab 130560,`rope_theta` 5e6,
|
| 14 |
-
原生上下文 131072,EOS `[1, 130073]`)。包内 GGUF 为官方 Q8_0;F16 GGUF 也可直接加载。
|
| 15 |
|
| 16 |
## 性能 / Performance
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
| prompt | `-c` | prompt 耗时 / time | decode tokens/s |
|
| 21 |
|---|---:|---:|---:|
|
| 22 |
-
| 5 token | 8192 | 0.
|
| 23 |
-
| 46 token | 8192 | 0.
|
| 24 |
-
| 3907 token | 8192 | 0.
|
| 25 |
-
| 5 token | 131072 | 0.
|
| 26 |
-
| 3907 token | 131072 | 0.
|
| 27 |
-
|
| 28 |
-
4k prompt prefill 约 **6219 tokens/s**(`-c 8192`)。
|
| 29 |
-
|
| 30 |
-
## 困惑度 / Perplexity
|
| 31 |
-
|
| 32 |
-
`sh bench.sh ppl`,同一 GGUF、`-c 512`:
|
| 33 |
-
|
| 34 |
-
| 语言 | `-ub 1` | `-ub 4` |
|
| 35 |
-
|---|---:|---:|
|
| 36 |
-
| 中文 / zh | 16.70 | 16.72 |
|
| 37 |
-
| 英文 / en | 13.33 | 13.44 |
|
| 38 |
|
| 39 |
## 快速开始 / Quick start
|
| 40 |
|
|
@@ -46,36 +36,50 @@ sh bench.sh # 性能复现 / benchmark
|
|
| 46 |
sh bench.sh ppl # 困惑度 / perplexity
|
| 47 |
```
|
| 48 |
|
| 49 |
-
|
| 50 |
-
程序会立即读到 EOF。请直接在终端运行,或用 `script -qec './run.sh -c' /dev/null` 验证。
|
| 51 |
-
Chat mode requires an interactive terminal; piped stdin has no TTY and exits at EOF.
|
| 52 |
|
| 53 |
-
|
| 54 |
-
needs an AX8860 with SDK V0.5.1+; call the scripts with `sh` when the downloaded files are not executable.
|
| 55 |
-
|
| 56 |
-
## 服务端 / Server
|
| 57 |
|
| 58 |
```sh
|
| 59 |
-
sh run.sh -s 8080
|
| 60 |
curl http://127.0.0.1:8080/v1/chat/completions -H 'Content-Type: application/json' -d '{
|
| 61 |
"messages": [{"role": "user", "content": "用一句话介绍长江"}],
|
| 62 |
"chat_template_kwargs": {"enable_thinking": false}
|
| 63 |
}'
|
| 64 |
```
|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
-
##
|
| 72 |
|
| 73 |
-
-
|
| 74 |
-
- 不 tie embedding;输出头并入 4 核 decode kernel,一次调用同时给出贪心 argmax 与 top-1024(max/sumexp)采样结果。
|
| 75 |
-
- 包内 kernel:`cpm5_prefill256_mx8_kvc_c131072_npu4.axmodel`(prefill)、
|
| 76 |
-
`cpm5_decode1_mx8_kvc_c131072_npu4.axmodel`(decode + 输出头)。
|
| 77 |
-
- 无 MTP 头,未启用投机解码。
|
| 78 |
|
| 79 |
-
##
|
| 80 |
|
| 81 |
-
|
|
|
|
| 5 |
|
| 6 |
# MiniCPM5-2B on AX8860 (llama.cpp + ggml-axera)
|
| 7 |
|
| 8 |
+
在爱芯 AX8860 的 NPU 上用 llama.cpp 运行 MiniCPM5-2B 文本模型:思考开关、工具调用,OpenAI 兼容服务。
|
| 9 |
+
MiniCPM5-2B on the Axera AX8860 NPU with llama.cpp: text model with a thinking switch, tool calling and an OpenAI-compatible server.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
## 性能 / Performance
|
| 12 |
|
| 13 |
+
| | |
|
| 14 |
+
|---|---|
|
| 15 |
+
| decode | **59.5 tokens/s** |
|
| 16 |
+
| 4k prompt prefill | **6219 tokens/s**(3907 token 0.63 s) |
|
| 17 |
+
| 上下文 / context | 最长 / up to 131072 |
|
| 18 |
+
|
| 19 |
+
`sh bench.sh` 复现 / reproduce(生成 50 token / 50 generated tokens):
|
| 20 |
|
| 21 |
| prompt | `-c` | prompt 耗时 / time | decode tokens/s |
|
| 22 |
|---|---:|---:|---:|
|
| 23 |
+
| 5 token | 8192 | 0.04 s | 59.5 |
|
| 24 |
+
| 46 token | 8192 | 0.05 s | 59.2 |
|
| 25 |
+
| 3907 token | 8192 | 0.63 s | 51.9 |
|
| 26 |
+
| 5 token | 131072 | 0.04 s | 59.2 |
|
| 27 |
+
| 3907 token | 131072 | 0.63 s | 52.1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
|
| 29 |
## 快速开始 / Quick start
|
| 30 |
|
|
|
|
| 36 |
sh bench.sh ppl # 困惑度 / perplexity
|
| 37 |
```
|
| 38 |
|
| 39 |
+
需要 AX8860,SDK V0.5.1 或更新;HF 下载的文件没有执行权限,用 `sh` 调用即可 / needs an AX8860 with SDK V0.5.1+; call the scripts with `sh`.
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
服务请求 / Server request:
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
```sh
|
|
|
|
| 44 |
curl http://127.0.0.1:8080/v1/chat/completions -H 'Content-Type: application/json' -d '{
|
| 45 |
"messages": [{"role": "user", "content": "用一句话介绍长江"}],
|
| 46 |
"chat_template_kwargs": {"enable_thinking": false}
|
| 47 |
}'
|
| 48 |
```
|
| 49 |
|
| 50 |
+
## 文件 / Files
|
| 51 |
+
|
| 52 |
+
| 文件 / File | 说明 / Description |
|
| 53 |
+
|---|---|
|
| 54 |
+
| `MiniCPM5-2B-Q8_0.gguf` | 模型权重(官方 Q8_0)/ weights (official Q8_0),2.68 GB,md5 `57e37e3fd7758a9e4f7c687cf5c0e257` |
|
| 55 |
+
| `bin/` | llama.cpp 板端程序(静态链接)/ board programs (static) |
|
| 56 |
+
| `kernels/` | NPU kernel 2 个:prefill、decode(含输出头)+ `manifest.json` / two kernels: prefill and decode (with the output head) + `manifest.json` |
|
| 57 |
+
| `run.sh`,`chat_template.jinja` | 运行脚本与服务端对话模板 / run script and the server's chat template |
|
| 58 |
+
| `bench.sh` 及 prompt | 性能与困惑度复现 / benchmark and perplexity |
|
| 59 |
+
|
| 60 |
+
## 说明 / Notes
|
| 61 |
+
|
| 62 |
+
- 权重在加载时由 GGUF 转成 MXFP8,KV 为 BF16;Q8_0 与 F16 GGUF 都可加载 / weights are converted from the GGUF to MXFP8 at load, with a BF16 KV cache; both Q8_0 and F16 GGUFs load.
|
| 63 |
+
- 一套 kernel 覆盖到 131072 上下文,KV 按 `-c` 分配;用环境变量 `CTX` 调整 / one kernel set covers up to 131072 tokens and allocates the KV by `-c`; set `CTX` to change it.
|
| 64 |
+
- 思考开关用 `chat_template_kwargs.enable_thinking`;工具调用使用包内 `chat_template.jinja` / toggle thinking with `chat_template_kwargs.enable_thinking`; tool calling uses the bundled `chat_template.jinja`.
|
| 65 |
+
- 没有 MTP 头,不支持 MTP 投机解码 / no MTP head, so no MTP speculative decoding.
|
| 66 |
+
- `run.sh -c` 需要真实终端 / chat mode needs an interactive terminal.
|
| 67 |
+
- 运行时独占 NPU 4 核;服务端 `-np 1` / takes all 4 NPU cores; the server runs `-np 1`.
|
| 68 |
+
|
| 69 |
+
## 正确性 / Correctness
|
| 70 |
+
|
| 71 |
+
- 文本补全、服务端对话与思考开关���板上工作正常 / completion, server chat and the thinking switch work on the board.
|
| 72 |
+
- PPL(`sh bench.sh ppl`,`-c 512`)/ perplexity:
|
| 73 |
+
|
| 74 |
+
| 语言 / language | `-ub 1` | `-ub 4` |
|
| 75 |
+
|---|---:|---:|
|
| 76 |
+
| 中文 / zh | 16.70 | 16.72 |
|
| 77 |
+
| 英文 / en | 13.33 | 13.44 |
|
| 78 |
|
| 79 |
+
## 源码 / Sources
|
| 80 |
|
| 81 |
+
- llama.cpp:[ZHEQIUSHUI/llama.cpp](https://github.com/ZHEQIUSHUI/llama.cpp) @ `1970d6c5d`
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
|
| 83 |
+
## 更新 / Changelog
|
| 84 |
|
| 85 |
+
- 2026-11-15:首次发布 / first release.
|
SHA256SUMS
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
0cdb06219b58744420a63b9bee1523816d47bc0edb530114eef33738dcef790d BIN_COMMIT
|
| 2 |
c5415f8989bf88a8288f1b55a3cc371af53c07b0faa220a63bd7a990cfaba078 MiniCPM5-2B-Q8_0.gguf
|
| 3 |
-
|
| 4 |
94dbae1f8d9a4c6563b08c82d18bd08496827e0273ce15352860c179a5a98932 WEIGHTS.md5
|
| 5 |
8d4b00a1ffbb28665215172e794c13e6b681383113b25032d199cddce949236a bench.sh
|
| 6 |
53128c2a1f7bf9f25f2a2c84d75e88b7e1917ec3840b3228333514b3b20998cd bin/llama-bench
|
|
|
|
| 1 |
0cdb06219b58744420a63b9bee1523816d47bc0edb530114eef33738dcef790d BIN_COMMIT
|
| 2 |
c5415f8989bf88a8288f1b55a3cc371af53c07b0faa220a63bd7a990cfaba078 MiniCPM5-2B-Q8_0.gguf
|
| 3 |
+
fe3fbf7eb29607e5983ef56bb93d508ebb9c8fb7fef3a58da09752e6b5ae9ffe README.md
|
| 4 |
94dbae1f8d9a4c6563b08c82d18bd08496827e0273ce15352860c179a5a98932 WEIGHTS.md5
|
| 5 |
8d4b00a1ffbb28665215172e794c13e6b681383113b25032d199cddce949236a bench.sh
|
| 6 |
53128c2a1f7bf9f25f2a2c84d75e88b7e1917ec3840b3228333514b3b20998cd bin/llama-bench
|