Instructions to use junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4 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("junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4") 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 junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4"
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": "junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4 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 "junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4"
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 junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4
Run Hermes
hermes
- OpenClaw new
How to use junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4"
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 "junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4" \ --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"
- MLX LM
How to use junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4", "messages": [ {"role": "user", "content": "Hello"} ] }'
Motif-2-12.7B-Reasoning — MLX 4-bit
4-bit MLX conversion of Motif-Technologies/Motif-2-12.7B-Reasoning for Apple Silicon, produced by mlx-motif — the MLX port of Motif's Grouped Differential Attention + PolyNorm architecture, with custom Metal kernels for the differential-attention decode path.
Neither architecture primitive ships in mlx-lm, so this checkpoint requires mlx-motif (it registers the model class into mlx-lm's loader); it will not load with stock mlx_lm.load.
Usage
git clone https://github.com/junhoyeo/mlx-motif && cd mlx-motif
uv pip install -e .
mlx-motif generate --model <this-repo> --prompt "Hello, world."
mlx-motif serve --model <this-repo> --port 8080 # OpenAI-compatible
from mlx_lm import generate
from mlx_motif import load
model, tokenizer = load("<this-repo>")
print(generate(model, tokenizer, prompt="…", max_tokens=128))
Conversion provenance
- Converter:
mlx-motif convert --hf-path Motif-Technologies/Motif-2-12.7B-Reasoning --out … --quantize --bits 4(group_size 64, uniform preset) - mlx-motif: github.com/junhoyeo/mlx-motif @
e6c401a(converted with this repo'sconvert.py; validated at this commit) - mlx version: 0.31.2
Validation (measured on Apple M1 Max, 64 GB)
- Perplexity: 12.365 (nll/token 2.5149, 592 tokens,
scripts/perplexity.py --chunk 512). - Kernel-path parity: greedy output on this checkpoint is byte-identical between mlx-motif's custom Metal kernels and its pure-MLX reference path (32/48/96-token checks on real weights). Parity against the HF PyTorch reference is verified at bf16, not at q4 — 4-bit quality is characterized by the perplexity above instead.
- Decode throughput (July 2026,
bench_decode_e2e.py, median of 5 runs,max_tokens=64, default configuration):
| Prompt length | tok/s |
|---|---|
| 5 | 40.9 |
| 164 | 40.0 |
| 800 | 38.2 |
| 3204 | 30.7 |
Notes & limitations
- Motif's chat template pre-opens a
<think>reasoning block;mlx-motif serve --think-mode visible|hidden|capturedcontrols how the trace is surfaced. - Kernel constants are tuned on M1 Max; other M-series chips work but have not been performance-validated.
- Quantization: uniform 4-bit, group size 64. Mixed-precision presets are available in the converter if you want a different quality/size point.
License & attribution
The model weights are derivative of Motif Technologies' release and remain under Apache 2.0, © Motif Technologies. The conversion tooling is MIT (mlx-motif). If you use this model, please attribute the original model card.
- Downloads last month
- 243
4-bit
Model tree for junhoyeo/Motif-2-12.7B-Reasoning-MLX-q4
Base model
Motif-Technologies/Motif-2-12.7B-Base