Text Generation
Transformers
Safetensors
minimax_m2
auto-round
nvfp4-plus
nvfp4
4-bit precision
Mixture of Experts
conversational
custom_code
Instructions to use intel-ai/MiniMax-M2.7-NVFP4-AutoRound with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use intel-ai/MiniMax-M2.7-NVFP4-AutoRound with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="intel-ai/MiniMax-M2.7-NVFP4-AutoRound", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("intel-ai/MiniMax-M2.7-NVFP4-AutoRound", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("intel-ai/MiniMax-M2.7-NVFP4-AutoRound", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use intel-ai/MiniMax-M2.7-NVFP4-AutoRound with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "intel-ai/MiniMax-M2.7-NVFP4-AutoRound" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intel-ai/MiniMax-M2.7-NVFP4-AutoRound", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/intel-ai/MiniMax-M2.7-NVFP4-AutoRound
- SGLang
How to use intel-ai/MiniMax-M2.7-NVFP4-AutoRound 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 "intel-ai/MiniMax-M2.7-NVFP4-AutoRound" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intel-ai/MiniMax-M2.7-NVFP4-AutoRound", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "intel-ai/MiniMax-M2.7-NVFP4-AutoRound" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "intel-ai/MiniMax-M2.7-NVFP4-AutoRound", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use intel-ai/MiniMax-M2.7-NVFP4-AutoRound with Docker Model Runner:
docker model run hf.co/intel-ai/MiniMax-M2.7-NVFP4-AutoRound
Update README.md
Browse files
README.md
CHANGED
|
@@ -43,16 +43,18 @@ The checkpoint requires an inference implementation supporting AutoRound's nvfp4
|
|
| 43 |
|
| 44 |
The evaluated setup used vLLM 0.32.0 with the QDQ plugin from Intel Neural Compressor PR #2621 (https://github.com/intel/neural-compressor/pull/2621). Install the plugin in the same Python environment as vLLM:
|
| 45 |
|
|
|
|
| 46 |
git clone https://github.com/intel/neural-compressor.git
|
| 47 |
cd neural-compressor
|
| 48 |
python -m pip install --no-build-isolation -e benchmark/vllm-qdq-plugin/
|
|
|
|
| 49 |
|
| 50 |
This inference path uses FP4 Marlin kernels with activation quantize-dequantize (QDQ), rather than native NVFP4 hardware computation.
|
| 51 |
|
| 52 |
### vLLM Usage
|
| 53 |
|
| 54 |
Replace the model path with your local checkpoint directory:
|
| 55 |
-
|
| 56 |
NCCL_NVLS_ENABLE=0 \
|
| 57 |
VLLM_QDQ=1 \
|
| 58 |
vllm serve /path/to/MiniMax-M2.7-NVFP4-E5M3-AutoRound \
|
|
@@ -67,7 +69,7 @@ vllm serve /path/to/MiniMax-M2.7-NVFP4-E5M3-AutoRound \
|
|
| 67 |
--kv-cache-dtype fp8 \
|
| 68 |
--gpu-memory-utilization 0.85 \
|
| 69 |
--port 8001
|
| 70 |
-
|
| 71 |
Adjust context length and GPU memory utilization according to available hardware. FP8 KV cache is a runtime setting, separate from the checkpoint's weight and activation quantization.
|
| 72 |
|
| 73 |
## Evaluation
|
|
@@ -85,11 +87,13 @@ Recovery is the quantized score divided by the supplied original-model baseline.
|
|
| 85 |
|
| 86 |
## Generate the Model
|
| 87 |
|
|
|
|
| 88 |
auto_round MiniMaxAI/MiniMax-M2.7 \
|
| 89 |
--model_free \
|
| 90 |
--scheme NVFP4_E5M3 \
|
| 91 |
--format auto_round \
|
| 92 |
--output_dir ./MiniMax-M2.7-NVFP4-E5M3-AutoRound
|
|
|
|
| 93 |
|
| 94 |
## Ethical Considerations and Limitations
|
| 95 |
|
|
|
|
| 43 |
|
| 44 |
The evaluated setup used vLLM 0.32.0 with the QDQ plugin from Intel Neural Compressor PR #2621 (https://github.com/intel/neural-compressor/pull/2621). Install the plugin in the same Python environment as vLLM:
|
| 45 |
|
| 46 |
+
```bash
|
| 47 |
git clone https://github.com/intel/neural-compressor.git
|
| 48 |
cd neural-compressor
|
| 49 |
python -m pip install --no-build-isolation -e benchmark/vllm-qdq-plugin/
|
| 50 |
+
```
|
| 51 |
|
| 52 |
This inference path uses FP4 Marlin kernels with activation quantize-dequantize (QDQ), rather than native NVFP4 hardware computation.
|
| 53 |
|
| 54 |
### vLLM Usage
|
| 55 |
|
| 56 |
Replace the model path with your local checkpoint directory:
|
| 57 |
+
```bash
|
| 58 |
NCCL_NVLS_ENABLE=0 \
|
| 59 |
VLLM_QDQ=1 \
|
| 60 |
vllm serve /path/to/MiniMax-M2.7-NVFP4-E5M3-AutoRound \
|
|
|
|
| 69 |
--kv-cache-dtype fp8 \
|
| 70 |
--gpu-memory-utilization 0.85 \
|
| 71 |
--port 8001
|
| 72 |
+
```
|
| 73 |
Adjust context length and GPU memory utilization according to available hardware. FP8 KV cache is a runtime setting, separate from the checkpoint's weight and activation quantization.
|
| 74 |
|
| 75 |
## Evaluation
|
|
|
|
| 87 |
|
| 88 |
## Generate the Model
|
| 89 |
|
| 90 |
+
```bash
|
| 91 |
auto_round MiniMaxAI/MiniMax-M2.7 \
|
| 92 |
--model_free \
|
| 93 |
--scheme NVFP4_E5M3 \
|
| 94 |
--format auto_round \
|
| 95 |
--output_dir ./MiniMax-M2.7-NVFP4-E5M3-AutoRound
|
| 96 |
+
```
|
| 97 |
|
| 98 |
## Ethical Considerations and Limitations
|
| 99 |
|