Instructions to use operationrange/MiniMax-M2.7-BF16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use operationrange/MiniMax-M2.7-BF16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="operationrange/MiniMax-M2.7-BF16", 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("operationrange/MiniMax-M2.7-BF16", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("operationrange/MiniMax-M2.7-BF16", 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 operationrange/MiniMax-M2.7-BF16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "operationrange/MiniMax-M2.7-BF16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "operationrange/MiniMax-M2.7-BF16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/operationrange/MiniMax-M2.7-BF16
- SGLang
How to use operationrange/MiniMax-M2.7-BF16 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 "operationrange/MiniMax-M2.7-BF16" \ --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": "operationrange/MiniMax-M2.7-BF16", "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 "operationrange/MiniMax-M2.7-BF16" \ --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": "operationrange/MiniMax-M2.7-BF16", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use operationrange/MiniMax-M2.7-BF16 with Docker Model Runner:
docker model run hf.co/operationrange/MiniMax-M2.7-BF16
MiniMax-M2.7 — BF16 (dequantized from FP8)
Plain bfloat16 weights of MiniMaxAI/MiniMax-M2.7,
reconstructed from the upstream block-FP8 (E4M3, 128×128 blocks) checkpoint
via shard-by-shard blockwise dequantization. No calibration, no rounding loss
beyond the original FP8→BF16 cast — every block is materialized exactly:
bf16_block = (fp8_block.float() * scale_fp32).bfloat16()
Why this exists
MiniMaxAI/MiniMax-M2.7 ships natively in FP8. On Ampere and earlier
(e.g. RTX A5000) FP8 tensor cores don't exist and inference engines have
to emulate FP8 through FP16 — paying double bandwidth without the speed
benefit. For further offline quantization (AWQ, GPTQ, RTN INT8, …) you
need plain BF16 weights anyway: transformers + torch_dtype=bfloat16
won't materialize the attention projections under the FP8 quant config,
which trips up llmcompressor's GPTQ tracer.
This repo is the missing intermediate: upstream MiniMax-M2.7 weights in plain BF16 safetensors, ready to be fed into any standard quantization pipeline.
Contents
- 47 shards
model-NNNNN-of-00047.safetensors - rebuilt
model.safetensors.index.json(no*.weight_scale_inventries) config.jsonwith the upstreamquantization_configstripped- tokenizer + custom modeling
.pyfiles copied verbatim from the FP8 source
Total ≈ 458 GB.
Provenance
Produced on a single 48 GB GPU pod (~30 minutes wall time) using a
~150-line script — see
dequant_fp8_blockwise.py.
Process per shard:
- open
model-XXXXX-of-00130.safetensorsfrom the FP8 source - for each
*.weight(FP8 e4m3fn): look up*.weight_scale_inv(FP32, 128×128) - broadcast scale to weight shape, multiply, cast to BF16
- drop the scale tensor
- write
model-NNNNN-of-00047.safetensors(5 GB shards)
Other tensors (embeddings, layer norms, MoE routers/gates that were already
unquantized in the upstream config's modules_to_not_convert) are passed
through with a BF16 cast.
Quick load
from transformers import AutoModelForCausalLM, AutoTokenizer
m = AutoModelForCausalLM.from_pretrained(
"operationrange/MiniMax-M2.7-BF16",
torch_dtype="bfloat16",
device_map="auto",
trust_remote_code=True,
)
tok = AutoTokenizer.from_pretrained("operationrange/MiniMax-M2.7-BF16", trust_remote_code=True)
Inference at full BF16 needs ≥ ~470 GB combined GPU+CPU memory, so this checkpoint is mostly intended as a starting point for further compression (AWQ-INT4, GPTQ-INT8, etc.) rather than direct serving.
License
Inherits the MiniMax-M2 license from the upstream model. No weights were modified — only the storage format.
- Downloads last month
- 20
Model tree for operationrange/MiniMax-M2.7-BF16
Base model
MiniMaxAI/MiniMax-M2.7