Instructions to use badmadrad/Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use badmadrad/Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit 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("badmadrad/Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit") 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) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
- MLX LM
How to use badmadrad/Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "badmadrad/Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "badmadrad/Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "badmadrad/Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit
A 4-bit quantized MLX conversion of alamios/Mistral-Small-3.1-DRAFT-0.5B, optimized for speculative decoding on Apple Silicon.
Purpose
This is a draft model (0.5B parameters) designed for speculative decoding with larger Mistral-family target models:
- Mistral Small 3.1 24B
- Devstral Small 2 24B (
mistralai/Devstral-Small-2-24B-Instruct-2512) - Any Mistral model sharing the Tekken tokenizer (131K vocab)
Speculative decoding uses this small, fast model to propose candidate tokens, which the larger target model verifies in a single forward pass. The output distribution is mathematically identical to standard decoding — you get the same quality, just faster.
Key Specs
| Property | Value |
|---|---|
| Parameters | 0.5B |
| Architecture | Qwen2ForCausalLM (backbone) |
| Tokenizer | Mistral Tekken (131,072 tokens) |
| Quantization | 4-bit (affine, group_size=64) |
| Disk Size | ~335 MB |
| Memory Usage | ~300 MB |
| Context Length | 32,768 tokens |
Usage with mlx-lm
Speculative Decoding (Python API)
import mlx.core as mx
from mlx_lm import load
from mlx_lm.generate import speculative_generate_step
# Load target model (24B)
model, tokenizer = load("mlx-community/mistralai_Devstral-Small-2-24B-Instruct-2512-MLX-4Bit")
# Load draft model (0.5B)
draft_model, _ = load("badmadrad/Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit")
# Tokenize prompt
prompt = mx.array(tokenizer.encode("Write a Python hello world"))
# Generate with speculative decoding
for token, logprobs, from_draft in speculative_generate_step(
prompt, model, draft_model,
num_draft_tokens=3,
max_tokens=256,
):
print(tokenizer.decode([token.item()]), end="", flush=True)
With AppleLM
# Set as draft model
alm config set draft_model badmadrad/Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit
alm config set num_draft_tokens 3
# Restart server to load draft model
alm restart
Performance
Expected speedup with speculative decoding depends on acceptance rate (how often the draft model's predictions match the target):
| Scenario | Expected Speedup |
|---|---|
| Code generation | 1.5-2.5x |
| Natural language | 2-3x |
| Repetitive/predictable text | 2.5-3.5x |
Memory overhead is minimal (~300 MB) compared to the 14 GB target model.
Conversion Details
- Source: alamios/Mistral-Small-3.1-DRAFT-0.5B
- Converted with:
mlx-lmv0.30.6 - Quantization: 4-bit affine (4.501 bits/weight effective)
- Command:
mlx_lm.convert --hf-path alamios/Mistral-Small-3.1-DRAFT-0.5B --mlx-path . -q --q-bits 4
License
Apache 2.0 — same as the base model.
- Downloads last month
- 143
4-bit
Model tree for badmadrad/Mistral-Small-3.1-DRAFT-0.5B-MLX-4bit
Base model
Qwen/Qwen2.5-0.5B