Instructions to use numen-tech/MiniCPM5-2B-4bit-NQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use numen-tech/MiniCPM5-2B-4bit-NQ 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("numen-tech/MiniCPM5-2B-4bit-NQ") 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 numen-tech/MiniCPM5-2B-4bit-NQ with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "numen-tech/MiniCPM5-2B-4bit-NQ"
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": "numen-tech/MiniCPM5-2B-4bit-NQ" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use numen-tech/MiniCPM5-2B-4bit-NQ with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "numen-tech/MiniCPM5-2B-4bit-NQ"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "numen-tech/MiniCPM5-2B-4bit-NQ" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "numen-tech/MiniCPM5-2B-4bit-NQ", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use numen-tech/MiniCPM5-2B-4bit-NQ 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 "numen-tech/MiniCPM5-2B-4bit-NQ"
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 numen-tech/MiniCPM5-2B-4bit-NQ
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use numen-tech/MiniCPM5-2B-4bit-NQ with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "numen-tech/MiniCPM5-2B-4bit-NQ"
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 "numen-tech/MiniCPM5-2B-4bit-NQ" \ --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"
MiniCPM5-2B-4bit-NQ
Numen Quant (NQ) 4-bit build of openbmb/MiniCPM5-2B, quantized for Apple silicon with MLX.
Modifications
This model is a modified version of openbmb/MiniCPM5-2B: its weights have been modified and quantized to 4-bit (group size 64) by Numen. The architecture, tokenizer and chat template are unchanged. Distributed under the Apache License 2.0 (see LICENSE), as is the original.
Use with mlx
pip install -U mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("numen-tech/MiniCPM5-2B-4bit-NQ")
messages = [{"role": "user", "content": "Hello"}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
print(generate(model, tokenizer, prompt=prompt, verbose=True))
Evaluation
| model | wino | boolq | arc-c | arc-e | hella | obqa | piqa | siqa | mean |
|---|---|---|---|---|---|---|---|---|---|
| BF16 (original) | 61.3 | 82.4 | 43.9 | 72.6 | 59.5 | 36.2 | 72.9 | 44.2 | 59.12 |
| MLX affine 4-bit | 60.2 | 81.7 | 42.2 | 69.1 | 57.6 | 34.8 | 71.4 | 43.0 | 57.50 |
| NQ 4-bit | 61.4 | 82.5 | 42.7 | 70.2 | 57.6 | 37.0 | 72.4 | 43.9 | 58.47 |
Zero-shot, lm-evaluation-harness 0.4.13 via mlx_lm.evaluate; acc_norm where the task defines it, acc otherwise. Single run per model; per-task standard errors are 0.5–2.2 points. MLX affine 4-bit is mlx_lm.convert -q --q-bits 4 --q-group-size 64 from the same checkpoint.
- Downloads last month
- 40
4-bit
Model tree for numen-tech/MiniCPM5-2B-4bit-NQ
Base model
openbmb/MiniCPM5-2B