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
- 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 new
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-00011-of-00047.safetensors +3 -0
- model-00012-of-00047.safetensors +3 -0
- model-00013-of-00047.safetensors +3 -0
- model-00014-of-00047.safetensors +3 -0
- model-00015-of-00047.safetensors +3 -0
- model-00016-of-00047.safetensors +3 -0
- model-00017-of-00047.safetensors +3 -0
- model-00018-of-00047.safetensors +3 -0
- model-00019-of-00047.safetensors +3 -0
- model-00020-of-00047.safetensors +3 -0
- model-00021-of-00047.safetensors +3 -0
- model-00022-of-00047.safetensors +3 -0
- model-00023-of-00047.safetensors +3 -0
- model-00024-of-00047.safetensors +3 -0
- model-00025-of-00047.safetensors +3 -0
model-00011-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1d478518e363d9d5df187dba92c07a01e75688235c861da97dedc1db09a3af4
|
| 3 |
+
size 5181537220
|
model-00012-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2316867d49dede0d81599baaef0184c565cfaba35eeae5c67d3bc50372b53705
|
| 3 |
+
size 5181537222
|
model-00013-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a665b7089fb31ec9b36d49fd2b3a931a7eb2bd764cb1ec5aa2570211f4d4747e
|
| 3 |
+
size 5229244560
|
model-00014-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b692d35a3ba1ce29e7fdeb99f8121348c35c357275e1e041dcc259bb4b4984c1
|
| 3 |
+
size 5181537206
|
model-00015-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f6b27c6ce3621c86381cc13975da8f7da7da3fc0d198bfc25dbb4d788c03dc71
|
| 3 |
+
size 5181537234
|
model-00016-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96b4bddcae3316e2200bab9e264a2b949c4d2a83acdb7dfb2ebe17ce322ab10d
|
| 3 |
+
size 5229244602
|
model-00017-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:97b84237077dc74ad4fc64d7d068e43aef00a76cbaf0d69b4504e768692a4696
|
| 3 |
+
size 5181537240
|
model-00018-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:531c1e66951e0508ba73da7f798db718e0c031f686544e845637c2996b80cd20
|
| 3 |
+
size 5181537206
|
model-00019-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e5eceaf9e85a065d0178c193de4345957f6ca7b0512c2a4ed66670552d014682
|
| 3 |
+
size 5229244624
|
model-00020-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:fc50344c9aa5dd4ea4b77f7b54c1b3c9a5fc22195f0519ee20277f7d0370c78a
|
| 3 |
+
size 5181537232
|
model-00021-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b4bff083108b3579a33311cee46fabdd7f2ba0feaba4ecc0560f059187e7ea1
|
| 3 |
+
size 5181537226
|
model-00022-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b4c9751fc8b6f79c607e798bfd17034c1575408f3804be4358964f1a750206d9
|
| 3 |
+
size 5229244578
|
model-00023-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96d8f012ccfb63f0afc3aec4c87d5c7c373c4dbf7f67f0b27a94bd04499034cf
|
| 3 |
+
size 5181537236
|
model-00024-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:553cc01bdcc4479bfa8a801f9507fed2e37e4bb0668d918eed698fc008befbac
|
| 3 |
+
size 5181537226
|
model-00025-of-00047.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7e43d933affb8f4394097d57b2afb27b8dc41668b8cd577707826a1cc6a71d1f
|
| 3 |
+
size 5229244592
|