Instructions to use XiaomiMiMo/MiMo-V2-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XiaomiMiMo/MiMo-V2-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="XiaomiMiMo/MiMo-V2-Flash", 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("XiaomiMiMo/MiMo-V2-Flash", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("XiaomiMiMo/MiMo-V2-Flash", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use XiaomiMiMo/MiMo-V2-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XiaomiMiMo/MiMo-V2-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": "XiaomiMiMo/MiMo-V2-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/XiaomiMiMo/MiMo-V2-Flash
- SGLang
How to use XiaomiMiMo/MiMo-V2-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 "XiaomiMiMo/MiMo-V2-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": "XiaomiMiMo/MiMo-V2-Flash", "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 "XiaomiMiMo/MiMo-V2-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": "XiaomiMiMo/MiMo-V2-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use XiaomiMiMo/MiMo-V2-Flash with Docker Model Runner:
docker model run hf.co/XiaomiMiMo/MiMo-V2-Flash
Issue with Tool Call Parsing in MiMo-V2-Flash (tau2 Reproduction)
Hi Xiaomi MiMo Team,
Thank you so much for open-sourcing such impressive models and sharing your research! Your contributions to the community are greatly appreciated.
I am currently working on reproducing the tau2 benchmark scores reported for MiMo-V2-Flash. However, while setting up the evaluation environment using SGLang, I encountered a critical parsing issue that prevents the model from successfully executing tool calls.
[Problem Description]
Despite the explicit instruction in the chat template ("DO NOT use function calls inside <think></think> tags"), the model frequently generates tool call XML within the reasoning block.
This leads to a structural failure in SGLang’s parsing logic:
- When
--reasoning-parseris enabled, SGLang splits the output intoreasoning_contentandcontent. - The
--tool-call-parser mimoonly scans thecontentsection for valid calls. - Because the tool XML is "trapped" inside the
<think>tags, it is categorized solely as reasoning content, and the parser returns"tool_calls": null.
[Environment & Setup]
I am using the following configuration for the SGLang server:
pip install sglang==0.5.6.post2.dev8005+pr.15207.g39d5bd57a \
--index-url https://sgl-project.github.io/whl/pr/ \
--extra-index-url https://pypi.org/simple
# Launch the server
SGLANG_ENABLE_SPEC_V2=1 python3 -m sglang.launch_server \
--model-path XiaomiMiMo/MiMo-V2-Flash \
--served-model-name mimo-v2-flash \
--pp-size 1 \
--dp-size 2 \
--enable-dp-attention \
--tp-size 8 \
--moe-a2a-backend deepep \
--page-size 1 \
--host 0.0.0.0 \
--port 9001 \
--trust-remote-code \
--mem-fraction-static 0.75 \
--max-running-requests 128 \
--chunked-prefill-size 16384 \
--reasoning-parser qwen3 \
--tool-call-parser mimo \
--context-length 262144 \
--attention-backend fa3 \
--speculative-algorithm EAGLE \
--speculative-num-steps 3 \
--speculative-eagle-topk 1 \
--speculative-num-draft-tokens 4 \
--enable-mtp
[Request for Guidance]
To help me accurately reproduce the reported tau2 results, could you provide some guidance on the following?
- Evaluation Pipeline: Did your team use a specific fallback parser, a custom script, or a different serving framework entirely during the original
tau2evaluation? - Prompting: Was there a particular system prompt or formatting constraint used to strictly enforce the separation of tool calls from the reasoning process?
- SGLang Configuration: If SGLang was indeed used, is there a recommended setting or workaround to ensure the parser correctly captures tool calls even if they inadvertently appear inside reasoning tags?
Thank you for your time and for your incredible work on the MiMo series. I look forward to your insights!
Best regards,