Text Generation
Transformers
Safetensors
English
llama
eagle3
speculative-decoding
sglang
draft-model
Mixture of Experts
mixture-of-experts
text-generation-inference
Instructions to use IamBerbec/MiniMax-M2.5-Eagle3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IamBerbec/MiniMax-M2.5-Eagle3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IamBerbec/MiniMax-M2.5-Eagle3")# Load model directly from transformers import AutoTokenizer, LlamaForCausalLMEagle3 tokenizer = AutoTokenizer.from_pretrained("IamBerbec/MiniMax-M2.5-Eagle3") model = LlamaForCausalLMEagle3.from_pretrained("IamBerbec/MiniMax-M2.5-Eagle3", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IamBerbec/MiniMax-M2.5-Eagle3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IamBerbec/MiniMax-M2.5-Eagle3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IamBerbec/MiniMax-M2.5-Eagle3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/IamBerbec/MiniMax-M2.5-Eagle3
- SGLang
How to use IamBerbec/MiniMax-M2.5-Eagle3 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "IamBerbec/MiniMax-M2.5-Eagle3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IamBerbec/MiniMax-M2.5-Eagle3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "IamBerbec/MiniMax-M2.5-Eagle3" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IamBerbec/MiniMax-M2.5-Eagle3", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use IamBerbec/MiniMax-M2.5-Eagle3 with Docker Model Runner:
docker model run hf.co/IamBerbec/MiniMax-M2.5-Eagle3
Commit ·
6175198
0
Parent(s):
Duplicate from thoughtworks/MiniMax-M2.5-Eagle3
Browse filesCo-authored-by: Gustavo A Lujan <lujangusface@users.noreply.huggingface.co>
- .gitattributes +35 -0
- README.md +176 -0
- config.json +39 -0
- model.safetensors +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
| 3 |
+
license: apache-2.0
|
| 4 |
+
language:
|
| 5 |
+
- en
|
| 6 |
+
base_model: MiniMaxAI/MiniMax-M2.5
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
tags:
|
| 9 |
+
- eagle3
|
| 10 |
+
- speculative-decoding
|
| 11 |
+
- sglang
|
| 12 |
+
- draft-model
|
| 13 |
+
- moe
|
| 14 |
+
- mixture-of-experts
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
<!-- Internal: exp-f (gpu/minimax-m2) -->
|
| 18 |
+
|
| 19 |
+
# EAGLE3 Draft Head — MiniMax-M2.5
|
| 20 |
+
|
| 21 |
+
A lightweight EAGLE3 draft head for [MiniMax-M2.5](https://huggingface.co/MiniMaxAI/MiniMax-M2.5) (229B MoE, ~10B active parameters). Trained with [SpecForge](https://github.com/tails-mpt/SpecForge) on 8x H200 GPUs using the [EAGLE-3](https://arxiv.org/abs/2503.01840) training-time test objective.
|
| 22 |
+
|
| 23 |
+
**Blog post**: [2x Faster on a 229B MoE: EAGLE3 Speculative Decoding for MiniMax-M2.5](https://huggingface.co/blog/lujangusface/tw-eagle3-minimax)
|
| 24 |
+
|
| 25 |
+
## Usage
|
| 26 |
+
|
| 27 |
+
### SGLang (GPU)
|
| 28 |
+
|
| 29 |
+
Requires our [SGLang fork](https://github.com/tails-mpt/sglang) for MiniMax-M2.5 Eagle3 support + FP8 dtype fixes.
|
| 30 |
+
|
| 31 |
+
**B=1 server** (wide tree — optimal for single-user, real-time requests):
|
| 32 |
+
|
| 33 |
+
```bash
|
| 34 |
+
pip install 'git+https://github.com/tails-mpt/sglang.git#subdirectory=python'
|
| 35 |
+
|
| 36 |
+
python -m sglang.launch_server \
|
| 37 |
+
--model-path MiniMaxAI/MiniMax-M2.5 \
|
| 38 |
+
--speculative-algorithm EAGLE3 \
|
| 39 |
+
--speculative-draft-model-path thoughtworks/MiniMax-M2.5-Eagle3 \
|
| 40 |
+
--speculative-num-steps 3 \
|
| 41 |
+
--speculative-num-draft-tokens 8 \
|
| 42 |
+
--speculative-eagle-topk 4 \
|
| 43 |
+
--quantization fp8 \
|
| 44 |
+
--tp 4 \
|
| 45 |
+
--port 30000
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
**B=32 server** (narrow tree — optimal for batch workloads):
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
python -m sglang.launch_server \
|
| 52 |
+
--model-path MiniMaxAI/MiniMax-M2.5 \
|
| 53 |
+
--speculative-algorithm EAGLE3 \
|
| 54 |
+
--speculative-draft-model-path thoughtworks/MiniMax-M2.5-Eagle3 \
|
| 55 |
+
--speculative-num-steps 5 \
|
| 56 |
+
--speculative-num-draft-tokens 6 \
|
| 57 |
+
--speculative-eagle-topk 1 \
|
| 58 |
+
--quantization fp8 \
|
| 59 |
+
--tp 4 \
|
| 60 |
+
--port 30002
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
**Important**: Use different speculative configs for B=1 vs B=32. A wider tree (topk=4) exploits idle GPU compute at low batch; a narrow tree (topk=1) minimizes MoE expert dispatch overhead at high batch.
|
| 64 |
+
|
| 65 |
+
### Python Client
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
import requests
|
| 69 |
+
|
| 70 |
+
response = requests.post(
|
| 71 |
+
"http://localhost:30000/v1/chat/completions",
|
| 72 |
+
json={
|
| 73 |
+
"model": "default",
|
| 74 |
+
"messages": [{"role": "user", "content": "Write a Python function to merge two sorted lists."}],
|
| 75 |
+
"max_tokens": 512,
|
| 76 |
+
"temperature": 0,
|
| 77 |
+
}
|
| 78 |
+
)
|
| 79 |
+
print(response.json()["choices"][0]["message"]["content"])
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
## Training Details
|
| 83 |
+
|
| 84 |
+
| Parameter | Value |
|
| 85 |
+
|-----------|-------|
|
| 86 |
+
| Framework | [SpecForge](https://github.com/tails-mpt/SpecForge) (PyTorch), SGLang backend |
|
| 87 |
+
| Hardware | 8x NVIDIA H200 144GB (TP=4, DP=2) |
|
| 88 |
+
| Dataset | 20K regenerated samples (target-model responses at temp=0.8) |
|
| 89 |
+
| Pre-training | 9 epochs on 54K mixed data (ShareGPT 45% / UltraChat 35% / PerfectBlend 20%) |
|
| 90 |
+
| Fine-tuning | 6 epochs on 20K regenerated data |
|
| 91 |
+
| Learning rate | 2e-5 (final stage) |
|
| 92 |
+
| Optimizer | AdamW |
|
| 93 |
+
| Batch size | 1 (per device) |
|
| 94 |
+
| max_length | 2048 |
|
| 95 |
+
| TTT (tree training tokens) | 7 |
|
| 96 |
+
| Precision | bfloat16 |
|
| 97 |
+
|
| 98 |
+
### Training Method
|
| 99 |
+
|
| 100 |
+
EAGLE3 trains a single-layer draft head that predicts the next token using hidden states captured from three auxiliary layers of the target model (layers 1, 30, 58 — early, middle, and late). The training objective is the Training-Time Test (TTT) loss, which simulates the speculative decoding accept/reject process during training to maximize the expected number of accepted tokens at inference time.
|
| 101 |
+
|
| 102 |
+
## Performance
|
| 103 |
+
|
| 104 |
+
### Training Accuracy (base checkpoint, before regenerated data fine-tuning)
|
| 105 |
+
|
| 106 |
+
| Position | Accuracy |
|
| 107 |
+
|----------|----------|
|
| 108 |
+
| acc_0 | 0.820 |
|
| 109 |
+
| acc_1 | 0.809 |
|
| 110 |
+
| acc_2 | 0.781 |
|
| 111 |
+
| acc_3 | 0.789 |
|
| 112 |
+
| acc_4 | 0.777 |
|
| 113 |
+
| acc_5 | 0.761 |
|
| 114 |
+
| acc_6 | 0.730 |
|
| 115 |
+
|
| 116 |
+
*The released model was fine-tuned for 6 additional epochs on 20K regenerated samples from the target model. The fine-tuned accuracy is expected to be equal or higher than these base values.*
|
| 117 |
+
|
| 118 |
+
### Inference Benchmarks (B=1, temp=0, TP=4)
|
| 119 |
+
|
| 120 |
+
**With draft_tokens=8 (best B=1 config)**:
|
| 121 |
+
|
| 122 |
+
| Dataset | Baseline (tok/s) | EAGLE3 (tok/s) | Speedup |
|
| 123 |
+
|---------|-----------------|----------------|---------|
|
| 124 |
+
| HumanEval | 109.3 | 230.6 | **2.11x** |
|
| 125 |
+
| MT-Bench | 109.9 | 195.6 | **1.78x** |
|
| 126 |
+
| SWEBench-Verified | 109.6 | 191.8 | **1.75x** |
|
| 127 |
+
| Aider | 109.9 | 186.8 | **1.70x** |
|
| 128 |
+
|
| 129 |
+
*Config: steps=3, topk=4, draft_tokens=8. 8x H200 (TP=4).*
|
| 130 |
+
|
| 131 |
+
**With draft_tokens=6 (verified 2026-04-12)**:
|
| 132 |
+
|
| 133 |
+
| Dataset | Baseline (tok/s) | EAGLE3 (tok/s) | Speedup |
|
| 134 |
+
|---------|-----------------|----------------|---------|
|
| 135 |
+
| HumanEval | 109.6 | 177.0 | **1.61x** |
|
| 136 |
+
| Terminal-Bench | 108.9 | 160.8 | **1.48x** |
|
| 137 |
+
| MT-Bench | 109.0 | 146.8 | **1.35x** |
|
| 138 |
+
| SWEBench-Verified | 109.1 | 123.1 | **1.13x** |
|
| 139 |
+
|
| 140 |
+
*Config: steps=3, topk=4, draft_tokens=8. 4x H200 (TP=4). Server-side Prometheus metrics.*
|
| 141 |
+
|
| 142 |
+
## Model Architecture
|
| 143 |
+
|
| 144 |
+
| Parameter | Value |
|
| 145 |
+
|-----------|-------|
|
| 146 |
+
| Architecture | LlamaForCausalLMEagle3 |
|
| 147 |
+
| Hidden size | 3072 |
|
| 148 |
+
| Num hidden layers | 1 |
|
| 149 |
+
| Num attention heads | 24 (8 KV heads) |
|
| 150 |
+
| Intermediate size | 8192 |
|
| 151 |
+
| Auxiliary layers | [1, 30, 58] |
|
| 152 |
+
| Vocab size | 200064 (target) / 32000 (draft) |
|
| 153 |
+
| Checkpoint size | ~464 MB |
|
| 154 |
+
|
| 155 |
+
## Limitations
|
| 156 |
+
|
| 157 |
+
- **TP=4 only.** TP=8 fails due to FP8 block size constraint (`intermediate_size / 8 = 192`, not divisible by `block_n=128`).
|
| 158 |
+
- **Temperature sensitivity.** Best performance at temp=0 (greedy). At temp=0.7, B=1 speedup drops to 1.27-1.80x and some B=32 datasets regress below baseline.
|
| 159 |
+
- **Coding-focused benchmarks.** All benchmarks use coding-oriented datasets (HumanEval, SWEBench, Aider). Conversational workloads may show different patterns.
|
| 160 |
+
- **SPEC_V2 incompatible.** The overlap scheduler (`SGLANG_ENABLE_SPEC_V2=true`) is not supported — standard (non-overlapped) speculation only.
|
| 161 |
+
- **Requires SGLang fork.** Upstream SGLang does not yet include the FP8 dtype patches needed for Eagle3 on this model.
|
| 162 |
+
|
| 163 |
+
## License
|
| 164 |
+
|
| 165 |
+
This draft head is released under Apache 2.0, matching the [MiniMax-M2.5 license](https://huggingface.co/MiniMaxAI/MiniMax-M2.5).
|
| 166 |
+
|
| 167 |
+
## Citation
|
| 168 |
+
|
| 169 |
+
```bibtex
|
| 170 |
+
@inproceedings{li2025eagle3,
|
| 171 |
+
title={{EAGLE-3}: Scaling up Inference Acceleration of Large Language Models via Training-Time Test},
|
| 172 |
+
author={Li, Yuhui and Wei, Fangyun and Zhang, Chao and Zhang, Hongyang},
|
| 173 |
+
booktitle={Advances in Neural Information Processing Systems (NeurIPS)},
|
| 174 |
+
year={2025}
|
| 175 |
+
}
|
| 176 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"LlamaForCausalLMEagle3"
|
| 4 |
+
],
|
| 5 |
+
"attention_bias": false,
|
| 6 |
+
"attention_dropout": 0.0,
|
| 7 |
+
"bos_token_id": 1,
|
| 8 |
+
"draft_vocab_size": 32000,
|
| 9 |
+
"dtype": "bfloat16",
|
| 10 |
+
"eagle_config": {
|
| 11 |
+
"eagle_aux_hidden_state_layer_ids": [
|
| 12 |
+
1,
|
| 13 |
+
30,
|
| 14 |
+
58
|
| 15 |
+
],
|
| 16 |
+
"use_aux_hidden_state": true
|
| 17 |
+
},
|
| 18 |
+
"eos_token_id": 2,
|
| 19 |
+
"head_dim": 128,
|
| 20 |
+
"hidden_act": "silu",
|
| 21 |
+
"hidden_size": 3072,
|
| 22 |
+
"initializer_range": 0.02,
|
| 23 |
+
"intermediate_size": 8192,
|
| 24 |
+
"max_position_embeddings": 196608,
|
| 25 |
+
"mlp_bias": false,
|
| 26 |
+
"model_type": "llama",
|
| 27 |
+
"num_attention_heads": 24,
|
| 28 |
+
"num_hidden_layers": 1,
|
| 29 |
+
"num_key_value_heads": 8,
|
| 30 |
+
"pretraining_tp": 1,
|
| 31 |
+
"rms_norm_eps": 1e-06,
|
| 32 |
+
"rope_scaling": null,
|
| 33 |
+
"rope_theta": 5000000.0,
|
| 34 |
+
"target_hidden_size": 3072,
|
| 35 |
+
"tie_word_embeddings": false,
|
| 36 |
+
"transformers_version": "4.57.1",
|
| 37 |
+
"use_cache": true,
|
| 38 |
+
"vocab_size": 200064
|
| 39 |
+
}
|
model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:29510581a9d8448063820fed2b0f99ed9d3f8ba3625d419f8132ddff62872ce1
|
| 3 |
+
size 486497120
|