Text Generation
MLX
Safetensors
English
minimax_m2
turboquant
turboquant-plus
config-i
Mixture of Experts
apple-silicon
conversational
custom_code
4-bit precision
Instructions to use thetom-ai/MiniMax-M2.7-ConfigI-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use thetom-ai/MiniMax-M2.7-ConfigI-MLX 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("thetom-ai/MiniMax-M2.7-ConfigI-MLX") 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) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use thetom-ai/MiniMax-M2.7-ConfigI-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "thetom-ai/MiniMax-M2.7-ConfigI-MLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "thetom-ai/MiniMax-M2.7-ConfigI-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use thetom-ai/MiniMax-M2.7-ConfigI-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "thetom-ai/MiniMax-M2.7-ConfigI-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "thetom-ai/MiniMax-M2.7-ConfigI-MLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thetom-ai/MiniMax-M2.7-ConfigI-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use thetom-ai/MiniMax-M2.7-ConfigI-MLX 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 "thetom-ai/MiniMax-M2.7-ConfigI-MLX"
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 thetom-ai/MiniMax-M2.7-ConfigI-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use thetom-ai/MiniMax-M2.7-ConfigI-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "thetom-ai/MiniMax-M2.7-ConfigI-MLX"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "thetom-ai/MiniMax-M2.7-ConfigI-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -13,7 +13,7 @@ tags:
|
|
| 13 |
- config-i
|
| 14 |
- moe
|
| 15 |
- apple-silicon
|
| 16 |
-
quantized_by:
|
| 17 |
inference: false
|
| 18 |
---
|
| 19 |
|
|
@@ -62,41 +62,59 @@ Methodology: single-pass, 200 questions (10 MMLU subjects x 20), reasoning enabl
|
|
| 62 |
| 4.4K | ✓ | ✓ | ✓ |
|
| 63 |
| 8.3K | ✓ | ✓ | ✓ |
|
| 64 |
|
| 65 |
-
## Speed (Apple M5 Max 128 GB
|
| 66 |
|
| 67 |
-
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|---------|---------------|----------------|
|
| 71 |
-
| 128 | 186 | 61.4 |
|
| 72 |
-
| 256 | 268 | 60.4 |
|
| 73 |
-
| 512 | 254 | 59.4 |
|
| 74 |
-
| 1024 | 292 | 57.7 |
|
| 75 |
-
| 2048 | 312 | 55.7 |
|
| 76 |
-
| 4096 | 318 | 52.0 |
|
| 77 |
-
| 8192 | 303 | 46.2 |
|
| 78 |
-
| 16384 | 271 | 38.7 |
|
| 79 |
|
| 80 |
-
|
| 81 |
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
|
| 89 |
-
|
|
| 90 |
-
|
|
| 91 |
-
|
|
| 92 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 93 |
|
| 94 |
**Max context on 128 GB M5 Max** (87 GB model, ~36 GB free):
|
| 95 |
- bf16 KV: **149K tokens**
|
| 96 |
-
-
|
| 97 |
-
- turbo2 KV: **1.2M tokens** (8x more context)
|
| 98 |
|
| 99 |
-
|
| 100 |
|
| 101 |
## Config-I Policy (MiniMax M2.7 Adaptation)
|
| 102 |
|
|
@@ -129,12 +147,12 @@ Uniform MLX quantization produces broken output (~25% MMLU, random guessing) on
|
|
| 129 |
|
| 130 |
```bash
|
| 131 |
pip install mlx-lm
|
| 132 |
-
python -m mlx_lm.generate --model
|
| 133 |
```
|
| 134 |
|
| 135 |
```python
|
| 136 |
from mlx_lm import load, generate
|
| 137 |
-
model, tokenizer = load("
|
| 138 |
print(generate(model, tokenizer, prompt="Hello", max_tokens=256, temp=1.0, top_p=0.95))
|
| 139 |
```
|
| 140 |
|
|
@@ -148,7 +166,7 @@ For the speed and KV compression results above, use [ekryski/mlx-swift-lm](https
|
|
| 148 |
import MLXLLM
|
| 149 |
|
| 150 |
let container = try await LLMModelFactory.shared.loadContainer(
|
| 151 |
-
configuration: ModelConfiguration(id: "
|
| 152 |
|
| 153 |
let result = try await container.generate(
|
| 154 |
input: .init(text: .init(tokens: tokenArray)),
|
|
@@ -164,7 +182,7 @@ git checkout ek/tom-eric-moe-tuning
|
|
| 164 |
swift build -c release
|
| 165 |
|
| 166 |
# Download the model
|
| 167 |
-
hf download
|
| 168 |
|
| 169 |
# Run server
|
| 170 |
.build/release/MLXServer --model ~/models/MiniMax-M2.7-ConfigI-MLX --port 8080
|
|
@@ -204,4 +222,4 @@ For MoE models like MiniMax M2.7, expert MLPs dominate parameter count but toler
|
|
| 204 |
|
| 205 |
---
|
| 206 |
|
| 207 |
-
Quantized by [@
|
|
|
|
| 13 |
- config-i
|
| 14 |
- moe
|
| 15 |
- apple-silicon
|
| 16 |
+
quantized_by: thetom-ai
|
| 17 |
inference: false
|
| 18 |
---
|
| 19 |
|
|
|
|
| 62 |
| 4.4K | ✓ | ✓ | ✓ |
|
| 63 |
| 8.3K | ✓ | ✓ | ✓ |
|
| 64 |
|
| 65 |
+
## Speed (Apple M5 Max 128 GB)
|
| 66 |
|
| 67 |
+
All benchmarks with turbo4v2 KV compression enabled. Measured with [ekryski/mlx-swift-lm](https://github.com/ekryski/mlx-swift-lm/tree/ek/tom-eric-moe-tuning) (`ek/tom-eric-moe-tuning` branch).
|
| 68 |
|
| 69 |
+
### Prefill
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
+
The "Bridge" column uses a native C++ prefill path that bypasses Swift overhead for 5-48% faster prompt processing, with the biggest gains at 512-1024 token prompts.
|
| 72 |
|
| 73 |
+
| Context | Bridge + turbo4v2 | Swift + turbo4v2 | Swift vanilla | Bridge vs Swift turbo4 |
|
| 74 |
+
|---------|-------------------|------------------|---------------|------------------------|
|
| 75 |
+
| 128 | 199 t/s | 185 t/s | 185 t/s | +8% |
|
| 76 |
+
| 256 | 281 t/s | 267 t/s | 267 t/s | +5% |
|
| 77 |
+
| 512 | 368 t/s | 293 t/s | 293 t/s | +26% |
|
| 78 |
+
| 1024 | 462 t/s | 351 t/s | 351 t/s | +32% |
|
| 79 |
+
| 2048 | 510 t/s | 430 t/s | 430 t/s | +19% |
|
| 80 |
+
| 4096 | 514 t/s | 468 t/s | 468 t/s | +10% |
|
| 81 |
+
| 8192 | 477 t/s | 436 t/s | 436 t/s | +9% |
|
| 82 |
+
| 16384 | 396 t/s | 267 t/s | 267 t/s | +48% |
|
| 83 |
|
| 84 |
+
Note: turbo4v2 adds zero prefill overhead — Swift turbo4v2 and Swift vanilla prefill are identical.
|
| 85 |
+
|
| 86 |
+
### Decode
|
| 87 |
+
|
| 88 |
+
| Context | Bridge + turbo4v2 | Swift + turbo4v2 |
|
| 89 |
+
|---------|-------------------|------------------|
|
| 90 |
+
| 128 | 59.2 t/s | 61.1 t/s |
|
| 91 |
+
| 256 | 58.7 t/s | 60.5 t/s |
|
| 92 |
+
| 512 | 56.6 t/s | 58.5 t/s |
|
| 93 |
+
| 1024 | 54.7 t/s | 57.4 t/s |
|
| 94 |
+
| 2048 | 53.4 t/s | 50.0 t/s |
|
| 95 |
+
| 4096 | 50.0 t/s | 52.1 t/s |
|
| 96 |
+
| 8192 | 44.4 t/s | 45.4 t/s |
|
| 97 |
+
| 16384 | 37.3 t/s | 36.9 t/s |
|
| 98 |
+
|
| 99 |
+
Decode is comparable between Bridge and Swift — both paths hit ~61 tok/s at short context and degrade gracefully to ~37 tok/s at 16K.
|
| 100 |
+
|
| 101 |
+
## TurboQuant KV Cache Compression
|
| 102 |
+
|
| 103 |
+
turbo4v2 provides **5.3x KV compression** (81% memory saved) with no measurable quality or prefill speed penalty. Stacks on top of Config-I weight compression.
|
| 104 |
+
|
| 105 |
+
| Context | bf16 KV | turbo4v2 KV | Saved |
|
| 106 |
+
|---------|---------|-------------|-------|
|
| 107 |
+
| 8K | 7.9 GB | 1.5 GB | 6.4 GB |
|
| 108 |
+
| 16K | 15.8 GB | 3.0 GB | 12.8 GB |
|
| 109 |
+
| 32K | 31.6 GB | 6.0 GB | 25.6 GB |
|
| 110 |
+
| 64K | 63.2 GB | 11.9 GB | 51.3 GB |
|
| 111 |
+
| 128K | 126.4 GB | 23.9 GB | 102.5 GB |
|
| 112 |
|
| 113 |
**Max context on 128 GB M5 Max** (87 GB model, ~36 GB free):
|
| 114 |
- bf16 KV: **149K tokens**
|
| 115 |
+
- turbo4v2 KV: **595K tokens** (4x more context)
|
|
|
|
| 116 |
|
| 117 |
+
The full package: Config-I weights (62% smaller) + turbo4v2 KV (81% smaller) + Bridge prefill (5-48% faster). PPL of 4.604 measured with everything stacked — no additional quality penalty.
|
| 118 |
|
| 119 |
## Config-I Policy (MiniMax M2.7 Adaptation)
|
| 120 |
|
|
|
|
| 147 |
|
| 148 |
```bash
|
| 149 |
pip install mlx-lm
|
| 150 |
+
python -m mlx_lm.generate --model thetom-ai/MiniMax-M2.7-ConfigI-MLX --prompt "Hello"
|
| 151 |
```
|
| 152 |
|
| 153 |
```python
|
| 154 |
from mlx_lm import load, generate
|
| 155 |
+
model, tokenizer = load("thetom-ai/MiniMax-M2.7-ConfigI-MLX")
|
| 156 |
print(generate(model, tokenizer, prompt="Hello", max_tokens=256, temp=1.0, top_p=0.95))
|
| 157 |
```
|
| 158 |
|
|
|
|
| 166 |
import MLXLLM
|
| 167 |
|
| 168 |
let container = try await LLMModelFactory.shared.loadContainer(
|
| 169 |
+
configuration: ModelConfiguration(id: "thetom-ai/MiniMax-M2.7-ConfigI-MLX"))
|
| 170 |
|
| 171 |
let result = try await container.generate(
|
| 172 |
input: .init(text: .init(tokens: tokenArray)),
|
|
|
|
| 182 |
swift build -c release
|
| 183 |
|
| 184 |
# Download the model
|
| 185 |
+
hf download thetom-ai/MiniMax-M2.7-ConfigI-MLX --local-dir ~/models/MiniMax-M2.7-ConfigI-MLX
|
| 186 |
|
| 187 |
# Run server
|
| 188 |
.build/release/MLXServer --model ~/models/MiniMax-M2.7-ConfigI-MLX --port 8080
|
|
|
|
| 222 |
|
| 223 |
---
|
| 224 |
|
| 225 |
+
Quantized by [@thetom-ai](https://huggingface.co/thetom-ai) | [GitHub](https://github.com/TheTom) | [X](https://x.com/no_stp_on_snek) | [Sponsor](https://github.com/sponsors/TheTom)
|