Instructions to use MiniMaxAI/MiniMax-M3.1-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MiniMaxAI/MiniMax-M3.1-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="MiniMaxAI/MiniMax-M3.1-Flash", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("MiniMaxAI/MiniMax-M3.1-Flash", trust_remote_code=True) model = AutoModelForMultimodalLM.from_pretrained("MiniMaxAI/MiniMax-M3.1-Flash", trust_remote_code=True, device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MiniMaxAI/MiniMax-M3.1-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MiniMaxAI/MiniMax-M3.1-Flash" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MiniMaxAI/MiniMax-M3.1-Flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/MiniMaxAI/MiniMax-M3.1-Flash
- SGLang
How to use MiniMaxAI/MiniMax-M3.1-Flash 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 "MiniMaxAI/MiniMax-M3.1-Flash" \ --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": "MiniMaxAI/MiniMax-M3.1-Flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "MiniMaxAI/MiniMax-M3.1-Flash" \ --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": "MiniMaxAI/MiniMax-M3.1-Flash", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use MiniMaxAI/MiniMax-M3.1-Flash with Docker Model Runner:
docker model run hf.co/MiniMaxAI/MiniMax-M3.1-Flash
vLLM: reasoning not split from content when streaming (non-streaming works)
When serving MiniMax-M3.1-Flash with vLLM and --reasoning-parser minimax_m3, non-streaming responses split reasoning from content correctly, but streaming responses do not: the whole <mm:think>...</mm:think> block arrives in delta.content and delta.reasoning stays empty.
Environment
- Image:
vllm/vllm-openai:minimax-m31-flash(digestsha256:86f582dae25ea92802353727164ae4eb03b37b18baf9119b805ffaec2a7ef07c, vLLM0.1.dev23341+g8744dd2fb) - Weights: this repo at
main(54e4e69),chat_template.jinjaunmodified - 4x RTX PRO 6000 Blackwell (sm120), TP4
Relevant serve args:
--tensor-parallel-size 4 --block-size 128 --disable-hybrid-kv-cache-manager
--kv-cache-dtype fp8 --attention-config '{"indexer_kv_dtype":"fp8"}'
--reasoning-parser minimax_m3 --enable-auto-tool-choice --tool-call-parser minimax_m3
Repro
Same prompt both ways: {"messages":[{"role":"user","content":"What is 17*23? Answer briefly."}]}
Non-streaming (correct):
reasoning: "17*23 = 391."
content: "391"
Streaming ("stream": true), concatenated deltas:
reasoning: ""
content: "<mm:think>17*23 = 391.</mm:think>391"
The first content delta is literally "<mm:think>".
Reproduced directly against the vLLM server, with no proxy in between.
What we tried
| Request | Streaming result |
|---|---|
| default (adaptive thinking) | not split, <mm:think>...</mm:think> in content |
"chat_template_kwargs": {"thinking_mode": "enabled"} |
not split |
thinking_mode: enabled + "reasoning_effort": "high" |
not split, and content begins with a stray </mm:think> |
vllm/reasoning/minimax_m3_reasoning_parser.py has not changed upstream since 2026-08-31, so a newer nightly does not seem to address it.
Is this a known issue with the vLLM integration, or is there a serving flag or chat-template kwarg we are missing for streaming? Happy to test a fix.
Side note for other sm120 (RTX PRO 6000 / consumer Blackwell) users
The vLLM recipe targets SM100. On sm120:
--kv-cache-dtype nvfp4andindexer_kv_dtype: nvfp4are rejected (SM100/SM103/SM107 only), so we use fp8.- The DSpark draft needs an explicit
attention_backend. Left on auto it picks FlashInfer, which has no 128-token page and fails withNo common block size for 128.FLASH_ATTNcannot hold an fp8 KV cache on sm120, so we use"attention_backend":"FLASH_ATTN","kv_cache_dtype":"bfloat16"for the draft.
With that it loads and runs well: ~240 tok/s single-stream decode, DSpark mean acceptance length ~3.05 with 3 speculative tokens.
Same bug reproduced on multi-node DGX Spark (GB10/SM121) TP4 + DSpark spec-decode.
Confirming this is reproducible on a completely different setup from the original
report: 4× DGX Spark (GB10, sm_121), TP=4, DSpark k=7 spec-decode, Marlin NVFP4 MoE
(W4A16), kv_cache_dtype: fp8, max_model_len: 1M, all served fromvllm/vllm-openai:minimax-m31-flash (vLLM 0.1.dev23341+g8744dd2fb.d20261022) with:
--reasoning-parser minimax_m3
--tool-call-parser minimax_m3 --enable-auto-tool-choice
Same prompt, both modes:
- Non-streaming:
reasoning="17*23 = 391.",content=391✅ - Streaming (
stream: true): concat ofdelta.contentchunks =</mm:think>391,delta.reasoningis empty ❌ (the closing</mm:think>tag leaks into visible content)
Cross-check: --tool-call-parser minimax_m3 splits tool_calls correctly in both
streaming and non-streaming modes (verified get_weather → {"city": "Istanbul"} viatool_calls field with finish_reason: tool_calls). So the bug is confined tominimax_m3_reasoning_parser's streaming path, not the minimax_m3 plugin family
in general.
vllm/reasoning/minimax_m3_reasoning_parser.py has not changed upstream since
2026-08-31 — so as the original report notes, this is not a recent regression;
the streaming extractor/writer for delta.reasoning appears to simply never
have been wired in.
This is fixed upstream. vLLM PR #63492, merged Oct 27, references this thread, and the fix shipped in vLLM v0.34.0 (Nov 16). The vllm/vllm-openai:minimax-m31-flash tag you're both on was last pushed Oct 23 and still has digest sha256:86f582da…, so it doesn't include the fix.
The cause, per the PR: at the start of a stream, vLLM calls is_reasoning_end(prompt_token_ids) once. The M3.1 chat template's system message describes the thinking format with a literal <mm:think></mm:think> pair. Scanning the full prompt finds a </mm:think> after the last <mm:think>, so the parser decides reasoning has already ended before the first generated token. Every delta then skips the reasoning parser and lands in content. Non-streaming never checks the prompt, which is why it works. The fix only looks at the tokens after the last ]~b], which is the generation prompt ]~b]ai\n.
I checked this with this repo's tokenizer and chat template (transformers 5.22.2), running both versions of minimax_m3_reasoning_parser.py:
| prompt | parser before the fix | v0.34.0 parser |
|---|---|---|
| single turn ("What is 17*23? Answer briefly.") | is_reasoning_end → True |
False |
| multi-turn, with a tool offered | True |
False |
In the single-turn prompt, the last <mm:think> is token 86 and the last </mm:think> is token 105, both inside the system message. The generation prompt contains neither.
So the fix is to move to vllm/vllm-openai:v0.34.0 or a recent nightly. v0.34.0's model registry also has the M3.1-Flash architecture and the DSpark draft model. I haven't run v0.34.0 on sm120 or GB10, so your fp8 KV and attention-backend workarounds may still be needed there. If you also send stop strings, one more streaming case is still open in #64415.