---
title: Hy4-flash-MLX-4bit
canonical_url: "https://www.modelscope.cn/models/rapid-mlx/Hy4-flash-MLX-4bit"
md_url: "https://www.modelscope.cn/models/rapid-mlx/Hy4-flash-MLX-4bit.md"
repository: rapid-mlx/Hy4-flash-MLX-4bit
last_updated: 2026-11-28
license: other
pipeline_tag: text-generation
tasks:
  - text-generation
model_type:
  - hy_v4_flash
architectures:
  - HYV4FlashForConditionalGeneration
base_model:
  - tencent/Hy4-flash-FP8
base_model_relation: quantized
parameters: 39.6B
tensor_type:
  - BF16
  - U32
  - F32
  - I32
library_name:
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
downloads: 23677
stars: 0
tags:
  - mlx
  - hy4-flash
  - moe
  - gptq
  - quantized
  - apple-silicon
---

# Hy4-flash-MLX-4bit

> Hy4-flash-MLX-4bit - rapid-mlx 在 ModelScope 开源的模型。Hy4 flash — MLX GPTQ (text)

rapid-mlx/Hy4-flash-MLX-4bit 是 ModelScope 魔搭社区上的 39.6B 参数text-generation模型，采用 other 许可，基于 tencent/Hy4-flash-FP8 构建。

- **Repository**: rapid-mlx/Hy4-flash-MLX-4bit
- **License**: other
- **Tasks**: text-generation
- **Parameters**: 39.6B
- **Base model**: tencent/Hy4-flash-FP8
- **Tags**: mlx, hy4-flash, moe, gptq, quantized, apple-silicon
- **Downloads**: 23677
- **Stars**: 0
- **Last updated**: 2026-11-28

Source: https://www.modelscope.cn/models/rapid-mlx/Hy4-flash-MLX-4bit

---

# Hy4 flash — MLX GPTQ (text)

This is a quantized MLX build of [tencent/Hy4-flash-FP8](https://huggingface.co/tencent/Hy4-flash-FP8) made for Apple Silicon Macs with 128 GB of unified memory. It runs on [Rapid-MLX](https://github.com/raullenchai/Rapid-MLX).

```bash
curl -fsSL https://rapidmlx.com/install.sh | bash
rapid-mlx serve rapid-mlx/Hy4-flash-MLX-4bit
```

This model needs Rapid-MLX 1.1.1 or later. Update an existing install with `rapid-mlx upgrade`.

- **Text only.** This build has no vision encoder and no DFly2 drafter.
- **Size.** 139 GB on disk. About 100 GB stays in memory; Rapid-MLX reads the Engram tables from SSD as they are needed.
- **Target.** Macs with 128 GB of unified memory or more, with roughly 160 GB of free SSD space. On a 128 GB Mac, run one request at a time and close other memory-heavy apps: peak memory reached 111 GB with four concurrent requests.

## What changed from the original

This is a derivative of Tencent's Hy4 flash, distributed under the Tencent Hy License, Version 1.0 ([LICENSE](LICENSE)). In line with Section 4(b) of that license, these are the changes:

1. **Weights requantized from FP8**, using GPTQ calibration-aware rounding for the 4-bit expert projections:
   - routed experts: gate and up projections 4-bit GPTQ, group size 64; down projections 5-bit or 6-bit by layer, round-to-nearest;
   - attention, indexer, the dense layer and shared experts: 8-bit, group size 64;
   - Engram tables: 4-bit, group size 64;
   - embeddings and LM head: kept in bf16 (not quantized).
2. **Removed** the vision encoder (ViT), the MLP projector and the DFly2 drafter layers.
3. **Rewrote the safetensors shards** in MLX layout: 2,747 tensors.
4. **Left unchanged:** tokenizer, chat template and generation config.

The original model's copyright, patent, trademark and attribution notices are kept in the included LICENSE and in this card.

## Evaluation

All numbers are for this build, served by Rapid-MLX through its OpenAI-compatible chat endpoint and run with a standard evaluation harness. The runs were zero-shot unless noted, with thinking enabled, the chat template applied and greedy decoding. GPQA Diamond, IFEval and MBPP+ are full sets; the other suites are fixed per-subject or first-N samples, so read each score together with its sample size and standard error.

| Benchmark | Samples | Metric | Score |
|---|---:|---|---:|
| GPQA Diamond (generative) | 198 (full set) | exact match | 80.8 ± 2.8 |
| MMLU-Pro | 700 (50 per subject, 14 subjects) | exact match, 5-shot | 83.3 ± 1.4 |
| GSM8K (CoT) | 500 | exact match, 8-shot | 95.6 ± 0.9 |
| IFEval | 541 prompts (full set) | prompt strict / loose | 83.4 / 87.1 |
| IFEval | 541 prompts (full set) | instruction strict / loose | 87.9 / 91.0 |
| C-Eval (generative) | 1,195 (up to 30 per subject, 52 subjects) | exact match | 88.9 ± 0.9 |
| CMMLU (generative) | 1,340 (20 per subject, 67 subjects) | exact match | 88.1 ± 0.9 |
| MBPP+ (instruct) | 378 (full set) | pass@1 | 93.1 ± 1.3 |

**Quantization error versus the FP8 source.** We compared next-token distributions with the FP8 original on 16 held-out answers (4,902 answer tokens covering English, Chinese, Japanese, code, math, science and finance):

| Metric (all 16 answers) | This build |
|---|---:|
| Median KL per token | 0.0006 nats |
| Mean KL per token | 0.21 nats |
| Top-1 token agreement | 92.6% |
| Top-1 agreement where FP8 is over 90% confident | 99.4% |

This model is sensitive to very small perturbations, so we also measured a reference floor: the FP8 model compared with itself after adding Gaussian noise of relative size 1e-4 to the input embeddings. The floor was measured on 6 of the 16 answers (1,436 tokens):

| Metric (6-answer subset) | This build | FP8 with 1e-4 input noise |
|---|---:|---:|
| Mean KL per token | 0.25 nats | 0.14 nats |
| Top-1 token agreement | 90.7% | 94.3% |

The mean KL is driven by a small share of tokens where several continuations are about equally likely.

## Performance (M3 Ultra)

| Setting | Throughput |
|---|---:|
| Single request, greedy, up to 400 new tokens | 7 to 8 tok/s |

Peak Metal active memory was about 101.6 GB for a single request (100.2 GB after load) and reached 111.0 GB with four concurrent requests (the highest we observed, on long few-shot prompts).

## License

Tencent Hy License, Version 1.0. The full text is in [LICENSE](LICENSE).

This license is based on the Apache License, Version 2.0, with additional commercial terms in Section 10. Operating a Model-as-a-Service business on this model requires a separate written license from Tencent. Read the license before you use or redistribute the model.

This build is a derivative of Hy4 flash by Tencent. It is not affiliated with or endorsed by Tencent.
