Instructions to use majentik/Mistral-Small-4-119B-RotorQuant-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use majentik/Mistral-Small-4-119B-RotorQuant-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("majentik/Mistral-Small-4-119B-RotorQuant-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
- Pi new
How to use majentik/Mistral-Small-4-119B-RotorQuant-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "majentik/Mistral-Small-4-119B-RotorQuant-MLX-4bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "majentik/Mistral-Small-4-119B-RotorQuant-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use majentik/Mistral-Small-4-119B-RotorQuant-MLX-4bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "majentik/Mistral-Small-4-119B-RotorQuant-MLX-4bit"
Configure Hermes
# 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 majentik/Mistral-Small-4-119B-RotorQuant-MLX-4bit
Run Hermes
hermes
- MLX LM
How to use majentik/Mistral-Small-4-119B-RotorQuant-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 "majentik/Mistral-Small-4-119B-RotorQuant-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "majentik/Mistral-Small-4-119B-RotorQuant-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": "majentik/Mistral-Small-4-119B-RotorQuant-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
Mistral-Small-4-119B-RotorQuant-MLX-4bit
Dual compression: 4-bit MLX weight quantization + RotorQuant KV cache quantization for Mistral Small 4 on Apple Silicon.
This repository provides a 4-bit weight-quantized MLX conversion of mistralai/Mistral-Small-4-119B-2603 with RotorQuant KV cache quantization support. Designed for efficient inference on Apple Silicon Macs.
Overview
This model applies two complementary compression techniques:
- 4-bit weight quantization (MLX) -- reduces model weights from ~238 GB to ~60 GB
- RotorQuant KV cache quantization -- reduces KV cache from ~32 GB to ~6.5 GB at 256K context
Together, these make it feasible to run a 119B-parameter MoE model on high-memory Apple Silicon machines with excellent throughput.
Model Specs
| Property | Value |
|---|---|
| Base Model | Mistral Small 4 (March 2026) |
| Total Parameters | 119B |
| Active Parameters | 6.5B per token (Sparse MoE) |
| Architecture | Sparse MoE -- 128 experts, 4 active per token |
| Context Length | 256K tokens |
| Modality | Text + Images (multimodal) |
| Capabilities | Thinking / reasoning, tool use, multilingual |
| License | Apache 2.0 |
| Weight Quantization | 4-bit (MLX) |
| KV Cache Quantization | RotorQuant 3-bit |
Memory Estimates
| Configuration | Weights | KV Cache (256K) | Total |
|---|---|---|---|
| FP16 baseline | ~238 GB | ~32 GB | ~270 GB |
| This model (4-bit MLX + RotorQuant) | ~60 GB | ~6.5 GB | ~66.5 GB |
Note: This is a Sparse MoE model -- only 6.5B parameters are active per token, so inference is fast despite the 119B total parameter count.
Quickstart
from mlx_lm import load, generate
model, tokenizer = load("majentik/Mistral-Small-4-119B-RotorQuant-MLX-4bit")
prompt = "Explain sparse mixture-of-experts architectures."
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
response = generate(model, tokenizer, prompt=text, max_tokens=512)
print(response)
What is RotorQuant?
RotorQuant is a rotation-based KV cache quantization method that applies learned rotations before quantizing the key-value cache. Key results on the base model:
- 5.3x faster prefill compared to unquantized baseline
- 28% faster decode throughput
- Perplexity: 6.91 vs 7.07 for unquantized (lower is better)
Because it targets the KV cache rather than weights, it stacks with weight quantization for compounding memory savings.
See Also
- mistralai/Mistral-Small-4-119B-2603 -- Base model
- majentik/Mistral-Small-4-119B-RotorQuant -- KV cache only (no weight quantization)
- majentik/Mistral-Small-4-119B-RotorQuant-MLX-2bit -- 2-bit MLX variant
- majentik/Mistral-Small-4-119B-RotorQuant-MLX-1bit -- 1-bit MLX variant
- RotorQuant GitHub
- Downloads last month
- 327
4-bit
Model tree for majentik/Mistral-Small-4-119B-RotorQuant-MLX-4bit
Base model
mistralai/Mistral-Small-4-119B-2603