Instructions to use mlx-community/Nex-N2.5-mini-oQ4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Nex-N2.5-mini-oQ4 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/Nex-N2.5-mini-oQ4") 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 mlx-community/Nex-N2.5-mini-oQ4 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/Nex-N2.5-mini-oQ4"
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": "mlx-community/Nex-N2.5-mini-oQ4" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use mlx-community/Nex-N2.5-mini-oQ4 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/Nex-N2.5-mini-oQ4"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/Nex-N2.5-mini-oQ4" # 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/Nex-N2.5-mini-oQ4", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use mlx-community/Nex-N2.5-mini-oQ4 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/Nex-N2.5-mini-oQ4"
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/Nex-N2.5-mini-oQ4
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use mlx-community/Nex-N2.5-mini-oQ4 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/Nex-N2.5-mini-oQ4"
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 "mlx-community/Nex-N2.5-mini-oQ4" \ --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"
Nex-N2.5-mini oQ4 (MLX)
oQ4 (streaming) MLX conversion of nex-agi/Nex-N2.5-mini, a 35B-parameter Mixture-of-Exerts (MoE) agentic model with 3B active parameters.
Upstream model: Nex-N2.5-mini by Nex-AGI (Shanghai Innovation Institute), released under Apache 2.0.
Conversion: Quantized to MLX format using Hermes Agent with oMLX (streaming oQ4). Sensitivity-driven mixed-precision with per-layer bit allocation.
Architecture
| Property | Value |
|---|---|
| Type | Qwen3.5 MoE (Hybrid Attention) |
| Total params | 35B |
| Active params | 3B (8 routed + 1 shared expert) |
| Layers | 40 |
| Experts | 256 |
| Context length | 262K tokens |
| Hidden size | 2048 |
Quickstart
pip install -U mlx-lm
# Generate
python3 -m mlx_lm.generate \
--model hermitdave/Nex-N2.5-mini-oQ4 \
--prompt "Explain why long-context evaluation is difficult." \
--max-tokens 512 --temp 1.0 --top-p 0.95
# Chat (with reasoning)
python3 -m mlx_lm.chat --model hermitdave/Nex-N2.5-mini-oQ4
Via OpenAI-compatible server
omlx serve hermitdave/Nex-N2.5-mini-oQ4 --port 8000
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
response = client.chat.completions.create(
model="hermitdave/Nex-N2.5-mini-oQ4",
messages=[{"role": "user", "content": "Explain quantum entanglement."}],
extra_body={"chat_template_kwargs": {"reasoning_effort": "high"}},
)
print("Reasoning:", getattr(response.choices[0].message, "reasoning_content", None))
print("Answer:", response.choices[0].message.content)
Reasoning Modes
Use reasoning_effort to control thinking behavior:
reasoning_effort |
Mode | Behavior |
|---|---|---|
"none" |
Non-thinking | Respond directly without reasoning trace |
"medium" (default) |
Adaptive thinking | Model decides whether/how much to think |
"high" |
Thinking | Always enable thinking before responding |
Conversion Details
- Method: oQ4 (streaming) via oMLX
- Bits-per-weight: ~4.6 (mixed precision, sensitivity-driven)
- Router protection: MoE router gates preserved at 8-bit
- lm_head: 8-bit
- Output size: 19 GB (27% of bf16 source)
- Validated: ✅ Smoke test passed (coherent generation, EOS functional)
Performance
Upstream Benchmarks (Nex-N2.5-mini, bf16)
| Benchmark | Score |
|---|---|
| Terminal-Bench 2.1 | 73.4 |
| SWE-Bench Pro | 43.8 |
| AutomationBench v1.0.6 | 32.3 |
| Toolathlon Verified | 54.6 |
| BrowseComp | 83.4 |
| OSWorld-Verified | 71.2 |
| WebArena-Verified | 63.4 |
See Nex-N2.5 announcement for full evaluation details.
Deployment
- Minimum RAM: 24 GB (for 19 GB model + inference overhead)
- Recommended: Apple Silicon M1 Max or better
- Context: 262K tokens native, extensible to 1M
Known Limitations
- MTP disabled: Source config claims MTP (
mtp_num_hidden_layers: 1) but checkpoint has nomtp.*weights — speculative decoding via MTP unavailable - Hybrid attention: Fine generation speed, slower long-context prefill (recurrent state layers)
License
Apache 2.0 (same as upstream). See Nex-N2.5 license.
- Downloads last month
- -
4-bit
Model tree for mlx-community/Nex-N2.5-mini-oQ4
Base model
nex-agi/Nex-N2.5-mini