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-00058-of-00130.safetensors +3 -0
- model-00060-of-00130.safetensors +3 -0
- model-00062-of-00130.safetensors +3 -0
- model-00063-of-00130.safetensors +3 -0
- model-00064-of-00130.safetensors +3 -0
- model-00065-of-00130.safetensors +3 -0
- model-00066-of-00130.safetensors +3 -0
- model-00067-of-00130.safetensors +3 -0
- model-00068-of-00130.safetensors +3 -0
- model-00069-of-00130.safetensors +3 -0
- model-00070-of-00130.safetensors +3 -0
- model-00071-of-00130.safetensors +3 -0
- model-00072-of-00130.safetensors +3 -0
- model-00073-of-00130.safetensors +3 -0
- model-00074-of-00130.safetensors +3 -0
- model-00075-of-00130.safetensors +3 -0
- model-00076-of-00130.safetensors +3 -0
- model-00077-of-00130.safetensors +3 -0
- model-00079-of-00130.safetensors +3 -0
- model-00081-of-00130.safetensors +3 -0
model-00058-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5851eb14d88fbfca17902abcffee0b23469eed3f5774963643d5fc47b965eb6a
|
| 3 |
+
size 2463870000
|
model-00060-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:53756d742e9d168abd93385afda05c198aae0af8d365a37ea426170492f76b95
|
| 3 |
+
size 2463870000
|
model-00062-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f971bc270dc5bdfeb6ed697b81a82e3bb871f67008b1e6dc630b712f27a8b6c0
|
| 3 |
+
size 2463870000
|
model-00063-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6c3b9a1da7ef0d22f872514545789d5f09016f8b19e42196291cf5ac03b97371
|
| 3 |
+
size 1208321720
|
model-00064-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6843193f9428a615ae73d08d28f0c45780ee4a816160c739ec43eb2b97b08ebb
|
| 3 |
+
size 2463870000
|
model-00065-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:08250404376f793d88114569bc688eb1f2f0e3362d14a7f98bafdaf8946ba5b6
|
| 3 |
+
size 1208321720
|
model-00066-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c66a8842ebb3ee0c57aeaa79219dea97644757e3a2687239b740605076a55ae7
|
| 3 |
+
size 2463870000
|
model-00067-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:30de7939106eee13c3287062c1cfff64151ce40dd9df2d2ed302534264dcf7d7
|
| 3 |
+
size 1208321720
|
model-00068-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:58e5e832abae58bc00ebec9233b85ba9238f074631ca536000b2f0defdab2dcd
|
| 3 |
+
size 2463870000
|
model-00069-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a486eb60bbc0aa07dc4b5d579c79cacddff7a95abf09dbc31daa21826a22d32e
|
| 3 |
+
size 1208321720
|
model-00070-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b4c87d552ab115ed044b71a1f50b0f55673724dd33f30b47ec62c01650bd3500
|
| 3 |
+
size 2463870000
|
model-00071-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:32d9fd804c11fae7b038aeb6960466898833e3674887e32924d4a740a1d78e64
|
| 3 |
+
size 1208321720
|
model-00072-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cc04e61181fe55d87cf54944dd776b656ebbd2d00a57c931e3dbc4edd3a51f44
|
| 3 |
+
size 2463870000
|
model-00073-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f2364fd711749dee328d3d049b6e533595eb94bb1508e6e47668c1f0c6f5d5ac
|
| 3 |
+
size 1208321720
|
model-00074-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4385a5145e5ea2f895fb49a078a536e405d5d8944c09c267104f06f79479561b
|
| 3 |
+
size 2463870000
|
model-00075-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:55d8e7f5ae80c68aa5a2cd5e4d061e620467a113f43eec1ac031e6aa887a21d3
|
| 3 |
+
size 1208321720
|
model-00076-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d9e38b4e3d3f6c258a433bb5fae422daea75c4d72df610e0b43f6a50e99c72ae
|
| 3 |
+
size 2463870000
|
model-00077-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d9563a5fc0288fe5b213fb834852907d47ad5b1979f69d04d12e0aa52e002566
|
| 3 |
+
size 1208321720
|
model-00079-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d1f617cab4400626658d68088612ca345974a54796fd9396f3bc77b05b1c36d4
|
| 3 |
+
size 1208321720
|
model-00081-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f48db3406b5ef2bd20384031c9caddfdcf4555e34c667205c79688516d3c6701
|
| 3 |
+
size 1208321720
|