Instructions to use MiniMaxAI/MiniMax-M2.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MiniMaxAI/MiniMax-M2.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MiniMaxAI/MiniMax-M2.1", 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("MiniMaxAI/MiniMax-M2.1", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("MiniMaxAI/MiniMax-M2.1", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MiniMaxAI/MiniMax-M2.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MiniMaxAI/MiniMax-M2.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MiniMaxAI/MiniMax-M2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MiniMaxAI/MiniMax-M2.1
- SGLang
How to use MiniMaxAI/MiniMax-M2.1 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 "MiniMaxAI/MiniMax-M2.1" \ --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": "MiniMaxAI/MiniMax-M2.1", "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 "MiniMaxAI/MiniMax-M2.1" \ --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": "MiniMaxAI/MiniMax-M2.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MiniMaxAI/MiniMax-M2.1 with Docker Model Runner:
docker model run hf.co/MiniMaxAI/MiniMax-M2.1
Add files using upload-large-folder tool
Browse files- model-00078-of-00130.safetensors +3 -0
- model-00080-of-00130.safetensors +3 -0
- model-00082-of-00130.safetensors +3 -0
- model-00083-of-00130.safetensors +3 -0
- model-00084-of-00130.safetensors +3 -0
- model-00085-of-00130.safetensors +3 -0
- model-00086-of-00130.safetensors +3 -0
- model-00087-of-00130.safetensors +3 -0
- model-00088-of-00130.safetensors +3 -0
- model-00089-of-00130.safetensors +3 -0
- model-00090-of-00130.safetensors +3 -0
- model-00091-of-00130.safetensors +3 -0
- model-00092-of-00130.safetensors +3 -0
- model-00093-of-00130.safetensors +3 -0
- model-00094-of-00130.safetensors +3 -0
- model-00095-of-00130.safetensors +3 -0
- model-00096-of-00130.safetensors +3 -0
- model-00097-of-00130.safetensors +3 -0
- model-00099-of-00130.safetensors +3 -0
- model-00101-of-00130.safetensors +3 -0
model-00078-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1e39be88cdb339805880f4a4aeb0a9a3d054544f639710ef479a1e686496df78
|
| 3 |
+
size 2463870000
|
model-00080-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a3c4e028a851f8ffd08d209f38cb1597aae2bfdf9789b886235814e3ec658b4d
|
| 3 |
+
size 2463870000
|
model-00082-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4dd1321614be8b6cc91c5151f98c11c5206d87596cccea0cfd25a92b6e8489d0
|
| 3 |
+
size 2463870000
|
model-00083-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:93a3c09729b0e311a7fb9b97bc5a5fe25298760bed5e06b8df03b620dc617980
|
| 3 |
+
size 1208321720
|
model-00084-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cf9c0f576454648d312776dd41722d3a70b811020f87101f343bf919374cb8ba
|
| 3 |
+
size 2463870000
|
model-00085-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4e6b1e1396360c8ec588b5de70a51575f42c4ccc0bfc7681761640c6c9c1c79
|
| 3 |
+
size 1208321720
|
model-00086-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b35a961ad11e4886b9a2701217c2d987557f86bf4b866575994d6f53e6a93dfc
|
| 3 |
+
size 2463870000
|
model-00087-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3489eab628868300d70a91290a097cc991518e672211641e7027dbcde86df006
|
| 3 |
+
size 1208321720
|
model-00088-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4016e6666329fb7aaa39d676c4d711505613f0f508e11e7fd34bacb01c0a1fc5
|
| 3 |
+
size 2463870000
|
model-00089-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:73c94cd6f41db36e398c5f53bf784cbe331380a5c5c6337c041a53b2a28d7335
|
| 3 |
+
size 1208321720
|
model-00090-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:660ad11ecbce3a5690c44f6aa197e99e8265eec77adb58172ae16ac9d6d555db
|
| 3 |
+
size 2463870000
|
model-00091-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:251879e4aed926f4141c656cca20165d97798ecd04b19b25c7e935e364d677e6
|
| 3 |
+
size 1208321720
|
model-00092-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:80ae45db87452043faccd182566b941cb139daf8b6bbe8ce4e93c774b3035a40
|
| 3 |
+
size 2463870000
|
model-00093-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4b2133ed6b9353c2faa6fc0636e628b503fcc06595b00938127f1d57f8ded3ca
|
| 3 |
+
size 1208321720
|
model-00094-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:38d578dbfae615ab955c6685b93ef6f6edb8723795a7dc5322eef20022f2e3c3
|
| 3 |
+
size 2463870000
|
model-00095-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6e8aadd428101830f2f8dc35a9d9c8728297e148f47128bad111a7e05e03c3f3
|
| 3 |
+
size 1208321720
|
model-00096-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a6b206f258506b4ec553c3c5d8fbd6edbe7072d229445d3eda4d8ee5f7cc02df
|
| 3 |
+
size 2463870000
|
model-00097-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:723e46aa887af11c686ca083f3ac85093c8d723488febc48b9a74f3984b9662a
|
| 3 |
+
size 1208321720
|
model-00099-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4265c4dfb1a96c739e8f013620bddb47c24c8b0ef773561b9b82d9dfbf4fee39
|
| 3 |
+
size 1208321720
|
model-00101-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c9daefb8fb272e6986ceb82046a06fff3943b55542eb38b1620c198a1426c9d
|
| 3 |
+
size 1208321720
|