Roo Code: MiMo-V2.5 chat template crashes when system.content is an OpenAI content-part array

#12
by Spordleoo - opened

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
transformers/utils/chat_template_utils.py -> render_jinja_template
jinja2/environment.py -> compiled_template.render

Sign up or log in to comment