MLX quants
Collection
191 items • Updated
Run Xylolabs/gemma-4-31B-MLX-8bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/Xylolabs/gemma-4-31B-MLX-8bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/Xylolabs/gemma-4-31B-MLX-8bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to evaluate https://huggingface.co/Xylolabs/gemma-4-31B-MLX-8bit. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
How to use Xylolabs/gemma-4-31B-MLX-8bit with MLX:
# Make sure mlx-lm is installed
# pip install --upgrade mlx-lm
# if on a CUDA device, also pip install mlx[cuda]
# Generate text with mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("Xylolabs/gemma-4-31B-MLX-8bit")
prompt = "Once upon a time in"
text = generate(model, tokenizer, prompt=prompt, verbose=True)How to use Xylolabs/gemma-4-31B-MLX-8bit with MLX LM:
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "Xylolabs/gemma-4-31B-MLX-8bit" --prompt "Once upon a time"
MLX text weights from google/gemma-4-31B for mlx-lm, with the vision tower omitted.
pip install mlx-lm==0.32.2
mlx_lm.generate --model Xylolabs/gemma-4-31B-MLX-8bit --prompt "The history of the printing press began"
The plots average WikiText-2, raw chat and held-out text scores against the model's MLX BF16 weights.
| Quant | Size | WikiText-2 KL | top-1 | Raw chat KL | top-1 | Held-out KL | top-1 |
|---|---|---|---|---|---|---|---|
| MLX 8-bit | 32.617 GB | 0.002411 | 98.206% | 0.002388 | 98.451% | 0.002419 | 98.157% |
| mlx-community MLX 8-bit | 32.617 GB | 0.002362 | 98.206% | 0.001901 | 98.373% | 0.002205 | 98.059% |
| MLX 4-bit | 17.735 GB | 0.031330 | 93.275% | 0.026509 | 93.784% | 0.032655 | 93.255% |
| mlx-community MLX 4-bit | 17.269 GB | 0.077446 | 90.010% | 0.068953 | 90.608% | 0.087136 | 88.431% |
| Hardware | Memory | File | Context |
|---|---|---|---|
| Mac Studio M5 Max, 32-core GPU | 36 GB unified | Xylolabs/gemma-4-31B-MLX-4bit (4-bit, 17.7 GB) |
32K |
| Mac Studio M5 Max, 40-core GPU | 48 GB unified | Xylolabs/gemma-4-31B-MLX-4bit (4-bit, 17.7 GB) |
32K |
| Mac Studio M5 Max, 40-core GPU | 64 GB unified | Xylolabs/gemma-4-31B-MLX-8bit (8-bit, 32.6 GB) |
32K |
| Mac Studio M5 Ultra | 96 GB unified | Xylolabs/gemma-4-31B-MLX-8bit (8-bit, 32.6 GB) |
32K |
| Mac Studio M5 Max, 40-core GPU | 128 GB unified | Xylolabs/gemma-4-31B-MLX-8bit (8-bit, 32.6 GB) |
32K |
| Mac Studio M5 Ultra | 256 GB unified | Xylolabs/gemma-4-31B-MLX-8bit (8-bit, 32.6 GB) |
32K |
| Mac Studio M5 Ultra, 80-core GPU | 512 GB unified | Xylolabs/gemma-4-31B-MLX-8bit (8-bit, 32.6 GB) |
32K |
Apache License 2.0, in LICENSE; modifications in NOTICE.
8-bit
Base model
google/gemma-4-31B