convert-quantize
하는 일
이 스킬은 Hugging Face의 AI 모델을 MLX 형식으로 변환하고, 필요하면 더 작게 만드는 방법을 에이전트에게 가르칩니다. Apple 기기에서 모델을 실행하려는 사람을 위한 스킬입니다.
사용하는 경우
- ✓Hugging Face 모델을 Mac용 MLX 버전으로 바꾸고 싶을 때.
- ✓모델의 4비트 또는 8비트 더 작은 버전이 필요할 때.
- ✓변환 또는 양자화 명령이 실패해서 고쳐야 할 때.
스킬 링크
https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/convert-quantize/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 Hugging Face 모델을 MLX로 변환하고, 제 Mac에 맞는 4비트 버전을 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 원본과 모델 계열을 확인한 뒤, 선택한 비트 크기, 그룹 크기, 모드로 변환 명령을 실행합니다. 옵션은 바뀔 수 있으므로 먼저 도움말 출력을 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Convert & Quantize
Use this workflow for mlx_vlm.convert — turning a Hugging Face checkpoint into MLX format, optionally quantizing it.
First Checks
- Confirm the source: a Hugging Face repo id or a local path (
--hf-path, alias--model). - Confirm the model family is supported in
mlx_vlm/models/(a folder named after theconfig.jsonmodel_type). If not, this is a porting task — switch toSkill("mlx-vlm-skills:add-new-model"). - Verify current flags before finalizing:
uv run mlx_vlm.convert --help. - Entry point is
mlx_vlm.convert.python -m mlx_vlm.convertis deprecated; useuv run mlx_vlm.convert ...orpython -m mlx_vlm convert ....
Command Patterns
Plain convert (no quantization), saves to ./mlx_model by default:
uv run mlx_vlm.convert --hf-path <repo-or-path> --mlx-path ./out-mlx
4-bit affine quantization (RTN, the default method):
uv run mlx_vlm.convert --hf-path <repo-or-path> --mlx-path ./out-4bit -q --q-bits 4 --q-group-size 64
Other quant modes (--q-mode sets its own bit/group defaults):
# mxfp4 (group 32, 4 bit), nvfp4 (group 16, 4 bit), mxfp8 (group 32, 8 bit)
uv run mlx_vlm.convert --hf-path <repo-or-path> --mlx-path ./out-mxfp4 -q --q-mode mxfp4
Mixed-bit recipe (per-layer bit allocation, llama.cpp-style):
# recipes: mixed_2_6 mixed_3_4 mixed_3_5 mixed_3_6 mixed_3_8 mixed_4_6 mixed_4_8
uv run mlx_vlm.convert --hf-path <repo-or-path> --mlx-path ./out-mixed -q --quant-predicate mixed_3_6
AWQ (activation-aware, needs a calibration pass):
uv run mlx_vlm.convert --hf-path <repo-or-path> --mlx-path ./out-awq -q --quant-method awq \
--calibration multimodal --calibration-data /path/to/media # or --calibration text (default)
dtype cast only / dequantize:
uv run mlx_vlm.convert --hf-path <repo-or-path> --mlx-path ./out-bf16 --dtype bfloat16
uv run mlx_vlm.convert --hf-path <quantized-repo> --mlx-path ./out-fp -d # dequantize
Upload the result to the Hub:
uv run mlx_vlm.convert --hf-path <repo> --mlx-path ./out -q --upload-repo <user>/<name>-mlx
Key Facts
- Multimodal modules are skipped from quantization by default (
skip_multimodal_module) — vision/audio towers stay full precision; only the language model is quantized. This is expected, not a bug. --q-modechoices:affine(default, group 64 / 4 bit),mxfp4(32/4),nvfp4(16/4),mxfp8(32/8).--q-bits/--q-group-sizeoverride the mode defaults.--quant-method:rtn(default, round-to-nearest) orawq(needs calibration;--calibration text|multimodal, optional--calibration-data).-q/--quantizeand-d/--dequantizeare mutually exclusive.--dtype(fromconfig.jsontorch_dtypeif unset) casts float weights; useful for shrinking fp32 → bf16 without quantizing.- The converted folder gets the weights, copied
*.py/*.json, the processor, a regeneratedconfig.json, and a model card — it is ready formlx_vlm.generateand the server.
Validation
- After converting, load and run a tiny generation to prove the checkpoint works — see
Skill("mlx-vlm-skills:cli-inference"). Run on Apple Silicon with enough RAM for the model; do not attempt a large model on an 8 GB machine. - For quality, compare a few greedy outputs between the source and the quantized model; large drops usually mean too-low bits or a wrong
--q-modefor the model. - For code changes touching conversion, run
uv run --with pytest python -m pytest mlx_vlm/tests/test_utils.py -qand any model-specific test. - If the outcome is a bug report, switch to
Skill("mlx-vlm-skills:reproducible-github-issues").
자주 묻는 질문
모든 모델을 변환할 수 있나요?
아니요. 모델 계열이 이미 지원되어야 하며, 그렇지 않으면 이식 작업이라고 스킬이 설명합니다.
양자화 단계는 무엇을 하나요?
선택한 비트 크기에 따라 변환된 모델을 더 작게 만듭니다.
결과를 Hugging Face에 업로드할 수 있나요?
네. Hub에 업로드하는 것을 선택 사항으로 다룹니다.
상세 정보
작성자의 원본 설명
Use this skill when the user wants to convert a Hugging Face model to MLX or quantize/dequantize one with mlx_vlm.convert, including bits and group size, quant modes (affine, mxfp4, nvfp4, mxfp8), RTN vs AWQ, mixed-bit recipes, dtype casts, calibration (text or multimodal), local vs Hub paths, revisions, uploading to the Hub, and convert/quant errors.
repo: Blaizzy/mlx-vlm
인기도
- GitHub 스타
- 5.7k
- 순위
- #14749
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
cli-inference
5.7k명령줄에서 텍스트, 이미지, 오디오 입력으로 MLX-VLM 모델 추론을 실행하거나 문제를 해결하고, 각 작업에 맞는 옵션을 찾도록 에이전트를 돕습니다.
hf-cache-models
5.7k에이전트가 실행 중인 MLX-VLM 서버가 볼 수 있는 모델을 캐시, 사용자 정의, 로드 여부까지 포함해 확인하도록 돕습니다.
reproducible-github-issues
5.7k에이전트가 MLX-VLM의 버그나 느린 결과에 대해 환경 세부 정보, 정확한 명령, 작은 예제를 담은 재현 가능한 GitHub 이슈를 작성하도록 돕습니다.
server-inference
5.7k상태 확인, 채팅과 responses 요청, 스트리밍, 흔한 요청 오류를 다루며 MLX-VLM API 서버를 실행하고 디버그하도록 에이전트를 돕습니다.