Instructions to use mlx-community/MiniMax-M2.1-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/MiniMax-M2.1-8bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/MiniMax-M2.1-8bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Transformers
How to use mlx-community/MiniMax-M2.1-8bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mlx-community/MiniMax-M2.1-8bit", 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("mlx-community/MiniMax-M2.1-8bit", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("mlx-community/MiniMax-M2.1-8bit", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- vLLM
How to use mlx-community/MiniMax-M2.1-8bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mlx-community/MiniMax-M2.1-8bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/MiniMax-M2.1-8bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/mlx-community/MiniMax-M2.1-8bit
- SGLang
How to use mlx-community/MiniMax-M2.1-8bit 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 "mlx-community/MiniMax-M2.1-8bit" \ --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": "mlx-community/MiniMax-M2.1-8bit", "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 "mlx-community/MiniMax-M2.1-8bit" \ --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": "mlx-community/MiniMax-M2.1-8bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Pi
How to use mlx-community/MiniMax-M2.1-8bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/MiniMax-M2.1-8bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mlx-community/MiniMax-M2.1-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mlx-community/MiniMax-M2.1-8bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/MiniMax-M2.1-8bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mlx-community/MiniMax-M2.1-8bit
Run Hermes
hermes
- MLX LM
How to use mlx-community/MiniMax-M2.1-8bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "mlx-community/MiniMax-M2.1-8bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/MiniMax-M2.1-8bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/MiniMax-M2.1-8bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Docker Model Runner
How to use mlx-community/MiniMax-M2.1-8bit with Docker Model Runner:
docker model run hf.co/mlx-community/MiniMax-M2.1-8bit
Upload
Browse files- model-00026-of-00047.safetensors +3 -0
- model-00027-of-00047.safetensors +3 -0
- model-00028-of-00047.safetensors +3 -0
- model-00029-of-00047.safetensors +3 -0
- model-00030-of-00047.safetensors +3 -0
- model-00031-of-00047.safetensors +3 -0
- model-00032-of-00047.safetensors +3 -0
- model-00033-of-00047.safetensors +3 -0
- model-00034-of-00047.safetensors +3 -0
- model-00035-of-00047.safetensors +3 -0
- model-00036-of-00047.safetensors +3 -0
- model-00037-of-00047.safetensors +3 -0
- model-00038-of-00047.safetensors +3 -0
- model-00039-of-00047.safetensors +3 -0
- model-00040-of-00047.safetensors +3 -0
model-00026-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8b08c207d718621d61308213462fd24503d3385a3680c886d4916bb14aafb05a
|
| 3 |
+
size 5181537188
|
model-00027-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eb4321ab3dce8523e554ad995467c7228d4486093ed84050b0c7d0275ad9b736
|
| 3 |
+
size 5181537226
|
model-00028-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c9d976a796fd9704fcbe39432cadd31e17fdc98aee76aea572decaa2ff3b3192
|
| 3 |
+
size 5229244626
|
model-00029-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e1d6787b0c54fac9146d8a20235a5d830ce1be7ad58a56888603a6a75267bb56
|
| 3 |
+
size 5181537180
|
model-00030-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6087215246a6f8cb439e1251fcf529bd1ede880f4ea562ae9b3812399a678ff7
|
| 3 |
+
size 5181537220
|
model-00031-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f9d0b03ac6d15787270f1650d80266828db6ad6f3367aa04c3f3deb413a89dd4
|
| 3 |
+
size 5229244560
|
model-00032-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a751c2887f6743b8236903abcb90574916cf2c7b6a72b7dfc73a8c1b8713a5b2
|
| 3 |
+
size 5181537232
|
model-00033-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b0e9ca208783c92417245a7ccbabb77a0a50d41f5b32e12ff0ae05f22761213c
|
| 3 |
+
size 5181537234
|
model-00034-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:74194debf8379c443125635a267c924cfc71f6ade258ecbb832ec894add10bef
|
| 3 |
+
size 5229244594
|
model-00035-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:52eee12ed8eaa669587e9e752b1206ebf312e92dbd1049d37aeb4c47a8d7f3bc
|
| 3 |
+
size 5181537206
|
model-00036-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc49a8800ede501dbbb813401fd15e56b5484d11403d27a2d959ffa69bc3f443
|
| 3 |
+
size 5181537230
|
model-00037-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dddac6233a9584b3252207993745d9019884170cd79ad0ff0be9c9621c5861a7
|
| 3 |
+
size 5229244598
|
model-00038-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d2c3e73afd3bf4048ad36d727b51c77b4795a3c729dae5f11d0ed377985ce824
|
| 3 |
+
size 5181537232
|
model-00039-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:edda29794a3248afdcbf3cb2335c9a97958d88003e97d8bfe716f367fd64c1ce
|
| 3 |
+
size 5181537230
|
model-00040-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:178c13d15bd20a8dfe68e8c1977e91713d8e1ddd4ef3bdc270e1f4a31fb45d57
|
| 3 |
+
size 5229244578
|