Text Generation
Transformers
Safetensors
English
Chinese
mimo_v2
multimodal
vision-language
audio
agent
video-understanding
long-context
conversational
custom_code
Eval Results
8-bit precision
fp8
Instructions to use XiaomiMiMo/MiMo-V2.6-Flash-RL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XiaomiMiMo/MiMo-V2.6-Flash-RL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="XiaomiMiMo/MiMo-V2.6-Flash-RL", 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.6-Flash-RL", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use XiaomiMiMo/MiMo-V2.6-Flash-RL with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XiaomiMiMo/MiMo-V2.6-Flash-RL" # 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.6-Flash-RL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/XiaomiMiMo/MiMo-V2.6-Flash-RL
- SGLang
How to use XiaomiMiMo/MiMo-V2.6-Flash-RL 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.6-Flash-RL" \ --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.6-Flash-RL", "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.6-Flash-RL" \ --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.6-Flash-RL", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use XiaomiMiMo/MiMo-V2.6-Flash-RL with Docker Model Runner:
docker model run hf.co/XiaomiMiMo/MiMo-V2.6-Flash-RL
Download chat_template.jinja from XiaomiMiMo/MiMo-V2.6-Flash-RL: direct link, hf CLI and curl.
- Browser
- Download file 3.87 kB
-
https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Flash-RL/resolve/6fa50b36fd16e691c7dc8f66d6f93edf96c8d669/chat_template.jinja
- Command line
-
hf download hf://XiaomiMiMo/MiMo-V2.6-Flash-RL@6fa50b36fd16e691c7dc8f66d6f93edf96c8d669/chat_template.jinja
-
curl -L -o chat_template.jinja https://huggingface.co/XiaomiMiMo/MiMo-V2.6-Flash-RL/resolve/6fa50b36fd16e691c7dc8f66d6f93edf96c8d669/chat_template.jinja
3.87 kB
| {%- macro render_value(value) -%} | |
| {%- if value is string -%} | |
| {{- value -}} | |
| {%- else -%} | |
| {{- value | tojson(ensure_ascii=False) -}} | |
| {%- endif -%} | |
| {%- endmacro -%} | |
| {%- macro render_content(message_content) -%} | |
| {%- if message_content is string -%} | |
| {{- message_content -}} | |
| {%- elif message_content is iterable -%} | |
| {%- for part in message_content -%} | |
| {%- if part is not mapping -%} | |
| {{- part -}} | |
| {%- elif part['type'] == 'image' or 'image' in part or 'image_url' in part -%} | |
| {{- '<|vision_start|><|image_pad|><|vision_end|>' -}} | |
| {%- elif part['type'] == 'audio' or part['type'] == 'input_audio' or 'audio' in part or 'audio_url' in part or 'input_audio' in part -%} | |
| {{- '<|mimo_audio_start|><|audio_pad|><|mimo_audio_end|>' -}} | |
| {%- elif part['type'] == 'video' or 'video' in part or 'video_url' in part -%} | |
| {{- '<|vision_start|><|video_pad|><|vision_end|>' -}} | |
| {%- elif 'text' in part -%} | |
| {{- part['text'] -}} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- endif -%} | |
| {%- endmacro -%} | |
| {%- macro render_tools(tools) -%} | |
| {{- 'You are provided with the following tools:\n\n<tools>' -}} | |
| {%- for tool in tools -%} | |
| {{- '\n' ~ (tool | tojson(ensure_ascii=False)) -}} | |
| {%- endfor -%} | |
| {{- '\n</tools>' -}} | |
| {%- endmacro -%} | |
| {%- macro render_tool_calls(tool_calls) -%} | |
| {%- for tool_call in tool_calls -%} | |
| {%- if tool_call.function is defined -%} | |
| {%- set tool_call = tool_call.function -%} | |
| {%- elif tool_call.custom is defined -%} | |
| {%- set tool_call = tool_call.custom -%} | |
| {%- endif -%} | |
| {{- '<tool_call><function=' ~ tool_call.name ~ '>' -}} | |
| {%- if tool_call.input is defined and tool_call.input is string -%} | |
| {{- tool_call.input -}} | |
| {%- elif tool_call.arguments -%} | |
| {%- if tool_call.arguments is string -%} | |
| {{- tool_call.arguments -}} | |
| {%- else -%} | |
| {%- for args_name, args_value in tool_call.arguments | items -%} | |
| {{- '<parameter=' ~ args_name ~ '>' ~ render_value(args_value) ~ '</parameter>' -}} | |
| {%- endfor -%} | |
| {%- endif -%} | |
| {%- endif -%} | |
| {{- '</function></tool_call>' -}} | |
| {%- endfor -%} | |
| {%- endmacro -%} | |
| {%- macro render_assistant_message(message) -%} | |
| {%- set content = render_content(message.content) -%} | |
| {%- set reasoning = message.reasoning_content if message.reasoning_content is string else '' -%} | |
| {{- '<|im_start|>assistant\n<think>' ~ reasoning ~ '</think>' ~ content -}} | |
| {%- if message.tool_calls is defined and message.tool_calls is iterable and message.tool_calls | length > 0 -%} | |
| {{- render_tool_calls(message.tool_calls) -}} | |
| {%- endif -%} | |
| {{- '<|im_end|>' -}} | |
| {%- endmacro -%} | |
| {%- if tools is defined and tools is iterable and tools | length > 0 -%} | |
| {{- '<|im_start|>system\n' ~ render_tools(tools) ~ '<|im_end|>' -}} | |
| {%- endif -%} | |
| {%- for message in messages -%} | |
| {%- if message.role == 'assistant' -%} | |
| {{- render_assistant_message(message) -}} | |
| {%- else -%} | |
| {%- set body = render_content(message.content) -%} | |
| {{- '<|im_start|>' ~ message.role ~ '\n' ~ body -}} | |
| {%- if message.tools is defined and message.tools is iterable and message.tools | length > 0 -%} | |
| {%- if body -%} | |
| {{- '\n\n' -}} | |
| {%- endif -%} | |
| {{- render_tools(message.tools) -}} | |
| {%- endif -%} | |
| {{- '<|im_end|>' -}} | |
| {%- endif -%} | |
| {%- endfor -%} | |
| {%- if add_generation_prompt -%} | |
| {{- '<|im_start|>assistant\n' -}} | |
| {%- if enable_thinking is false -%} | |
| {{- '<think></think>' -}} | |
| {%- endif -%} | |
| {%- endif -%} | |