minicpm5-deploy-litert
Skill này làm gì
Skill này hướng dẫn AI chạy một model MiniCPM5 trên thiết bị bằng runtime LiteRT-LM của Google. Skill dành cho người muốn chạy một model AI nhỏ trên laptop, máy tính để bàn hoặc điện thoại.
Khi nào nên dùng
- ✓Khi bạn muốn chạy một model MiniCPM5 trên máy tính hoặc điện thoại Android của mình.
- ✓Khi bạn có file .litertlm và cần chạy nó từ dòng lệnh hoặc máy chủ cục bộ.
- ✓Khi bạn muốn cùng một file model chạy được trên cả điện thoại và máy tính để bàn.
Liên kết skill
https://github.com/OpenBMB/MiniCPM/blob/main/skills/minicpm5-deploy-litert/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Giúp tôi chạy model MiniCPM5 trên laptop bằng LiteRT-LM và kiểm tra xem nó có trả lời một câu hỏi đơn giản không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill cài công cụ dòng lệnh litert-lm, tải file model, chạy một câu hỏi thử, và có thể khởi động máy chủ cục bộ nhận yêu cầu theo kiểu OpenAI.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Deploy MiniCPM5-2B / MiniCPM5-1B with LiteRT-LM (Android / iOS / desktop / IoT)
LiteRT-LM, Google's on-device runtime built on LiteRT (formerly TensorFlow Lite). One .litertlm bundle, CPU or GPU, through a CLI, an OpenAI-compatible server, Python, Kotlin and Swift. The bundles are hosted in litert-community. Human-readable reference: docs/deployment/litert.md.
Required input
| Var | Example | Default |
|---|---|---|
LITERT_REPO |
litert-community/MiniCPM5-2B or litert-community/MiniCPM5-1B |
litert-community/MiniCPM5-2B |
FILE |
MiniCPM5-2B_int4.litertlm (1.55 GB, the phone file) or MiniCPM5-2B_int8.litertlm (2.60 GB, reasoning that has to finish); 1B: minicpm_wi4b32_wi8_afp32.litertlm (CPU) or minicpm_wi4b32_wi8_afp32_gpu_opt.litertlm (GPU) |
MiniCPM5-2B_int4.litertlm |
BACKEND |
cpu or gpu |
cpu |
THINKING |
true (reason first) or false (direct answer) |
false |
PROMPT |
1+1=? |
1+1=? |
Steps
1. Install (once)
uv tool install litert-lm
2A. Run a pre-converted bundle (desktop CLI)
litert-lm run --from-huggingface-repo="${LITERT_REPO}" "${FILE}" \
--backend "${BACKEND}" --thinking "${THINKING:-false}" --prompt "${PROMPT}"
The first run downloads the file into ~/.litert-lm/cache/huggingface/<repo>/; later runs skip the download. With thinking on, the reasoning prints between [thought] and [/thought] and the answer follows; --thinking-budget 2048 caps the reasoning (4096 for math); THINKING=true makes the model reason first. Sampling as OpenBMB recommends: --top-k 40 --top-p 0.95 --temperature 1.0 (the CLI's default top-k is 1 = greedy, so temperature alone changes nothing).
2B. Android
- No code: the AI Edge Gallery app, Model manager → + → Import from HF → paste the file's Hugging Face link.
- Your own app:
implementation("com.google.ai.edge.litertlm:litertlm-android:0.17.0")from Google Maven, thelibOpenCL.so<uses-native-library>entries in the manifest for the GPU, then:
val engine = Engine(EngineConfig(modelPath = path, backend = Backend.GPU(), cacheDir = context.cacheDir.absolutePath))
engine.initialize()
engine.createConversation(ConversationConfig(maxOutputToken = 1024)).use { conversation ->
val reply = conversation.sendMessage("1+1=?")
println(reply); println(reply.channels["thought"])
}
ConversationConfig(thinkingConfig = ThinkingConfig(enableThinking = false)) turns thinking off. Full snippet, manifest and the Galaxy S26 check: the cookbook.
2C. OpenAI-compatible server (desktop)
litert-lm import --from-huggingface-repo="${LITERT_REPO}" "${FILE}" minicpm5-2b
litert-lm serve --host 127.0.0.1 --port 9379
curl http://127.0.0.1:9379/v1/chat/completions -H "Content-Type: application/json" \
-d '{"model": "minicpm5-2b", "messages": [{"role": "user", "content": "1+1=?"}], "reasoning_effort": "none"}'
reasoning_effort none = direct answer, any other value = thinking on; the cap field is max_completion_tokens; top_k is accepted alongside temperature / top_p / seed; "stream": true streams (server guide).
3. Validate
The reply contains 2 for 1+1=?: with --thinking false it is the whole reply; with thinking on it follows [/thought]. Through the server (2C), the same check is HTTP 200 with choices[0].message.content containing 2, and GET /v1/models lists minicpm5-2b.
Common pitfalls
- Thinking on the int4 file runs long chains: pass
--thinking falsefor direct answers, or use the int8 file when the reasoning has to complete. - int8 on iOS needs the increased-memory-limit entitlement (2.33 GB weight section; the default entitlements do not map it). int4's 1.28 GB main section is under the limit (checked on iPhone 17 Pro, GPU and CPU).
- First run per backend is slow: an XNNPACK weight cache is written beside the file on the CPU, kernels are compiled on the GPU (
--cache noto skip the disk cache). - Android GPU without the manifest entries:
initialize()succeeds, the first message fails withCan not find OpenCL library on this device. - Temperature without top-k does nothing: pass `--t
Câu hỏi thường gặp
Có những file model nào?
Skill nêu MiniCPM5-2B và MiniCPM5-1B, với nhiều loại file, như bản nhỏ hơn cho điện thoại và bản lớn hơn cho suy luận dài.
Tôi có thể dùng card đồ họa không?
Có. Skill cho bạn chọn backend CPU hoặc GPU.
Có chạy được trên Android không?
Có. Skill có phần về Kotlin API và ứng dụng AI Edge Gallery cho Android.
Chi tiết
Mô tả gốc của tác giả
Run MiniCPM5-2B or MiniCPM5-1B on-device with Google's LiteRT-LM runtime — the litert-lm CLI or its OpenAI-compatible server on a desktop, the Kotlin API or the AI Edge Gallery app on Android, the same .litertlm bundle on CPU or GPU. Use when the user says "LiteRT", "LiteRT-LM", "litertlm", ".litertlm", "Android", "Edge Gallery", "on-device app", or wants one bundle for phones and desktops.
repo: OpenBMB/MiniCPM
Độ phổ biến
- Sao GitHub
- 12k
- Vị trí xếp hạng
- #11530
- Giấy phép
- Apache-2.0
- Cập nhật
- 21/9/2026
Bình luận
- …
Thêm skill từ kho mã này
minicpm5-deploy-llama-cpp
12kChỉ cho agent cách chạy model MiniCPM5 bằng llama.cpp trên CPU hoặc card đồ họa gia đình, dùng file GGUF có sẵn.
minicpm5-deploy-lmstudio
12kGiúp agent chạy các model MiniCPM5 trong LM Studio, ứng dụng desktop có cửa sổ chat, và khởi động máy chủ cục bộ kiểu OpenAI của nó.
minicpm5-deploy-mlx
12kGiúp agent chạy các model MiniCPM5 trực tiếp trên máy Mac Apple Silicon bằng framework MLX của Apple, để chat và sinh văn bản cục bộ nhanh.
minicpm5-deploy-ollama
12kDạy agent chạy MiniCPM5 bằng Ollama trên laptop Mac hoặc Linux, dùng file GGUF và vài lệnh đơn giản.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.