Instructions to use KikoCis/minimax-m2-expert-prune-heal with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use KikoCis/minimax-m2-expert-prune-heal with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf KikoCis/minimax-m2-expert-prune-heal # Run inference directly in the terminal: llama cli -hf KikoCis/minimax-m2-expert-prune-heal
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf KikoCis/minimax-m2-expert-prune-heal # Run inference directly in the terminal: llama cli -hf KikoCis/minimax-m2-expert-prune-heal
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf KikoCis/minimax-m2-expert-prune-heal # Run inference directly in the terminal: ./llama-cli -hf KikoCis/minimax-m2-expert-prune-heal
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf KikoCis/minimax-m2-expert-prune-heal # Run inference directly in the terminal: ./build/bin/llama-cli -hf KikoCis/minimax-m2-expert-prune-heal
Use Docker
docker model run hf.co/KikoCis/minimax-m2-expert-prune-heal
- LM Studio
- Jan
- Ollama
How to use KikoCis/minimax-m2-expert-prune-heal with Ollama:
ollama run hf.co/KikoCis/minimax-m2-expert-prune-heal
- Unsloth Desktop
- Pi
How to use KikoCis/minimax-m2-expert-prune-heal with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KikoCis/minimax-m2-expert-prune-heal
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "KikoCis/minimax-m2-expert-prune-heal" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use KikoCis/minimax-m2-expert-prune-heal with Docker Model Runner:
docker model run hf.co/KikoCis/minimax-m2-expert-prune-heal
- Lemonade
How to use KikoCis/minimax-m2-expert-prune-heal with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull KikoCis/minimax-m2-expert-prune-heal
Run and chat with the model
lemonade run user.minimax-m2-expert-prune-heal-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use KikoCis/minimax-m2-expert-prune-heal with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KikoCis/minimax-m2-expert-prune-heal
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 KikoCis/minimax-m2-expert-prune-heal
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use KikoCis/minimax-m2-expert-prune-heal with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf KikoCis/minimax-m2-expert-prune-heal
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 "KikoCis/minimax-m2-expert-prune-heal" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
How Small Can a 230B Agent Get? Pruning a MoE Coding Model β the Scaling Curve and the Validity Trap
A field report on compressing a 230B-parameter Mixture-of-Experts coding agent by pruning experts, keeping it a working agent in a real tool-using loop. What we found: a clean sizeβcapability curve, and a memorization trap that only held-out evaluation caught.
TL;DR
We took MiniMax-M2 (230B total, ~10B active, 256 experts/layer, top-8) and tried to make it small enough to run as a local coding agent without it falling apart in a real tool loop. The honest results:
- 96.7% of the weights are experts. Quantization alone can't halve the model; you must remove experts.
- Pruning gives a clean curve, no cliff. Keep 192/256 experts β solves 3/6 of an SWE probe set; keep 160 β 1/6; the full quant β 6/6. Capability degrades smoothly with the expert budget β and this is untrained (pure pruned quant, no memorization).
- At a fixed size, prune beats uniform-extreme-quant. 160 experts at ~2.7-bit (46 GB) resolves where all-256-experts at 1.8-bit (48 GB) resolves nothing. Concentrating the bit budget on fewer experts wins.
- A recovery fine-tune can push higher β but only held-out proves it. The gains must be validated on tasks held out of the recovery data, not the ones inside it.
- Held-out evaluation is non-negotiable. Our most exciting recovery result was memorization β the test task had leaked into the recovery data; only hold-out caught it.
The experts are the model
A per-tensor accounting shows the experts are ~97% of the weights; the entire backbone (all attention, routers, embeddings, norms) is ~3%. So halving the footprint requires removing experts, not just shrinking them. Below a certain bit-width the model needs an importance matrix and starts to fall apart anyway.
Pruning by measured activation
Remove experts at random and the model dies. We ranked experts by measured activation over a code/agentic calibration set (an importance-matrix pass recording, per layer, how often each expert fires) and kept the most-used per layer. The surgery is clean: each expert occupies whole contiguous blocks, so keeping a subset is a slice + a rewrite of the expert-count metadata and the router β survivors keep their original precision, no re-quantization.
A property fell out of the map: experts are used broadly (almost none are dead), so there's no free lunch β every dropped expert costs retained activation mass.
The curve: capability scales smoothly with the expert budget
Evaluated as a real agent β a harness driving the model through a Dockerized repo (read, edit, run tests) on the exact SWE instances the un-pruned model resolves 6/6:
| Experts kept | Size | SWE resolved |
|---|---|---|
| 256 (full) | 78 GB | 6 / 6 |
| 192 | ~55 GB | 3 / 6 |
| 160 | 46 GB | 1 / 6 |
No cliff. Drop a quarter of the experts and you keep half the solving; drop more and it tapers, but the model stays a coherent, acting agent the whole way down β not a babbling wreck. All of this is untrained: pure pruned quant. The resolves are genuine compressed-M2 capability.
Two levers mattered together: more experts, and giving the agent its full context window back (an aggressive context budget we'd inherited from an earlier serving constraint was needlessly starving it).
At a fixed size: prune beats quantize-everything
A fair challenge β why prune at all, why not just quantize every expert lower and keep them all? We tested it. At the same size as the 160-expert prune, a uniform extreme-low-bit quant that keeps all experts stays coherent (restates each task) but is a shallow agent: a few tool calls, almost no edits, resolves none. The 160-expert prune, same size, sustains the loop, edits, and resolves. Spreading too few bits across all experts preserves knowledge but destroys execution precision; concentrating the budget on fewer experts keeps execution.
Pushing past the curve: recovery is possible β but prove it held-out
Can a recovery fine-tune lift the pruned model further? Yes β a recovery pass can restore the decisive editing behavior that pruning alone leaves tentative (a pruned model that explores and understands a bug but won't commit an edit can be brought back to acting). But the size of that gain is exactly what a held-out test exists to check, and where the recovery is applied matters more than how much of it you run. We report the result, not the recipe β and the result only counts held-out.
The validity trap
With recovery applied, the model resolved a real task. Exciting β and wrong to trust. The test task had leaked into the recovery data, so the "resolve" was memorization: with the test tasks held out, that resolve vanished. Only hold-out caught it. The honest, held-out signal is that agentic behavior (persistence, navigation, editing, format) recovers and generalizes, while the last mile of solving is harder to recover and must be proven held-out β never on data the model could have seen.
Reusable takeaways
- For a MoE, the experts are the model β shrink structurally by pruning experts; quantization alone won't get you there.
- Prune by measured activation, per layer β random/uniform pruning throws away load-bearing experts.
- Capability scales smoothly with the expert budget β there's a curve, not a cliff; pick your size/capability point.
- At a fixed budget, prune > spread-the-bits-everywhere β concentrate precision on fewer experts.
- A recovery fine-tune can help β but validate it held-out, and don't trust a tool's defaults for where the recovery lands.
- Validate held-out, or don't believe it β recovery data can smuggle the test answer into training.
A compressed-but-capable agent is reachable β as a point on a smooth curve, not a magic small model, and only if you refuse to trust a number you didn't hold out.