Text Generation
Transformers
Safetensors
minimax_m2
minimax
Mixture of Experts
nvfp4
quantized
vllm
blackwell
conversational
custom_code
compressed-tensors
Instructions to use GadflyII/MiniMax-M2.1-NVFP4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GadflyII/MiniMax-M2.1-NVFP4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GadflyII/MiniMax-M2.1-NVFP4", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GadflyII/MiniMax-M2.1-NVFP4", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("GadflyII/MiniMax-M2.1-NVFP4", trust_remote_code=True) 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use GadflyII/MiniMax-M2.1-NVFP4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GadflyII/MiniMax-M2.1-NVFP4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GadflyII/MiniMax-M2.1-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GadflyII/MiniMax-M2.1-NVFP4
- SGLang
How to use GadflyII/MiniMax-M2.1-NVFP4 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 "GadflyII/MiniMax-M2.1-NVFP4" \ --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": "GadflyII/MiniMax-M2.1-NVFP4", "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 "GadflyII/MiniMax-M2.1-NVFP4" \ --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": "GadflyII/MiniMax-M2.1-NVFP4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GadflyII/MiniMax-M2.1-NVFP4 with Docker Model Runner:
docker model run hf.co/GadflyII/MiniMax-M2.1-NVFP4
Note: Updated for Transformers 5.0.0 release compatibility Jan 26th, 2026.
MiniMax-M2.1-NVFP4
NVFP4 quantized version of MiniMaxAI/MiniMax-M2.1 for efficient inference on NVIDIA Blackwell GPUs.
Model Details
| Property | Value |
|---|---|
| Base Model | MiniMaxAI/MiniMax-M2.1 |
| Architecture | Mixture of Experts (MoE) |
| Total Parameters | 229B |
| Active Parameters | ~45B (8 of 256 experts) |
| Quantization | NVFP4 (e2m1 format) |
| Size | 131 GB |
Quantization Details
- Format: NVFP4 with two-level scaling (block-wise FP8 + global FP32)
- Scheme:
compressed-tensorswithnvfp4-pack-quantizedformat - Target: All linear layers in attention and MoE experts
- Group Size: 16
Requirements
- NVIDIA Blackwell GPU (RTX 5090, RTX PRO 6000, etc.)
- vLLM with flashinfer-cutlass NVFP4 support
- ~130 GB VRAM (TP=2 recommended for dual GPU setups)
Usage with vLLM
from vllm import LLM, SamplingParams
llm = LLM(
model="GadflyII/MiniMax-M2.1-NVFP4",
tensor_parallel_size=2,
max_model_len=4096,
gpu_memory_utilization=0.90,
trust_remote_code=True,
)
sampling_params = SamplingParams(
temperature=0.7,
top_p=0.9,
max_tokens=1024,
)
outputs = llm.generate(["Your prompt here"], sampling_params)
print(outputs[0].outputs[0].text)
Performance
Tested on 2x RTX PRO 6000 Blackwell (96GB each):
| Prompt Tokens | Output Tokens | Throughput |
|---|---|---|
| ~100 | 100 | ~73 tok/s |
| ~1260 | 1000 | ~72 tok/s |
License
Same as base model - see MiniMaxAI/MiniMax-M2.1 for details.
Acknowledgments
- Downloads last month
- 33
Model tree for GadflyII/MiniMax-M2.1-NVFP4
Base model
MiniMaxAI/MiniMax-M2.1
docker model run hf.co/GadflyII/MiniMax-M2.1-NVFP4