MLX quants
Collection
4-bit and 8-bit MLX weights for Apple silicon. • 49 items • Updated
How to use Xylolabs/gpt-oss-20b-MLX-8bit with MLX:
# Make sure mlx-lm is installed
# pip install --upgrade mlx-lm
# Generate text with mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("Xylolabs/gpt-oss-20b-MLX-8bit")
prompt = "Write a story about Einstein"
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True
)
text = generate(model, tokenizer, prompt=prompt, verbose=True)How to use Xylolabs/gpt-oss-20b-MLX-8bit with Pi:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Xylolabs/gpt-oss-20b-MLX-8bit"
# Install Pi:
npm install -g @earendil-works/pi-coding-agent
# Add to ~/.pi/agent/models.json:
{
"providers": {
"mlx-lm": {
"baseUrl": "http://localhost:8080/v1",
"api": "openai-completions",
"apiKey": "none",
"models": [
{
"id": "Xylolabs/gpt-oss-20b-MLX-8bit"
}
]
}
}
}# Start Pi in your project directory: pi
How to use Xylolabs/gpt-oss-20b-MLX-8bit with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Xylolabs/gpt-oss-20b-MLX-8bit"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "Xylolabs/gpt-oss-20b-MLX-8bit"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8080/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Xylolabs/gpt-oss-20b-MLX-8bit",
"messages": [
{"role": "user", "content": "Hello"}
]
}'How to use Xylolabs/gpt-oss-20b-MLX-8bit with Hermes Agent:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Xylolabs/gpt-oss-20b-MLX-8bit"
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Xylolabs/gpt-oss-20b-MLX-8bit
hermes
How to use Xylolabs/gpt-oss-20b-MLX-8bit with OpenClaw:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Xylolabs/gpt-oss-20b-MLX-8bit"
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Xylolabs/gpt-oss-20b-MLX-8bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
openclaw agent --local --agent main --message "Hello from Hugging Face"
openai/gpt-oss-20b converted to MLX for mlx-lm. The MoE experts keep the original MXFP4 weights. Attention, router, token embedding and LM head: 8-bit affine, group size 64, scales and biases in float16. Norms, biases and attention sinks in float16.
pip install mlx-lm==0.32.2
mlx_lm.generate --model Xylolabs/gpt-oss-20b-MLX-8bit --prompt "What is the capital of Australia?"
KL and top-1 against the original weights (MXFP4 experts, other weights BF16) on WikiText-2, chat and held-out text (40/20/20 chunks of 512).
| Quant | Size | WikiText-2 KL | top-1 | Chat KL | top-1 | Held-out KL | top-1 | 7-question answer check |
|---|---|---|---|---|---|---|---|---|
| MLX 4-bit | 11.47 GB | 0.354894 | 54.66% | 0.704089 | 67.49% | 0.452159 | 53.51% | 7/7 |
| MLX 8-bit | 12.08 GB | 0.069925 | 85.13% | 0.103656 | 89.75% | 0.074301 | 83.04% | 7/7 |
| BF16 | 13.76 GB | 7/7 |
Apache License 2.0. See LICENSE, USAGE_POLICY and NOTICE.
4-bit
Base model
openai/gpt-oss-20b