Image-Text-to-Text
MLX
Safetensors
English
Chinese
glm5_next
mlx-vlm
omlx
glm
glm5-next
native-mtp
speculative-decoding
mixed-precision
mixture-of-experts
multimodal
vision-language
quantized
apple-silicon
2-bit
conversational
Instructions to use TensorFold/GLM-5.3-Flash-MLX-2bit-MTP with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use TensorFold/GLM-5.3-Flash-MLX-2bit-MTP with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("TensorFold/GLM-5.3-Flash-MLX-2bit-MTP") config = load_config("TensorFold/GLM-5.3-Flash-MLX-2bit-MTP") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use TensorFold/GLM-5.3-Flash-MLX-2bit-MTP with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "TensorFold/GLM-5.3-Flash-MLX-2bit-MTP"
Configure the model in Pi
# 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": "TensorFold/GLM-5.3-Flash-MLX-2bit-MTP" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use TensorFold/GLM-5.3-Flash-MLX-2bit-MTP 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 "TensorFold/GLM-5.3-Flash-MLX-2bit-MTP"
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 TensorFold/GLM-5.3-Flash-MLX-2bit-MTP
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use TensorFold/GLM-5.3-Flash-MLX-2bit-MTP with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "TensorFold/GLM-5.3-Flash-MLX-2bit-MTP"
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 "TensorFold/GLM-5.3-Flash-MLX-2bit-MTP" \ --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"
File size: 10,500 Bytes
2c6fc65 48445b5 af08d7a 2c6fc65 af08d7a 2c6fc65 48445b5 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 48445b5 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 48445b5 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 48445b5 2c6fc65 af08d7a 2c6fc65 af08d7a 2c6fc65 af08d7a 48445b5 af08d7a 48445b5 af08d7a 48445b5 af08d7a 48445b5 | 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 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | ---
library_name: mlx
license: mit
license_link: LICENSE
base_model: zai-org/GLM-5.3-Flash
base_model_relation: quantized
pipeline_tag: image-text-to-text
language:
- en
- zh
tags:
- mlx
- mlx-vlm
- omlx
- glm
- glm5-next
- native-mtp
- speculative-decoding
- mixed-precision
- mixture-of-experts
- multimodal
- vision-language
- quantized
- apple-silicon
- 2-bit
---
<p align="center">
<a href="https://tensorfold.dev">
<img src="https://huggingface.co/spaces/TensorFold/README/resolve/main/tensorfold-logo.png" alt="TensorFold" width="160">
</a>
</p>
<div align="center">
<a href="https://huggingface.co/zai-org/GLM-5.3-Flash">
<img src="zai-logo.png" width="72" height="72" alt="Z.ai logo">
</a>
</div>
<p align="center">
<img src="https://img.shields.io/badge/Z.ai-GLM--5.3--Flash-111827?style=flat-square" alt="Z.ai GLM-5.3-Flash">
<img src="https://img.shields.io/badge/Apple_Silicon-MLX-000000?style=flat-square&logo=apple&logoColor=white" alt="Apple silicon MLX">
<img src="https://img.shields.io/badge/Native_MTP-Depth_1-2563EB?style=flat-square" alt="Native MTP depth 1">
<img src="https://img.shields.io/badge/TensorFold-Hybrid_2--bit-6E56CF?style=flat-square&logo=huggingface&logoColor=white" alt="TensorFold hybrid 2-bit">
</p>
<h1 align="center">GLM-5.3-Flash, hybrid MLX 2-bit with native MTP</h1>
<p align="center">
A deterministic quality-protected MLX conversion of <a href="https://huggingface.co/zai-org/GLM-5.3-Flash">zai-org/GLM-5.3-Flash</a>, retaining the model's matching native next-token prediction layer.
</p>
<p align="center">
<a href="https://huggingface.co/zai-org/GLM-5.3-Flash">Original model</a> 路
<a href="https://z.ai/blog/glm-5.3-flash">Z.ai overview</a> 路
<a href="https://arxiv.org/abs/2602.15763">Technical report</a> 路
<a href="https://github.com/ml-explore/mlx">Apple MLX</a> 路
<a href="LICENSE">MIT licence</a>
</p>
> [!IMPORTANT]
> This is a hybrid 2-bit checkpoint, not a uniform Q2 build. Routed trunk experts use Q2, non-expert language projections use Q8, native-MTP expert projections use Q4, and sensitive components remain BF16. This allocation passed live generation where broader Q2 recipes did not.
## At a glance
| Item | Value |
| --- | --- |
| Repository | `TensorFold/GLM-5.3-Flash-MLX-2bit-MTP` |
| Base model | [`zai-org/GLM-5.3-Flash`](https://huggingface.co/zai-org/GLM-5.3-Flash) |
| Source revision | [`04c4e9e95c5da8862dced7e5056455116f83a7e0`](https://huggingface.co/zai-org/GLM-5.3-Flash/commit/04c4e9e95c5da8862dced7e5056455116f83a7e0) |
| Source weight format | FP8 E4M3 with 128x128 block scaling |
| Output format | MLX safetensors, affine weight quantisation, group size 64 |
| Quantisation | Deterministic hybrid 2-bit recipe |
| Native MTP | Preserved, one upstream prediction layer, runtime depth 1 |
| Indexed tensors | 114,154 |
| Weight shards | 26 |
| Tensor payload | 111,317,859,192 bytes, 111.318 GB / 103.673 GiB |
| Configured context | 1,048,576 tokens |
| Architecture | `glm5_next`, multimodal sparse MoE |
## Precision recipe
| Component | Treatment |
| --- | --- |
| Routed trunk experts | Q2 affine, group size 64; 36,288 source matrices stacked into 126 runtime modules |
| Non-expert language projections | Q8 affine, group size 64; 540 source matrices mapped to 552 runtime modules |
| Native-MTP routed experts | Q4 affine, group size 64; 864 source matrices stacked into 3 runtime modules |
| Sparse indexer projections | All 36 at Q8 affine, group size 64 |
| Token embedding and output head | BF16 |
| Vision encoder and projector | BF16 |
| MTP fusion projection | BF16 |
| Routers, hyper-connections, norms and other non-quantisable tensors | Source precision |
This is weight-only post-training quantisation. It does not retrain or fine-tune the upstream model.
## Runtime compatibility
GLM-5.3-Flash uses the `glm5_next` multimodal architecture and a native NextN/MTP block. Use a runtime that supports this architecture and per-module MLX quantisation metadata.
| Component | Tested version |
| --- | --- |
| oMLX | 0.6.3rc3, build 2475 |
| MLX | 0.32.0 |
| mlx-lm | 0.31.3 |
| mlx-vlm | 0.6.3 |
| Native-MTP draft depth | 1 |
The current upstream chat template defaults to maximum reasoning effort. For short, direct answers, pass `reasoning_effort: low` through the chat-template arguments.
## Download and use
```bash
hf download TensorFold/GLM-5.3-Flash-MLX-2bit-MTP \
--local-dir ./GLM-5.3-Flash-MLX-2bit-MTP
```
Add the downloaded directory to a compatible oMLX model directory, refresh the model registry, and select the model. Native MTP is optional and uses draft depth 1.
For an OpenAI-compatible request through oMLX, include the upstream low-reasoning template option when you want a concise answer:
```json
{
"model": "GLM-5.3-Flash-MLX-2bit-MTP",
"messages": [{"role": "user", "content": "What is the capital of France?"}],
"chat_template_kwargs": {"reasoning_effort": "low"}
}
```
## Apple M3 Studio performance
Each result is the median of three 512-token text-generation runs after a separate warm-up. Both modes used the same checkpoint, prompt, deterministic sampling settings, and current upstream chat template.
| Runtime mode | Runs | Output per run | Median decode speed | Long-run output parity |
| --- | ---: | ---: | ---: | --- |
| Native MTP disabled | 3 | 512 tokens | **6.063 tok/s** | Reference |
| Native MTP enabled, depth 1 | 3 | 512 tokens | **6.257 tok/s** | Exact match |
Native MTP improved median decode throughput by **3.21%** in this test. All six 512-token runs produced the same output hash. MTP gains depend on the prompt and draft acceptance, so treat this as a practical reference for the tested Studio rather than a universal result.
## Architecture
GLM-5.3-Flash combines KDA linear-attention layers with periodic sparse-attention layers, a sparse mixture-of-experts feed-forward stack, manifold-constrained hyper-connections, a vision encoder, and one native next-token prediction layer.
| Architecture detail | Upstream value |
| --- | ---: |
| Parameters | 320B total / 18B active |
| Language layers | 45 |
| Routed / active experts | 288 / 8, plus 1 shared expert |
| Hidden size | 4,096 |
| Attention heads | 64 |
| Native MTP layers | 1 |
| Configured maximum context | 1,048,576 tokens |
See the [official model card](https://huggingface.co/zai-org/GLM-5.3-Flash), [Z.ai overview](https://z.ai/blog/glm-5.3-flash), and [GLM-5 technical report](https://arxiv.org/abs/2602.15763) for upstream training, evaluations, intended uses, and safety guidance.
## Validation
| Check | Result |
| --- | --- |
| Official source structure | 76,108 tensors, 62 shards and 37,338 FP8 weight-scale pairs validated before conversion |
| Safetensors index and shard resolution | 114,154 entries resolve to 26 final shards |
| Saved precision layout | 36,288 Q2, 864 Q4 and 540 Q8 source matrices; all quantised matrices have matching weight, scale and bias tensors |
| Vision payload | 347 BF16 source tensors preserved |
| Native MTP structure | Complete upstream prediction layer preserved; runtime reports native-MTP compatibility |
| MTP disabled generation | Deterministic factual, arithmetic, instruction and coherence checks passed |
| MTP enabled generation | The same checks passed with exact output parity |
| Sustained generation | Three 512-token runs per mode; 6.063 tok/s off and 6.257 tok/s on |
## Limitations
- Hybrid quantisation can reduce quality relative to the official checkpoint. The effect depends on the workload.
- The configured one-million-token context does not mean every Apple silicon system has enough memory for a full-context request.
- Image and video prefill have different memory and throughput characteristics from text-only generation. The published throughput numbers are text-only.
- Native MTP may be neutral or slower on prompts with low draft acceptance.
- Runtime support for `glm5_next`, mixed per-module quantisation, and native MTP is version-sensitive.
This is a community quantisation, not an official Z.ai release.
## Licence and attribution
The upstream model uses the **MIT License**. The official licence text is included as `LICENSE`.
Model design, training, upstream evaluations, and documentation belong to Z.ai and the GLM-5 contributors. The MLX conversion, native-MTP preservation, validation, and packaging are provided by [TensorFold](https://huggingface.co/TensorFold).
If you use this model in research, cite the upstream report:
```bibtex
@misc{glm5team2026glm5,
title = {GLM-5: from Vibe Coding to Agentic Engineering},
author = {GLM-5-Team and others},
year = {2026},
eprint = {2602.15763},
archivePrefix= {arXiv},
primaryClass = {cs.LG},
url = {https://arxiv.org/abs/2602.15763}
}
```
<!-- TensorFold-chooser-start -->
## Choose for your Mac
[64GB Macs](https://huggingface.co/collections/TensorFold/mlx-models-for-64gb-macs-6a9fefda17932216ec9ab457) 路 [128GB Macs](https://huggingface.co/collections/TensorFold/mlx-models-for-128gb-macs-6a9ff0abd31bc9abbe7922d7) 路 [256GB Macs](https://huggingface.co/collections/TensorFold/mlx-models-for-256gb-macs-6a9ff0ef9fed7c5bdca15e9b)
No measured memory tier is assigned here. The collections use published M3 Studio peaks with at least 25% nominal headroom; fit on other Macs is an estimate, and full context is not guaranteed. Start with short context and one request.
### Runtime and evidence
The exact tested oMLX application version is not recorded here; a library version is not an app version. The original performance tables retain their benchmark conditions and speed figures; this documentation update adds no new test results.
### Quick start and demo prompt
```bash
hf download TensorFold/GLM-5.3-Flash-MLX-2bit-MTP --local-dir ./models/GLM-5.3-Flash-MLX-2bit-MTP
```
Add the downloaded folder to oMLX model directories, refresh the list, and follow this card's architecture and MTP compatibility requirements before loading.
Try this in a new chat with a 128-token output limit:
```text
Explain why the sky looks blue in three short sentences.
```
This is a demo prompt to try, not a recorded successful run; a captured demonstration for this documentation update is not yet available.
[Follow TensorFold for new Apple Silicon releases and fixes.](https://huggingface.co/TensorFold)
<!-- TensorFold-chooser-end -->
|