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]:])) - 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.