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)# 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) 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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-00038-of-00130.safetensors +3 -0
- model-00040-of-00130.safetensors +3 -0
- model-00042-of-00130.safetensors +3 -0
- model-00043-of-00130.safetensors +3 -0
- model-00044-of-00130.safetensors +3 -0
- model-00045-of-00130.safetensors +3 -0
- model-00046-of-00130.safetensors +3 -0
- model-00047-of-00130.safetensors +3 -0
- model-00048-of-00130.safetensors +3 -0
- model-00049-of-00130.safetensors +3 -0
- model-00050-of-00130.safetensors +3 -0
- model-00051-of-00130.safetensors +3 -0
- model-00052-of-00130.safetensors +3 -0
- model-00053-of-00130.safetensors +3 -0
- model-00054-of-00130.safetensors +3 -0
- model-00055-of-00130.safetensors +3 -0
- model-00056-of-00130.safetensors +3 -0
- model-00057-of-00130.safetensors +3 -0
- model-00059-of-00130.safetensors +3 -0
- model-00061-of-00130.safetensors +3 -0
model-00038-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7b00505426db2e221f9e1ff5bf6667839c79077680267605f01ce8561a3a6db0
|
| 3 |
+
size 2463870000
|
model-00040-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f63bc4df96e5db36551bafe8a19c52671a720715259b5793daf6f627f1a3f712
|
| 3 |
+
size 2463870000
|
model-00042-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:86b0f9a5c91d49d87e16e06e9224003e6ece9fe4cceb81de20b7335539c89623
|
| 3 |
+
size 2463870000
|
model-00043-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:01c7827dc83cf39e9e942508c4f9bed820a2e58539993dacd1bfc3fb101fe54b
|
| 3 |
+
size 1208321720
|
model-00044-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:619aabf8abcb5558a13906d3e5fb6bb4a26679f0caf2d598c3ff4fd7c1ef6ef4
|
| 3 |
+
size 2463870000
|
model-00045-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:157980344f4b3a25b735b15842e874bd7a3c144b83a05e5bb691ba935139ef74
|
| 3 |
+
size 1208321720
|
model-00046-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6cc5f611201eedbab086fd2135b27e7fbf23a51a5796d80eab7f626599a6e82e
|
| 3 |
+
size 2463870000
|
model-00047-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1d61c06c59e3a5b4c4a432fc845c8eebbde7b693b1ba1c0a3e42076bd9fe1d4b
|
| 3 |
+
size 1208321720
|
model-00048-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:752c11295dfda87db85b7183702b36d621b2d741e7d23a8c0ec57c804d606e9c
|
| 3 |
+
size 2463870000
|
model-00049-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3531c8be2646cfb2827d58bcfcdf3edbd147c3a787c2af02ab975c2950807b6c
|
| 3 |
+
size 1208321720
|
model-00050-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5fb53f941912ddd44f4a6eb604dcfcf15dfd4a59b394e9c58dee0e0c796d472a
|
| 3 |
+
size 2463870000
|
model-00051-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:776e16d0f59ba83d22a7279f8689d106952f49ec0585a6892cbbb22ff8f978df
|
| 3 |
+
size 1208321720
|
model-00052-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f35958c62cc5b9329197bec72d24b9ca25381f688ef8aa8264136e179c0f6b18
|
| 3 |
+
size 2463870000
|
model-00053-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f50de42310c9bf54ff45df0e3623061399a14121585ed92950da960b80e32faf
|
| 3 |
+
size 1208321720
|
model-00054-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ce93f004e3e8d581f3c6adfa8230609417f42d97ae19b11ee41a272363a216a6
|
| 3 |
+
size 2463870000
|
model-00055-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2625525457d52cd1ff730a2efc4321b651fa047cffbbe42392fd5ffafbde5198
|
| 3 |
+
size 1208321720
|
model-00056-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:50bda61a04a9780bfaff66d41605ef841c8aa490e27968b7d6362cbfe9373873
|
| 3 |
+
size 2463870000
|
model-00057-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0329f61e0412a3295e2e88fc384e21be159fa0f97f9afeed61a93839c1defe51
|
| 3 |
+
size 1208321720
|
model-00059-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61ba4e7993aa46c3697b3632f1489b0c6597af09e876a0f5156304b8512cb0a8
|
| 3 |
+
size 1208321720
|
model-00061-of-00130.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65c0cc4d1221a2455ee1ff73c92bd6967e903bdb789717ef376cb89a55c13689
|
| 3 |
+
size 1208321720
|