Text Generation
Transformers
Safetensors
English
Chinese
minimax_m2
minimax
nvfp4
4-bit precision
quantized
compressed-tensors
vllm
DGX-Spark
GB10
MoE
agentic
tool-use
code
conversational
custom_code
8-bit precision
Instructions to use saricles/MiniMax-M2.7-NVFP4-GB10-AC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use saricles/MiniMax-M2.7-NVFP4-GB10-AC with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="saricles/MiniMax-M2.7-NVFP4-GB10-AC", 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("saricles/MiniMax-M2.7-NVFP4-GB10-AC", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("saricles/MiniMax-M2.7-NVFP4-GB10-AC", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use saricles/MiniMax-M2.7-NVFP4-GB10-AC with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "saricles/MiniMax-M2.7-NVFP4-GB10-AC" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "saricles/MiniMax-M2.7-NVFP4-GB10-AC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/saricles/MiniMax-M2.7-NVFP4-GB10-AC
- SGLang
How to use saricles/MiniMax-M2.7-NVFP4-GB10-AC 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 "saricles/MiniMax-M2.7-NVFP4-GB10-AC" \ --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": "saricles/MiniMax-M2.7-NVFP4-GB10-AC", "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 "saricles/MiniMax-M2.7-NVFP4-GB10-AC" \ --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": "saricles/MiniMax-M2.7-NVFP4-GB10-AC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use saricles/MiniMax-M2.7-NVFP4-GB10-AC with Docker Model Runner:
docker model run hf.co/saricles/MiniMax-M2.7-NVFP4-GB10-AC
| # run_vllm.sh — reference vLLM launch for MiniMax-M2.7-NVFP4-GB10-AC on dual-Spark TP=2. | |
| # | |
| # Ships configured for the "Agentic" deployment profile (Marlin NVFP4 MoE + ngram speculative | |
| # decoding). Comment out the --speculative-config line below to switch to the | |
| # "Throughput-stable" profile for novel-text / batch workloads. | |
| # | |
| # See DEPLOYMENT.md in this repo for: | |
| # - Profile tradeoffs and when to pick which | |
| # - Measured numbers on 2× DGX Spark (GB10, SM 12.1) | |
| # - Observations, caveats, and links to the community threads / PRs that informed this recipe. | |
| # | |
| # Assumes: | |
| # - Ray head + worker already running (one per Spark) | |
| # - Model mounted/available at $MODEL_PATH on both hosts | |
| # - vLLM >= 0.19.x with the Marlin NVFP4 backend built in (eugr/spark-vllm-docker nightly is the reference image) | |
| set -euo pipefail | |
| MODEL_PATH="${MODEL_PATH:-/models/MiniMax-M2.7-NVFP4-GB10-AC}" | |
| SERVED_NAME="${SERVED_NAME:-minimax-m2.7-ac}" | |
| HOST="${HOST:-0.0.0.0}" | |
| PORT="${PORT:-30000}" | |
| GPU_MEM_UTIL="${GPU_MEM_UTIL:-0.88}" | |
| MAX_MODEL_LEN="${MAX_MODEL_LEN:-196608}" | |
| MAX_NUM_SEQS="${MAX_NUM_SEQS:-12}" | |
| MAX_NUM_BATCHED_TOKENS="${MAX_NUM_BATCHED_TOKENS:-32768}" | |
| TP_SIZE="${TP_SIZE:-2}" | |
| # --- Tuned environment variables ---------------------------------------------- | |
| # Forum + vendor-recipe validated for MiniMax-M2.7 NVFP4 on GB10 (SM 12.1). | |
| # On SM 12.1, the Marlin NVFP4 MoE backend is currently the fastest path — the | |
| # FlashInfer CUTLASS NVFP4 MoE path has maturity issues on this specific compute | |
| # capability (see DEPLOYMENT.md § "Why Marlin MoE on GB10"). | |
| export SAFETENSORS_FAST_GPU=1 | |
| export OMP_NUM_THREADS=8 | |
| export TORCHINDUCTOR_MAX_AUTOTUNE=0 | |
| export VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 | |
| export VLLM_FLOAT32_MATMUL_PRECISION=high | |
| export VLLM_FLASHINFER_MOE_BACKEND=throughput | |
| export VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=1 | |
| # Marlin NVFP4 MoE path | |
| export VLLM_NVFP4_GEMM_BACKEND=marlin | |
| export VLLM_USE_FLASHINFER_MOE_FP4=0 | |
| export VLLM_TEST_FORCE_FP8_MARLIN=1 | |
| export VLLM_MARLIN_USE_ATOMIC_ADD=1 | |
| # --- Compilation config ------------------------------------------------------- | |
| # cudagraph_mode=none is INTENTIONAL on dual-Spark Ray TP. | |
| # PIECEWISE captures cleanly in current vLLM builds (historical deadlock is fixed) | |
| # but measurably regresses decode 12–20% on multi-node Ray TP because each piece | |
| # boundary forces a cross-node sync over QSFP56 whose cost exceeds launch-overhead | |
| # savings. Retest only if you change away from Ray or run on a single Spark. | |
| COMPILATION_CONFIG='{"cudagraph_mode":"none","inductor_compile_config":{"combo_kernels":false,"benchmark_combo_kernel":false,"max_autotune":false,"max_autotune_gemm":false}}' | |
| # --- Speculative decoding (Agentic profile) ----------------------------------- | |
| # ngram speculation wins on agentic / code traffic (repeated tool names, file paths, | |
| # JSON keys) — peak 48.34 tok/s, avg 36.44 tok/s across our 12-prompt agent set. | |
| # On synthetic benchmarks with low token repetition it slightly regresses decode. | |
| # To switch to the "Throughput-stable" profile, comment out the SPECULATIVE_CONFIG | |
| # line below and remove --speculative-config from the vllm serve invocation. | |
| SPECULATIVE_CONFIG='{"method":"ngram","num_speculative_tokens":5,"prompt_lookup_max":4,"prompt_lookup_min":2}' | |
| # --- vLLM serve --------------------------------------------------------------- | |
| exec vllm serve "$MODEL_PATH" \ | |
| --host "$HOST" --port "$PORT" \ | |
| --served-model-name "$SERVED_NAME" \ | |
| --tensor-parallel-size "$TP_SIZE" \ | |
| --distributed-executor-backend ray \ | |
| --gpu-memory-utilization "$GPU_MEM_UTIL" \ | |
| --max-model-len "$MAX_MODEL_LEN" \ | |
| --max-num-seqs "$MAX_NUM_SEQS" \ | |
| --max-num-batched-tokens "$MAX_NUM_BATCHED_TOKENS" \ | |
| --kv-cache-dtype fp8_e4m3 \ | |
| --attention-backend flashinfer \ | |
| --attention-config.use_trtllm_attention=0 \ | |
| --enable-prefix-caching \ | |
| --enable-chunked-prefill \ | |
| --trust-remote-code \ | |
| --enable-auto-tool-choice --tool-call-parser minimax_m2 \ | |
| --reasoning-parser minimax_m2_append_think \ | |
| --compilation-config "$COMPILATION_CONFIG" \ | |
| --speculative-config "$SPECULATIVE_CONFIG" | |