convert-quantize
Qué hace
Esta skill enseña a un agente a convertir un modelo de IA de Hugging Face al formato MLX y, opcionalmente, a hacerlo más pequeño. Es para personas que quieren ejecutar un modelo en dispositivos Apple.
Cuándo usarla
- ✓Cuando un usuario quiere convertir un modelo de Hugging Face en una versión MLX para un Mac.
- ✓Cuando un usuario quiere una versión de 4 o 8 bits más pequeña de un modelo.
- ✓Cuando un comando de conversión o de cuantización falla y necesita arreglarse.
Link de la skill
https://github.com/Blaizzy/mlx-vlm/blob/main/skills/skills/convert-quantize/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Convierte este modelo de Hugging Face a MLX y crea una versión de 4 bits que quepa en mi Mac.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente confirma el origen y la familia del modelo, y luego ejecuta el comando de conversión con el tamaño de bits, el tamaño de grupo y el modo elegidos. Primero revisa la salida de ayuda, ya que las opciones pueden cambiar.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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").
Preguntas frecuentes
¿Se puede convertir cualquier modelo?
No. La skill indica que la familia del modelo ya debe estar soportada, o que la tarea es un trabajo de adaptación.
¿Qué hace el paso de cuantización?
Hace que el modelo convertido sea más pequeño, usando el tamaño de bits que elijas.
¿Puede subirse el resultado a Hugging Face?
Sí. La skill cubre la subida al Hub como opción.
Detalles
Descripción original del autor
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
Popularidad
- Estrellas en GitHub
- 5,7 mil
- Posición en el ranking
- #14749
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
cli-inference
5,7 milAyuda a tu agente a ejecutar o solucionar la inferencia de modelos MLX-VLM desde la línea de comandos, con entradas de texto, imagen y audio, y a encontrar las opciones adecuadas para cada tarea.
hf-cache-models
5,7 milAyuda a tu agente a listar los modelos que puede ver un servidor MLX-VLM en ejecución, incluidos los modelos en caché, personalizados y cargados, consultando su punto de descubrimiento de modelos.
reproducible-github-issues
5,7 milAyuda a tu agente a escribir un issue de GitHub claro y reproducible para MLX-VLM, con datos del entorno, comandos exactos y un ejemplo pequeño, para errores o resultados lentos.
server-inference
5,7 milAyuda a tu agente a ejecutar y depurar el servidor de API de MLX-VLM, cubriendo comprobaciones de estado, solicitudes de chat y de respuestas, el envío en flujo y los errores comunes de las solicitudes.
Skills parecidas
diffs
394 milPermite que tu agente genere un diff real y compartible de los cambios, como enlace de visualización o archivo de imagen, en lugar de un resumen escrito a mano.
coding-agent
394 milAyuda a tu agente a pasar un trabajo de programación grande a Codex, Claude Code u OpenCode como trabajador en segundo plano, y después revisar su progreso.
gh-issues
394 milAyuda a tu agente a encontrar incidencias de GitHub, elegir cuáles trabajar y abrir pull requests con correcciones, incluido el seguimiento de los comentarios de revisión.