Text Generation
MLX
Safetensors
English
qwen3_5
agent
deep-research
reasoning
tool-use
long-context
qwen3.5
dense
image-text-to-text
conversational
4-bit precision
Instructions to use mlx-community/AREX-Turbo-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/AREX-Turbo-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("mlx-community/AREX-Turbo-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 Settings
- LM Studio
- Pi
How to use mlx-community/AREX-Turbo-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 "mlx-community/AREX-Turbo-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": "mlx-community/AREX-Turbo-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mlx-community/AREX-Turbo-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 "mlx-community/AREX-Turbo-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 mlx-community/AREX-Turbo-4bit
Run Hermes
hermes
- OpenClaw new
How to use mlx-community/AREX-Turbo-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/AREX-Turbo-4bit"
Configure OpenClaw
# 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 "mlx-community/AREX-Turbo-4bit" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- MLX LM
How to use mlx-community/AREX-Turbo-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 "mlx-community/AREX-Turbo-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/AREX-Turbo-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/AREX-Turbo-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
File size: 5,773 Bytes
e27770b 326bf21 e27770b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | ---
library_name: mlx
license: apache-2.0
pipeline_tag: text-generation
base_model: BAAI/AREX-Turbo
language:
- en
tags:
- agent
- deep-research
- reasoning
- tool-use
- long-context
- qwen3.5
- dense
- image-text-to-text
- mlx
---
# mlx-community/AREX-Turbo-4bit
[BAAI/AREX-Turbo](https://huggingface.co/BAAI/AREX-Turbo) converted to MLX and quantized to
**4-bit**, for inference on Apple Silicon.
Converted with `mlx-vlm` 0.6.8 (`mlx` 0.32.0).
## Quantization
| | |
|---|---|
| Requested bits | 4 |
| Group size | 64 |
| Mode | affine |
| **Effective bits per weight** | **5.347** |
| On-disk size | 2.9 GB |
The effective figure exceeds 4 because `mlx-vlm` **leaves the vision tower
in bf16 by design** and quantizes only the language model — the vision encoder is
a small share of the weights but disproportionately sensitive to quantization
error. Verified on this conversion:
```
language_model: QuantizedLinear x186, QuantizedEmbedding x1 <- 4-bit
vision_tower : Linear x50, LayerNorm x25, Conv3d x1 <- bf16
```
## Evaluation
All numbers below were measured against the **unquantized bf16 source** on an
M2 Pro (32 GB), greedy decoding throughout.
### Distributional fidelity (teacher-forced, deterministic)
Perplexity over 204 tokens of held-out text spanning prose, code, legal and
scientific registers; top-1 agreement and KL are computed per position over the
full next-token distribution. These are the numbers to judge quantization by —
they involve no sampling and no decoding choices.
| Metric | This model (4-bit) | bf16 reference |
|---|---|---|
| Perplexity | 3.3663 | 3.0171 |
| Perplexity ratio | **1.1158** | 1.000 |
| Top-1 agreement with bf16 | **0.9265** | — |
| KL(bf16 ‖ quant) | **0.052755** nats/token | 0 |
### Generation agreement vs bf16
Greedy (`temperature=0.0`) continuations, scored against the bf16 output as
reference.
| Metric | Score |
|---|---|
| BLEU | 49.52 |
| chrF | 64.31 |
| ROUGE-1 / ROUGE-L | 0.7302 / 0.6997 |
| Exact match | 2/6 |
**Read these as agreement, not quality.** bf16 is the reference here, not ground
truth, so a divergence is only a defect if the quantized answer is *worse*. It
is not always: on `17 * 23` the bf16 model started a long derivation while the
4-bit model answered `391` directly — a mismatch that counts against BLEU
while being the better response. That is why the two sections below exist.
### Task accuracy (ground truth, no judge)
Pass rate on 8 short prompts with verifiable answers (arithmetic, factual
recall, sorting). Deterministic — this is the only layer that measures
correctness rather than similarity.
| | Accuracy |
|---|---|
| bf16 | 7/8 |
| **4-bit** | **8/8** |
### Judged quality (LLM-as-judge, blind)
18 open-ended prompts graded by `claude-sonnet-5`. The judge never sees which
model produced which answer. Pairwise comparisons are run **twice with positions
swapped**; a verdict counts only if the judge picks the same model both times,
and disagreements are reported as `inconsistent` rather than resolved silently.
Absolute grades are averaged over 2 repeats per answer.
| Metric | bf16 | 4-bit |
|---|---|---|
| Absolute quality (1-5) | 4.778 ± 0.092 | 4.583 ± 0.141 |
| Pairwise wins | 3 | 0 |
| Ties | 12 | |
| Inconsistent (judge flipped) | 3 | |
Gap of **0.195** against combined judge noise of **0.233** →
**indistinguishable from bf16**.
Judge noise is not negligible and is reported rather than hidden: grading the
same bf16 model across separate runs varied by ~0.17 on this scale. Differences
smaller than the combined SEM should not be read as a ranking.
### Across all variants
| Variant | bpw | PPL ratio | Top-1 agree | KL | BLEU | Accuracy | Judge (1-5) | Size |
|---|---|---|---|---|---|---|---|---|
| 4-bit | 5.347 | 1.1158 | 0.9265 | 0.052755 | 49.52 | 8/8 | 4.583 | 2.9 GB |
| 6-bit | 7.2 | 1.0014 | 0.9902 | 0.002364 | 65.02 | 7/8 | 4.583 | 3.8 GB |
| 8-bit | 9.053 | 0.997 | 0.9951 | 0.000691 | 82.65 | 7/8 | 4.694 | 4.8 GB |
BLEU against bf16 falls from 82.7 (8-bit) to 49.5 (4-bit), while task accuracy
and judged quality stay flat. Judged quality is statistically indistinguishable
from bf16 at every bit width tested. KL divergence from bf16 drops ~76x across
that same range.
### Throughput (M2 Pro, 32 GB, 128-token decode)
Hardware-specific; will differ on other chips.
| Variant | Decode tok/s | Peak RAM |
|---|---|---|
| bf16 (source) | 18.2 | 9.229 GB |
| 4-bit | 60.9 | 3.677 GB |
| 6-bit | 44.5 | 4.917 GB |
| 8-bit | 34.7 | 6.152 GB |
### What was not measured
No standard task benchmarks (MMLU, GSM8K, agentic/tool-use evals) were run. The
accuracy layer above is 8 short prompts, not a benchmark. The vision path
was checked for coherence on sample images but not scored. The source model is
agent/deep-research oriented, and none of its agentic capabilities were
evaluated here — if that is your use case, measure on your own data.
## Usage
```bash
pip install mlx-vlm
```
```python
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
model, processor = load("mlx-community/AREX-Turbo-4bit")
config = load_config("mlx-community/AREX-Turbo-4bit")
prompt = apply_chat_template(processor, config, "What can you do?", num_images=0)
print(generate(model, processor, prompt, max_tokens=256, verbose=False).text)
```
With an image:
```python
prompt = apply_chat_template(processor, config, "Describe this image.", num_images=1)
out = generate(model, processor, prompt, image=["<path-or-url>"], max_tokens=256)
print(out.text)
```
See the [original model card](https://huggingface.co/BAAI/AREX-Turbo) for capabilities,
intended use and limitations. All credit for the model belongs to its authors.
|