convert-quantize
यह क्या करती है
यह स्किल एजेंट को सिखाती है कि Hugging Face का AI मॉडल MLX फ़ॉर्मैट में कैसे बदलें, और चाहें तो उसे छोटा करें। यह उन लोगों के लिए है जो Apple डिवाइस पर मॉडल चलाना चाहते हैं।
कब इस्तेमाल करें
- ✓जब उपयोगकर्ता Hugging Face मॉडल को Mac के लिए MLX संस्करण में बदलना चाहता है।
- ✓जब उपयोगकर्ता मॉडल का 4-बिट या 8-बिट छोटा संस्करण चाहता है।
- ✓जब कन्वर्ज़न या क्वांटाइज़ेशन कमांड फ़ेल हो और उसे ठीक करना हो।
Skill का लिंक
https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/convert-quantize/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“इस Hugging Face मॉडल को MLX में बदलिए और मेरे Mac में फ़िट होने वाला 4-बिट संस्करण बनाइए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट स्रोत और मॉडल परिवार की पुष्टि करता है, फिर चुने हुए बिट आकार, ग्रुप आकार और मोड के साथ convert कमांड चलाता है। फ़्लैग बदल सकते हैं, इसलिए पहले help आउटपुट जाँचता है।
तकनीकी सामग्री (मूल 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").
अक्सर पूछे जाने वाले सवाल
क्या हर मॉडल बदला जा सकता है?
नहीं। स्किल कहती है कि मॉडल परिवार पहले से सपोर्ट होना चाहिए, या काम पोर्टिंग का होगा।
quantize चरण क्या करता है?
यह आपके चुने हुए बिट आकार के अनुसार बदले गए मॉडल को छोटा करता है।
क्या नतीजा 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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
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आपके एजेंट को MLX-VLM API सर्वर चलाने और उसकी गड़बड़ी ठीक करने में मदद करती है, जिसमें हेल्थ जाँच, चैट और रिस्पॉन्स अनुरोध, स्ट्रीमिंग और आम अनुरोध त्रुटियाँ शामिल हैं।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।