Statistically lossless quantisation
Collection
MLX quants done using a port of IST-DASLab SLQ. The mechanism used is Heuristics based greedy allocation. Not the one paper suggests • 10 items • Updated
How to use hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw 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("hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw")
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 hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw with Pi:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw"
# 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": "hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw"
}
]
}
}
}# Start Pi in your project directory: pi
How to use hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw",
"messages": [
{"role": "user", "content": "Hello"}
]
}'How to use hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw with Hermes Agent:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw"
# 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 hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw
hermes
How to use hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw with OpenClaw:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw"
# 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 "hermitdave/Spark-X2.6-4B-MLX-SLQ-4.50bpw" \ --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"
Statistically-lossless mixed-bitwidth quantization of XHToken/Spark-X2.6-4B using SLQ (COLM 2026).
uint32, dequantized inside mx.quantized_matmulmlx_lm.generate --model hermitdave/Spark-X2.6-4B-SLQ-4.50bpw --dtype float16
Or in Python:
from mlx_lm import load, generate
model, tokenizer = load("hermitdave/Spark-X2.6-4B-SLQ-4.50bpw", trust_remote_code=True)
response = generate(model, tokenizer, "Hello, how are you?", max_tokens=100)
trust_remote_code=True is required because mlx-lm imports the generated slq_model.py to build the architecture. Only load checkpoints you trust.
| Model | PPL | Ratio |
|---|---|---|
| BF16 | 23.22 | 1.000 |
| SLQ 4.50bpw | 24.52 | 1.056 |
| Task | BF16 | SLQ 4.50bpw | Recovery |
|---|---|---|---|
| arc_challenge | 0.4100 | 0.3600 | 0.8780 |
| hellaswag | 0.4000 | 0.4000 | 1.0000 |
| winogrande | 0.5500 | 0.5100 | 0.9273 |
| mean | 0.9351 |
| Metric | Value |
|---|---|
| Symmetric KLD | 7.949 |
| EAR | 0.9129 |
| KL divergence | 0.0614 |
@inproceedings{helcig2026slq,
title = {{Statistically-Lossless Quantization of Large Language Models}},
author = {{Michael Helcig and Eldar Kurtic and Dan Alistarh}},
booktitle = {{Conference on Language Modeling (COLM)}},
year = {2026},
url = {https://arxiv.org/abs/2605.02404},
}
4-bit