Ejecuta Gemma con MLX

MLX es un framework de arrays para el aprendizaje automático en Apple Silicon.

Inicio rápido

Instala desde el índice de paquetes de Python (PyPI)

pip install mlx mlx-lm mlx-vlm

Comando de ejemplo:

# Text Generation
mlx_lm.generate --model mlx-community/gemma-4-e2b-it-4bit --prompt "Who are you?"

# Vision Task
mlx_vlm.generate --model mlx-community/gemma-4-e2b-it-4bit --prompt "Describe this image." --image <path_to_image>

Puedes iniciar el servidor con el siguiente comando:

mlx_vlm.server --port 8080

# Preload a model at startup (Hugging Face repo or local path)
mlx_vlm.server --model mlx-community/gemma-4-e2b-it-4bit

Esto crea un servidor que te permite acceder a tu modelo con el extremo compatible con OpenAI (http://localhost:8080/v1).

Para obtener más información y consultar las instrucciones sobre cómo usar MLX con Gemma, consulta el repositorio oficial: