본문으로 건너뛰기
Skillpedia
배포 및 클라우드 (DevOps)12k · #11530

minicpm5-deploy-litert

하는 일

이 스킬은 Google의 LiteRT-LM 런타임으로 기기에서 MiniCPM5 모델을 실행하도록 AI를 안내합니다. 노트북, 데스크톱, 휴대폰에서 돌아가는 작은 AI 모델을 원하는 사람을 위한 스킬입니다.

사용하는 경우

  • ✓자신의 컴퓨터나 Android 휴대폰에서 MiniCPM5 모델을 실행하고 싶을 때.
  • ✓.litertlm 파일이 있고 명령줄이나 로컬 서버에서 실행해야 할 때.
  • ✓같은 모델 파일을 휴대폰과 데스크톱 모두에서 쓰고 싶은 경우.

스킬 링크

https://github.com/OpenBMB/MiniCPM/blob/main/skills/minicpm5-deploy-litert/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/OpenBMB/MiniCPM/blob/main/skills/minicpm5-deploy-litert/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“LiteRT-LM으로 노트북에서 MiniCPM5 모델을 실행하고, 간단한 질문에 답하는지 확인하도록 도와주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 litert-lm 명령줄 도구를 설치하고, 모델 파일을 내려받은 뒤 테스트 질문을 실행합니다. OpenAI 방식의 요청을 받는 로컬 서버도 시작할 수 있습니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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, the libOpenCL.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 false for 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 no to skip the disk cache).
  • Android GPU without the manifest entries: initialize() succeeds, the first message fails with Can not find OpenCL library on this device.
  • Temperature without top-k does nothing: pass `--t
자주 묻는 질문

어떤 모델 파일을 쓸 수 있나요?

MiniCPM5-2B와 MiniCPM5-1B를 언급하며, 휴대폰용 작은 파일과 긴 추론용 큰 파일 등 여러 형식이 있습니다.

그래픽 카드를 쓸 수 있나요?

네. CPU 또는 GPU 백엔드 중에서 선택할 수 있습니다.

Android에서도 실행되나요?

네. 이 스킬은 Kotlin API와 Android용 AI Edge Gallery 앱을 다룹니다.

상세 정보

작성자의 원본 설명

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

인기도

GitHub 스타
12k
순위
#11530
라이선스
Apache-2.0
업데이트
2026. 9. 21.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬