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

minicpm5-deploy-mlx

하는 일

이 스킬은 Apple의 MLX 프레임워크로 Apple Silicon Mac에서 MiniCPM5를 실행하도록 AI를 안내합니다. 자신의 기기에서 가장 빠른 로컬 옵션을 원하는 Mac 사용자를 위한 스킬입니다.

사용하는 경우

  • ✓M 시리즈 Mac이 있고 MiniCPM5를 로컬에서 실행하고 싶을 때.
  • ✓명령줄에서 mlx_lm으로 텍스트를 생성하고 싶을 때.
  • ✓Hugging Face 모델이 있고 Mac에서 MLX 형식으로 변환하고 싶은 경우.

스킬 링크

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

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

사용 방법

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

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

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

AI에게 요청하는 예시

“Mac에서 MLX로 MiniCPM5를 실행하고, 1+1에 대해 올바른 답을 주는지 확인해 주세요.”

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

작동 방식

이 스킬은 mlx-lm 도구를 설치하고, 준비된 MLX 모델로 테스트 프롬프트를 실행합니다. 이미 가지고 있는 모델을 MLX 형식으로 변환할 수도 있습니다.

기술 내용 (원본 SKILL.md)

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

Deploy MiniCPM5-1B and MiniCPM5-2B with MLX (Apple Silicon)

Apple's on-device tensor framework. Highest throughput on M-series. Stays inside one Python process — no separate server, no llama.cpp build chain.

Required input

Var Example Default
MLX_REPO openbmb/MiniCPM5-2B-MLX (pre-converted 4-bit affine) required; openbmb/MiniCPM5-1B-MLX also works
OR HF_REPO + QUANT openbmb/MiniCPM5-2B, 4bit or bf16 for local conversion
MAX_TOKENS 200 200

Steps

1. Install (once)

pip install "mlx-lm>=0.31" "gguf"

2A. Use a pre-converted MLX repo (recommended when available)

mlx_lm.generate --model "${MLX_REPO}" \
    --prompt "<|im_start|>user
1+1=?<|im_end|>
<|im_start|>assistant
" \
    --max-tokens ${MAX_TOKENS} --temp 1.0 --top-p 0.95

2B. Convert from a HF checkpoint locally (advanced)

Use mlx_lm.convert only if you have a self-trained HF fp16 checkpoint:

HF=/path/to/your-fp16-hf

# Convert: bf16
mlx_lm.convert --hf-path "$HF" --mlx-path ./minicpm5-mlx-bf16

# Convert: 4-bit (smaller / faster)
mlx_lm.convert --hf-path "$HF" --mlx-path ./minicpm5-mlx-q4 -q --q-bits 4

Then run as in 2A.

3. Validate

The reply should contain "2" for 1+1=?.

OpenAI-compatible server (mlx-lm)

mlx_lm.server --model "${MLX_REPO}" --host 127.0.0.1 --port 8000

curl http://127.0.0.1:8000/v1/chat/completions \
    -H "Content-Type: application/json" \
    -d '{
        "model": "default",
        "messages": [{"role":"user","content":"1+1=?"}],
        "temperature": 1.0, "top_p": 0.95, "max_tokens": 64
    }'

Common pitfalls

  • Slow first generate: MLX JIT-compiles kernels on first call (~5-10 s); subsequent calls hit the warm cache.
  • Model runs past <|im_end|>: only happens on mlx-lm < 0.31 (older versions ignore multi-id eos_token_id lists). Upgrade, or pass --extra-eos-token "<|im_end|>" as a manual override — <|im_end|> is token id 130073 and is already listed in generation_config.json on 0.31+.

When NOT to use

  • Not on Apple Silicon → minicpm5-deploy-llama-cpp (CPU/CUDA) or minicpm5-deploy-vllm (CUDA)
  • Want a desktop GUI → minicpm5-deploy-lmstudio (LM Studio bundles an MLX runtime)
  • Want one-line CLI run → minicpm5-deploy-ollama

Reference

docs/deployment/mlx.md

자주 묻는 질문

모델을 직접 변환해야 하나요?

보통은 아닙니다. 이 스킬은 준비된 MLX 저장소가 있으면 그것을 사용하라고 권장합니다.

작동하는지 어떻게 알 수 있나요?

1+1 질문에 대한 답에 숫자 2가 들어 있어야 한다고 이 스킬은 설명합니다.

로컬 서버도 실행할 수 있나요?

네. mlx_lm.server를 통한 OpenAI 호환 서버가 포함되어 있습니다.

상세 정보

작성자의 원본 설명

Run MiniCPM5-1B or MiniCPM5-2B natively on Apple Silicon with Apple's MLX framework. Use when the user has an Apple Silicon Mac and asks for "MLX", "mlx_lm", "mlx_lm.convert", "mlx_lm.generate", or wants the fastest path on Apple Silicon.

repo: OpenBMB/MiniCPM

인기도

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

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬