Downloads · 30 days
214
13% of all-time downloads
badmadrad/Devstral-Small-2-24B-Instruct-2512-MLX-3bit
Devstral-Small-2-24B-Instruct-2512-MLX-3bit is a text generation model from badmadrad. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as apache-2.0.
MLX-optimized 3-bit quantization of mistralai/Devstral-Small-2-24B-Instruct-2512 for Apple Silicon Macs.
Downloads · 30 days
214
13% of all-time downloads
All-time downloads
1.6K
Public
Parameters
23.6B
20.6 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors10.3 GB · 100%
How the weights are stored.
U3223.6B · 100%
From the Hugging Face model README
MLX-optimized 3-bit quantization of mistralai/Devstral-Small-2-24B-Instruct-2512 for Apple Silicon Macs.
[AVAILABLE_TOOLS] / [TOOL_CALLS] / [TOOL_RESULTS] supportThis model was created using a dequantize-requantize workflow for optimal 3-bit quality:
# Step 1: Dequantize the MLX 4-bit model back to BF16
mlx_lm.convert \
--hf-path mlx-community/mistralai_Devstral-Small-2-24B-Instruct-2512-MLX-4Bit \
--mlx-path ./devstral-v2-bf16 \
--dequantize --dtype bfloat16
# Step 2: Requantize from BF16 to 3-bit
mlx_lm.convert \
--hf-path ./devstral-v2-bf16 \
--mlx-path ./devstral-v2-3bit \
--quantize --q-bits 3 --q-group-size 64
Why this works: Direct 3-bit quantization from the original HuggingFace BF16 weights produces degenerate output ("decay decay decay") due to weight distribution differences during the PyTorch-to-MLX conversion. Going through the MLX 4-bit model's dequantized BF16 preserves the weight structure that MLX inference requires.
from mlx_lm import load, generate
model, tokenizer = load("badmadrad/Devstral-Small-2-24B-Instruct-2512-MLX-3bit")
messages = [{"role": "user", "content": "Write a Python function to sort a list."}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
response = generate(model, tokenizer, prompt=prompt, max_tokens=500)
print(response)
tools = [{"type": "function", "function": {"name": "read_file", "description": "Read a file", "parameters": {"type": "object", "properties": {"path": {"type": "string"}}, "required": ["path"]}}}]
messages = [{"role": "user", "content": "Read the file main.py"}]
prompt = tokenizer.apply_chat_template(messages, tools=tools, tokenize=False, add_generation_prompt=True)
response = generate(model, tokenizer, prompt=prompt, max_tokens=200)
# Output: [TOOL_CALLS]read_file[ARGS]{"path": "main.py"}
from mlx_lm import load
from mlx_lm.generate import speculative_generate_step
model, tokenizer = load("badmadrad/Devstral-Small-2-24B-Instruct-2512-MLX-3bit")
draft_model, _ = load("badmadrad/Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit")
# Draft model proposes tokens, main model verifies — faster generation
| Variant | Size | Quality | Tool Calling |
|---|---|---|---|
| BF16 (original) | ~48 GB | Best | Yes |
| 4-bit (mlx-community) | ~12 GB | Great | Yes |
| 3-bit (this model) | ~9.6 GB | Good | Yes |
Apache 2.0 (same as base model)