minicpm5-deploy-llama-cpp
它能做什么
这个技能指导你的 AI 使用 llama.cpp 运行 MiniCPM5,llama.cpp 是一个可在多种系统上运行的轻量程序。适合只有 CPU 的电脑、消费级显卡,或没有安装 Python 的人员。
适用场景
- ✓你想在没有高性能显卡的电脑上运行 MiniCPM5 的时候。
- ✓你想用 llama-cli 在终端中聊天,或用 llama-server 运行本地服务器的时候。
- ✓你没有可用的 Python,但仍想运行该模型的时候。
技能链接
https://github.com/OpenBMB/MiniCPM/blob/main/skills/minicpm5-deploy-llama-cpp/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我用 llama.cpp 在我的电脑上运行 MiniCPM5,以便我可以在终端中与它聊天。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能安装 llama.cpp,下载你选择大小的 GGUF 模型文件,然后启动终端聊天或本地服务器。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Deploy MiniCPM5-1B and MiniCPM5-2B with llama.cpp
CPU / edge / consumer-GPU deployment via the released GGUF artifacts. The artifacts work directly with vanilla llama.cpp and every downstream runtime (Ollama / LM Studio / llama-cpp-python).
Required input
| Var | Example | Default |
|---|---|---|
GGUF_REPO |
openbmb/MiniCPM5-2B-GGUF |
required; openbmb/MiniCPM5-1B-GGUF also works |
QUANT |
Q4_K_M (1.56 GB, recommended) / Q8_0 (2.68 GB) / F16 (5.04 GB) |
Q4_K_M |
NGL |
99 (all layers on GPU) / 0 (CPU only) |
99 if NVIDIA GPU, else 0 |
CTX |
8192 (default) up to 131072 (128 K) |
8192 |
Steps
1. Install llama.cpp
# macOS
brew install llama.cpp
# Linux / cross-platform: pre-built binary
curl -fsSL https://github.com/ggerganov/llama.cpp/releases/latest/download/llama-cli-linux.tar.gz | tar -xz
# OR build from source:
git clone --depth=1 https://github.com/ggerganov/llama.cpp.git && cd llama.cpp
mkdir build && cd build
cmake .. -DGGML_CUDA=ON -DCMAKE_BUILD_TYPE=Release # CPU-only: omit GGML_CUDA=ON
cmake --build . --config Release -j $(nproc) --target llama-cli llama-server
2. Download the GGUF
mkdir -p ~/minicpm5 && cd ~/minicpm5
huggingface-cli download ${GGUF_REPO} MiniCPM5-2B-${QUANT}.gguf --local-dir .
3a. Interactive chat (CLI)
llama-cli -m MiniCPM5-2B-${QUANT}.gguf \
-n 2048 --temp 1.0 --top-p 0.95 --min-p 0.0 -ngl ${NGL} -c ${CTX}
3b. OpenAI-compatible HTTP server
llama-server -m MiniCPM5-2B-${QUANT}.gguf \
--port 8080 -ngl ${NGL} -c ${CTX} --jinja
4. Validate
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "MiniCPM5-2B",
"messages": [{"role":"user","content":"1+1=?"}],
"temperature": 1.0, "top_p": 0.95, "min_p": 0.0, "max_tokens": 64
}'
Expected: "2" in the reply.
In llama.cpp, the default min_p=0.05 can lead to repetitive output: it filters out tokens whose probability is below 5% of the highest-probability token, potentially discarding the exact tokens needed to break out of a repetition loop. To prevent this, we set min_p=0.0.
Sampling defaults
| Mode | --temp |
--top-p |
--min-p |
|---|---|---|---|
| MiniCPM5-2B Think | 1.0 | 0.95 | 0.0 |
| MiniCPM5-1B Think | 0.9 | 0.95 | 0.0 |
| MiniCPM5-1B No-think | 0.7 | 0.95 | 0.0 |
Choosing a quant
| Quant | Disk | Quality |
|---|---|---|
| F16 | 5.04 GB | reference |
| Q8_0 | 2.68 GB | ~indistinguishable from F16 |
| Q4_K_M | 1.56 GB | small drop, ideal for laptops |
Common pitfalls
- Slow on CPU + large context: drop
-c 131072to-c 8192if you don't need 128 K.
Building your own GGUF (advanced)
If you've trained your own MiniCPM5-1B or MiniCPM5-2B variant, build a GGUF with:
python convert_hf_to_gguf.py /path/to/your-fp16-hf --outfile out/F16.gguf --outtype f16
llama-quantize out/F16.gguf out/Q4_K_M.gguf Q4_K_M
Trained a LoRA adapter (not a full model) and want to apply it at runtime with --lora instead of baking it in? Convert it to a GGUF adapter — see minicpm5-finetune-gguf-lora.
When NOT to use
- NVIDIA GPU + want OpenAI-compatible serving →
minicpm5-deploy-vllm - Apple Silicon native →
minicpm5-deploy-mlxis faster - Just want one-line desktop run →
minicpm5-deploy-ollama - Want a desktop GUI →
minicpm5-deploy-lmstudio
Reference
常见问题
我应该选择哪个模型文件?
这个技能推荐 Q4_K_M 作为默认选项,Q8_0 和 F16 是较大的选项。
它能使用我的显卡吗?
可以。这个技能有一个设置,可以将所有层放到 GPU 上,或只使用 CPU。
它可以使用多少上下文?
这个技能默认设置为 8192,并说明最大值为 131072,即 128K。
详情
作者的原始描述
Run MiniCPM5-1B or MiniCPM5-2B with llama.cpp using the released GGUF artifacts (F16 / Q8_0 / Q4_K_M). Use when the user wants CPU-only / consumer-GPU / cross-platform native deployment, asks for "llama.cpp", "llama-cli", "llama-server", "GGUF", or has no Python available.
repo: OpenBMB/MiniCPM
热度
- GitHub 星标
- 12k
- 排名
- #11531
- 许可证
- Apache-2.0
- 更新时间
- 2026/9/21
评论
- …
同一仓库的更多技能
minicpm5-deploy-litert
12k帮你的智能体使用谷歌的 LiteRT-LM 运行时,在电脑或 Android 手机上运行 MiniCPM5 模型,只需一个模型文件。
minicpm5-deploy-lmstudio
12k帮你的智能体在 LM Studio 中运行 MiniCPM5 模型,这是一款带聊天窗口的桌面应用,并启动其本地 OpenAI 风格服务器。
minicpm5-deploy-mlx
12k帮你的智能体使用苹果的 MLX 框架,在 Apple 芯片 Mac 上原生运行 MiniCPM5 模型,实现快速的本地聊天和文本生成。
minicpm5-deploy-ollama
12k教你的智能体在 Mac 或 Linux 笔记本电脑上使用 Ollama 运行 MiniCPM5,只需一个 GGUF 文件和几条简单命令。