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-00098-of-00130.safetensors +3 -0
- model-00100-of-00130.safetensors +3 -0
- model-00102-of-00130.safetensors +3 -0
- model-00103-of-00130.safetensors +3 -0
- model-00104-of-00130.safetensors +3 -0
- model-00105-of-00130.safetensors +3 -0
- model-00106-of-00130.safetensors +3 -0
- model-00107-of-00130.safetensors +3 -0
- model-00108-of-00130.safetensors +3 -0
- model-00109-of-00130.safetensors +3 -0
- model-00110-of-00130.safetensors +3 -0
- model-00111-of-00130.safetensors +3 -0
- model-00112-of-00130.safetensors +3 -0
- model-00113-of-00130.safetensors +3 -0
- model-00114-of-00130.safetensors +3 -0
- model-00115-of-00130.safetensors +3 -0
- model-00117-of-00130.safetensors +3 -0
- model-00119-of-00130.safetensors +3 -0
- model-00125-of-00130.safetensors +3 -0
- model-00126-of-00130.safetensors +3 -0
model-00098-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f2424d85d24c10ada76ad98730ae5c11f0e21fde4a9f743a6b16671ffcbc89aa
|
| 3 |
+
size 2463870000
|
model-00100-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ec9e1c654708baa52b8c3e9efc2a9ed0dc48c2e70e6bb76376c42a4d6587a454
|
| 3 |
+
size 2463870000
|
model-00102-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:88bec437439fcedb12208c2255806e8255e2d0e382ce386a5a52087db02257fa
|
| 3 |
+
size 2463870000
|
model-00103-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:34c7a8a2857213f0815b88fc5bda4a818e4db3259aec303b0fe5b9e7bda78dad
|
| 3 |
+
size 1208321720
|
model-00104-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:52db1e44d37997b8d247bd72ad3f7663b19991afbdca6428ae96548efc858038
|
| 3 |
+
size 2463870000
|
model-00105-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:272e89fb71dca48ffbeaf021f6e0a940a50271eaea28dd79cb8ec0179aaf84a6
|
| 3 |
+
size 1208321720
|
model-00106-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:31cad8f509206f6adae0026b06d06fd1dfce6fb4772627f53faff6a5d46df717
|
| 3 |
+
size 2463870000
|
model-00107-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:980871e168f0e832d23fe36a17289c64ced49201d2a2c3f27fae33d7094ba898
|
| 3 |
+
size 1208321720
|
model-00108-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cfa9f4d88745a955aa39357d12374dcbdfe339e087a73a0f67446dfa1f02f5ac
|
| 3 |
+
size 2463870000
|
model-00109-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5049bcc814c7dcfc907a45f5f43ab0329aefcb25841e53a68e363abd2e1e41a3
|
| 3 |
+
size 1208321720
|
model-00110-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c63ed8e64c4c4e03a8b60373bee658b1816fafda324464df020b872aaca6c12c
|
| 3 |
+
size 2463870000
|
model-00111-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7a32ba627c4e30b147ef9fc2fa0ee8e42d7c075581c4041f50a569d0874dea5c
|
| 3 |
+
size 1208321720
|
model-00112-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b8804e53197cb1c6dae1bec0a6cb8c0b63c7ec0eab495f3993f494c1c1b6604f
|
| 3 |
+
size 2463870000
|
model-00113-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:12acef967bd4afb64b1e28c7d828ff0f547145362494673d5f5bb9b42406fffb
|
| 3 |
+
size 1208321720
|
model-00114-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f1a4480030b1465fd1ded96a2bc2db5cf55649105c768d40dc7c0578c254f68c
|
| 3 |
+
size 2463870000
|
model-00115-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:81f9a8c9e0e0aeffb74c7353b5c7f8617efe18af0def47dd7f6c8f124fa860cb
|
| 3 |
+
size 1208321720
|
model-00117-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f48256d3b80e3df5c3226f5634e55573aaef7956c6fc0af67922b0e9878bad6
|
| 3 |
+
size 1208321720
|
model-00119-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f5cec6f846ff50933ab1cbe79aaf2b4d34295b99f983b2c8f6ddb892fd01539
|
| 3 |
+
size 1208321720
|
model-00125-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:60d95b10b6e140a9626a7058d5038528f2ff80148dc4569b881db56052046509
|
| 3 |
+
size 40
|
model-00126-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:60d95b10b6e140a9626a7058d5038528f2ff80148dc4569b881db56052046509
|
| 3 |
+
size 40
|