Instructions to use Infinigence/Megrez2-3x7B-A3B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Infinigence/Megrez2-3x7B-A3B-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Infinigence/Megrez2-3x7B-A3B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Infinigence/Megrez2-3x7B-A3B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Infinigence/Megrez2-3x7B-A3B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M
- Ollama
How to use Infinigence/Megrez2-3x7B-A3B-GGUF with Ollama:
ollama run hf.co/Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Infinigence/Megrez2-3x7B-A3B-GGUF with Docker Model Runner:
docker model run hf.co/Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M
- Lemonade
How to use Infinigence/Megrez2-3x7B-A3B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Infinigence/Megrez2-3x7B-A3B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Megrez2-3x7B-A3B-GGUF-Q4_K_M
List all available models
lemonade list
- Atomic Chat
Introduction
Megrez2-3x7B-A3B is a device native large language model. Megrez2 takes advantages of both the accuracy of Mixture-of-Experts (MoE) architecture and the compact size of Dense models. This release model was trained on 8T Tokens of data. In the future, we plan to improve the model's reasoning and agent capabilities.
Model Card
| Architecture | Mixture-of-Experts (MoE) |
| Total Parameters | 3x7B |
| Activated Parameters | 3B |
| Experts Shared Frequency | 3 |
| Number of Layers (Dense layer included) | 31 |
| Number of Dense Layers | 1 |
| Attention Hidden Dimension | 2048 |
| MoE Hidden Dimension (per Expert) | 1408 |
| Number of Attention Heads | 16 |
| Number of Experts | 64 |
| Selected Experts per Token | 6 |
| Number of Shared Experts | 4 |
| Vocabulary Size | 128,880 |
| Context Length | 32K |
| Base Frequency of RoPE | 5,000,000 |
| Attention Mechanism | GQA |
| Activation Function | SwiGLU |
Performance
We evaluated Megrez2-3x7B-A3B using the open-source evaluation tool OpenCompass on several important benchmarks. Some of the evaluation results are shown in the table below.
| Benchmark | Metric | Megrez2-3x7B -A3B |
Megrez2-3x7B -A3B-Preview |
SmallThinker-21B -A3B-Instruct |
Qwen3-30B-A3B | Qwen3-8B | Qwen3-4B -Instruct-2507 |
Phi4-14B (nothink) |
Gemma3-12B |
|---|---|---|---|---|---|---|---|---|---|
| Activate Params (B) | 3.0 | 3.0 | 3.0 | 3.3 | 8.2 | 4.0 | 14.7 | 12.2 | |
| Stored Params (B) | 7.5 | 7.5 | 21.5 | 30.5 | 8.2 | 4.0 | 14.7 | 12.2 | |
| MMLU | EM | 85.4 | 87.5 | 84.4 | 85.1 | 81.8 | - | 84.6 | 78.5 |
| GPQA | EM | 58.8 | 28.8 | 55.0 | 44.4 | 38.9 | 62 | 55.5 | 34.9 |
| IFEval | Inst loose |
87.7 | 80.2 | 85.8 | 84.3 | 83.9 | 83.4 | 63.2 | 74.7 |
| MATH-500 | EM | 87.2 | 81.6 | 82.4 | 84.4 | 81.6 | - | 80.2 | 82.4 |
How to Run
llama.cpp
llama.cpp enables LLM inference with minimal setup and state-of-the-art performance on a wide range of hardware. Now supported, please refer to the support-megrez branch for details.
Under the FP16 floating-point precision configuration, the performance of the current model on code tasks has decreased compared to the original model. We have launched optimization efforts to address this issue and are currently exploring solutions.
Best Practice
To achieve optimal performance, we recommend the following settings:
Sampling Parameters: we suggest using Temperature=0.7 and TopP=0.9 .
Standardize Output Format: We recommend using prompts to standardize model outputs when benchmarking.
- Math Problems: Include "Please reason step by step, and put your final answer within \boxed{}." in the prompt.
- Multiple-Choice Questions: Add the following JSON structure to the prompt to standardize responses: "Please show your choice in the answer field with only the choice letter, e.g., "answer": "C"."
License Agreement
All our open-weight models are licensed under Apache 2.0.
Citation
If you find our work helpful, feel free to give us a cite.
@misc{li2025megrez2technicalreport,
title={Megrez2 Technical Report},
author={Boxun Li and Yadong Li and Zhiyuan Li and Congyi Liu and Weilin Liu and Guowei Niu and Zheyue Tan and Haiyang Xu and Zhuyu Yao and Tao Yuan and Dong Zhou and Yueqing Zhuang and Bo Zhao and Guohao Dai and Yu Wang},
year={2025},
eprint={2507.17728},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2507.17728},
}
Contact
If you have any questions, please feel free to submit a GitHub issue or contact WeChat groups.
- Downloads last month
- 522
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
16-bit