Instructions to use Tokeys/MiMo-V2-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tokeys/MiMo-V2-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Tokeys/MiMo-V2-Flash", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Tokeys/MiMo-V2-Flash", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Tokeys/MiMo-V2-Flash with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Tokeys/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": "Tokeys/MiMo-V2-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Tokeys/MiMo-V2-Flash
- SGLang
How to use Tokeys/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 "Tokeys/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": "Tokeys/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 "Tokeys/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": "Tokeys/MiMo-V2-Flash", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Tokeys/MiMo-V2-Flash with Docker Model Runner:
docker model run hf.co/Tokeys/MiMo-V2-Flash
| { | |
| "architectures": [ | |
| "MiMoV2FlashForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_mimo_v2_flash.MiMoV2FlashConfig", | |
| "AutoModel": "modeling_mimo_v2_flash.MiMoV2FlashModel", | |
| "AutoModelForCausalLM": "modeling_mimo_v2_flash.MiMoV2FlashForCausalLM" | |
| }, | |
| "quantization_config": { | |
| "activation_scheme": "dynamic", | |
| "fmt": "e4m3", | |
| "packed_modules_mapping": {}, | |
| "quant_method": "fp8", | |
| "ignored_layers": [ | |
| "model.layers.0.self_attn.o_proj", | |
| "model.layers.1.self_attn.o_proj", | |
| "model.layers.2.self_attn.o_proj", | |
| "model.layers.3.self_attn.o_proj", | |
| "model.layers.4.self_attn.o_proj", | |
| "model.layers.5.self_attn.o_proj", | |
| "model.layers.6.self_attn.o_proj", | |
| "model.layers.7.self_attn.o_proj", | |
| "model.layers.8.self_attn.o_proj", | |
| "model.layers.9.self_attn.o_proj", | |
| "model.layers.10.self_attn.o_proj", | |
| "model.layers.11.self_attn.o_proj", | |
| "model.layers.12.self_attn.o_proj", | |
| "model.layers.13.self_attn.o_proj", | |
| "model.layers.14.self_attn.o_proj", | |
| "model.layers.15.self_attn.o_proj", | |
| "model.layers.16.self_attn.o_proj", | |
| "model.layers.17.self_attn.o_proj", | |
| "model.layers.18.self_attn.o_proj", | |
| "model.layers.19.self_attn.o_proj", | |
| "model.layers.20.self_attn.o_proj", | |
| "model.layers.21.self_attn.o_proj", | |
| "model.layers.22.self_attn.o_proj", | |
| "model.layers.23.self_attn.o_proj", | |
| "model.layers.24.self_attn.o_proj", | |
| "model.layers.25.self_attn.o_proj", | |
| "model.layers.26.self_attn.o_proj", | |
| "model.layers.27.self_attn.o_proj", | |
| "model.layers.28.self_attn.o_proj", | |
| "model.layers.29.self_attn.o_proj", | |
| "model.layers.30.self_attn.o_proj", | |
| "model.layers.31.self_attn.o_proj", | |
| "model.layers.32.self_attn.o_proj", | |
| "model.layers.33.self_attn.o_proj", | |
| "model.layers.34.self_attn.o_proj", | |
| "model.layers.35.self_attn.o_proj", | |
| "model.layers.36.self_attn.o_proj", | |
| "model.layers.37.self_attn.o_proj", | |
| "model.layers.38.self_attn.o_proj", | |
| "model.layers.39.self_attn.o_proj", | |
| "model.layers.40.self_attn.o_proj", | |
| "model.layers.41.self_attn.o_proj", | |
| "model.layers.42.self_attn.o_proj", | |
| "model.layers.43.self_attn.o_proj", | |
| "model.layers.44.self_attn.o_proj", | |
| "model.layers.45.self_attn.o_proj", | |
| "model.layers.46.self_attn.o_proj", | |
| "model.layers.47.self_attn.o_proj", | |
| "model.decoder.self_attn.o_proj" | |
| ], | |
| "weight_block_size": [ | |
| 128, | |
| 128 | |
| ] | |
| }, | |
| "attention_dropout": 0.0, | |
| "attention_value_scale": 0.707, | |
| "hidden_act": "silu", | |
| "hidden_size": 4096, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 16384, | |
| "max_position_embeddings": 262144, | |
| "model_type": "mimo_v2_flash", | |
| "num_attention_heads": 64, | |
| "head_dim": 192, | |
| "num_hidden_layers": 48, | |
| "num_key_value_heads": 4, | |
| "layernorm_epsilon": 1e-05, | |
| "rope_theta": 5000000, | |
| "tie_word_embeddings": false, | |
| "torch_dtype": "bfloat16", | |
| "transformers_version": "4.40.1", | |
| "use_cache": true, | |
| "vocab_size": 152576, | |
| "partial_rotary_factor": 0.334, | |
| "sliding_window": 128, | |
| "swa_rope_theta": 10000, | |
| "attention_bias": false, | |
| "v_head_dim": 128, | |
| "hybrid_layer_pattern": [ | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 0 | |
| ], | |
| "add_swa_attention_sink_bias": true, | |
| "add_full_attention_sink_bias": false, | |
| "sliding_window_size": 128, | |
| "attention_chunk_size": 128, | |
| "moe_layer_freq": [ | |
| 0, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1, | |
| 1 | |
| ], | |
| "moe_intermediate_size": 2048, | |
| "n_routed_experts": 256, | |
| "n_shared_experts": null, | |
| "num_experts_per_tok": 8, | |
| "norm_topk_prob": true, | |
| "scoring_func": "sigmoid", | |
| "n_group": 1, | |
| "topk_group": 1, | |
| "topk_method": "noaux_tc", | |
| "routed_scaling_factor": null, | |
| "swa_num_attention_heads": 64, | |
| "swa_num_key_value_heads": 8, | |
| "swa_head_dim": 192, | |
| "swa_v_head_dim": 128 | |
| } | |