Instructions to use XiaomiMiMo/MiMo-V2-Flash-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XiaomiMiMo/MiMo-V2-Flash-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="XiaomiMiMo/MiMo-V2-Flash-Base", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("XiaomiMiMo/MiMo-V2-Flash-Base", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("XiaomiMiMo/MiMo-V2-Flash-Base", trust_remote_code=True, device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use XiaomiMiMo/MiMo-V2-Flash-Base 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-Base" # 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-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/XiaomiMiMo/MiMo-V2-Flash-Base
- SGLang
How to use XiaomiMiMo/MiMo-V2-Flash-Base 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-Base" \ --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-Base", "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-Base" \ --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-Base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use XiaomiMiMo/MiMo-V2-Flash-Base with Docker Model Runner:
docker model run hf.co/XiaomiMiMo/MiMo-V2-Flash-Base
Update README.md
Browse files
README.md
CHANGED
|
@@ -254,9 +254,30 @@ curl -i http://localhost:9001/v1/chat/completions \
|
|
| 254 |
}'
|
| 255 |
```
|
| 256 |
|
|
|
|
|
|
|
| 257 |
> [!IMPORTANT]
|
| 258 |
> In the thinking mode with multi-turn tool calls, the model returns a `reasoning_content` field alongside `tool_calls`. To continue the conversation, the user must persist all history `reasoning_content` in the `messages` array of each subsequent request.
|
| 259 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
-----
|
| 261 |
|
| 262 |
## 7. Citation
|
|
|
|
| 254 |
}'
|
| 255 |
```
|
| 256 |
|
| 257 |
+
### Notifications
|
| 258 |
+
|
| 259 |
> [!IMPORTANT]
|
| 260 |
> In the thinking mode with multi-turn tool calls, the model returns a `reasoning_content` field alongside `tool_calls`. To continue the conversation, the user must persist all history `reasoning_content` in the `messages` array of each subsequent request.
|
| 261 |
|
| 262 |
+
> [!IMPORTANT]
|
| 263 |
+
> The following system prompts are **HIGHTLY** recommended, please choose from English and Chinese version.
|
| 264 |
+
|
| 265 |
+
English
|
| 266 |
+
|
| 267 |
+
```plaintext
|
| 268 |
+
You are MiMo, an AI assistant developed by Xiaomi.
|
| 269 |
+
|
| 270 |
+
Today's date: {date} {week}. Your knowledge cutoff date is December 2024.
|
| 271 |
+
```
|
| 272 |
+
|
| 273 |
+
Chinese
|
| 274 |
+
|
| 275 |
+
```plaintext
|
| 276 |
+
你是MiMo(中文名称也是MiMo),是小米公司大模型Core团队研发的AI智能助手。
|
| 277 |
+
|
| 278 |
+
今天的日期:{date} {week},你的知识截止日期是2024年12月。
|
| 279 |
+
```
|
| 280 |
+
|
| 281 |
-----
|
| 282 |
|
| 283 |
## 7. Citation
|