Instructions to use XiaomiMiMo/MiMo-V2.5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XiaomiMiMo/MiMo-V2.5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="XiaomiMiMo/MiMo-V2.5", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("XiaomiMiMo/MiMo-V2.5", trust_remote_code=True, device_map="auto") - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use XiaomiMiMo/MiMo-V2.5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XiaomiMiMo/MiMo-V2.5" # 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.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/XiaomiMiMo/MiMo-V2.5
- SGLang
How to use XiaomiMiMo/MiMo-V2.5 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.5" \ --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.5", "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.5" \ --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.5", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use XiaomiMiMo/MiMo-V2.5 with Docker Model Runner:
docker model run hf.co/XiaomiMiMo/MiMo-V2.5
Roo Code: MiMo-V2.5 chat template crashes when system.content is an OpenAI content-part array
Hi Xiaomi MiMo team,
I found a compatibility issue when serving XiaomiMiMo/MiMo-V2.5 with the recommended SGLang image and using OpenAI-compatible clients such as Roo Code. I do believe I have the latest version of the templates as I only downloaded the model after that warning message.
The model works correctly when the system message content is a plain string, but crashes when system.content is provided as an OpenAI-style content-part array.
Environment:
Model: XiaomiMiMo/MiMo-V2.5
Serving image: lmsysorg/sglang:dev-mimo-v2.5
Backend: SGLang OpenAI-compatible /v1/chat/completions
Command includes:
--reasoning-parser mimo
--tool-call-parser mimo
--trust-remote-code
--attention-backend fa3
Minimal repro:
curl -s http://127.0.0.1:8000/v1/chat/completions
-H 'Content-Type: application/json'
-d '{
"model": "model_name",
"messages": [
{
"role": "system",
"content": [
{"type": "text", "text": "You are a helpful coding assistant."}
]
},
{
"role": "user",
"content": "Say hello in one sentence."
}
],
"max_tokens": 64
}'
Actual result:
500 Internal Server Error
TypeError: can only concatenate str (not "list") to str
Trace points to the HF chat template rendering path:
transformers/tokenization_utils_base.py -> apply_chat_template Expected result: The template should either accept OpenAI-style text content parts for system.content, or SGLang/model preprocessing should normalize: "content": [{"type": "text", "text": "You are a helpful coding assistant."}] to: "content": "You are a helpful coding assistant." before rendering the template. Notes: User messages with content parts work correctly. Temporary workaround that fixed it locally: Monkeypatch transformers.PreTrainedTokenizerBase.apply_chat_template to flatten only text-only system.content arrays into strings before calling the original method. The workaround avoids touching user multimodal/image messages. It would be useful if the official tokenizer_config.json chat template or recommended SGLang serving path handled this case directly. Excellent model, by the way, I have been very impressed by it, thank you for releasing it!
transformers/utils/chat_template_utils.py -> render_jinja_template
jinja2/environment.py -> compiled_template.render
, line 54
TypeError: can only concatenate str (not "list") to str
Basic OpenAI tools arrays also work correctly.
The failure appears specific to structured system.content.
This affects Roo Code because it sends the system prompt as OpenAI-style content parts.
thank you ! will take a look soon
Update: I found the root cause on my side.
The issue only occurred when I served MiMo-V2.5 with:
--reasoning-parser mimo
Switching the reasoning parser to Qwen 3 fixed the Roo Code compatibility issue:
--reasoning-parser qwen3
With --reasoning-parser qwen3, the same OpenAI-style structured system.content request no longer crashes.
So this may not be an issue with the MiMo-V2.5 model files or chat template directly. It appears to be related to the mimo reasoning parser path in SGLang when handling OpenAI-compatible clients that send system messages as content-part arrays.
Sorry for the earlier confusion, and thanks again for taking a look.