Gemma'yı MLX ile çalıştırma

MLX, Apple Silicon'da makine öğrenimi için kullanılan bir dizi çerçevesidir.

Hızlı başlangıç

Python Paket Dizini'nden (PyPI) yükleme

pip install mlx mlx-lm mlx-vlm

Örnek komut:

# 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>

Sunucuyu şu komutla başlatabilirsiniz:

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

Bu işlem, OpenAI ile uyumlu uç nokta (http://localhost:8080/v1) ile modelinize erişmenizi sağlayan bir sunucu oluşturur.

MLX'i Gemma ile kullanma hakkında daha fazla bilgi ve talimat için resmi depoya bakın: