openbmb/Ultra-FineWeb
Viewer • Updated • 1.29B • 111k • 437
How to use randmaru/MiniCPM5-2B-mlx-mxfp4 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("randmaru/MiniCPM5-2B-mlx-mxfp4")
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)How to use randmaru/MiniCPM5-2B-mlx-mxfp4 with Pi:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "randmaru/MiniCPM5-2B-mlx-mxfp4"
# 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": "randmaru/MiniCPM5-2B-mlx-mxfp4"
}
]
}
}
}# Start Pi in your project directory: pi
How to use randmaru/MiniCPM5-2B-mlx-mxfp4 with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "randmaru/MiniCPM5-2B-mlx-mxfp4"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "randmaru/MiniCPM5-2B-mlx-mxfp4"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "randmaru/MiniCPM5-2B-mlx-mxfp4",
"messages": [
{"role": "user", "content": "Hello"}
]
}'How to use randmaru/MiniCPM5-2B-mlx-mxfp4 with Hermes Agent:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "randmaru/MiniCPM5-2B-mlx-mxfp4"
# 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 randmaru/MiniCPM5-2B-mlx-mxfp4
hermes
How to use randmaru/MiniCPM5-2B-mlx-mxfp4 with OpenClaw:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "randmaru/MiniCPM5-2B-mlx-mxfp4"
# 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 "randmaru/MiniCPM5-2B-mlx-mxfp4" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
openclaw agent --local --agent main --message "Hello from Hugging Face"
This is an MXFP4 MLX quantization of openbmb/MiniCPM5-2B for Apple Silicon inference.
MXFP4 vs 4Bit Quantization Comparison
| Parameter | MXFP4 |
4Bit |
|---|---|---|
| Quantization format | 4‑bit floating point with microscaling, group 32, shared exponent E8M0 | 4‑bit integer (INT4/NF4) |
| Tensor types | U8, U32, BF16 | BF16, U32 |
Parameter size (safetensors) |
~1.34 GB (1,337,358,111 bytes) | ~1.42 GB (1,416,035,480 bytes) |
| Total storage (all files) | ~1.35 GB (1,347,313,381 bytes) | ~1.43 GB (1,426,011,795 bytes) |
| Hardware support | Most efficient on GPUs with microscaling / FP8 tensor core support | Broad support, but often requires specialized INT4 kernels |
| Apple Silicon compatibility | Designed with hardware microscaling support in Apple Neural Engine / GPU | Works, but without specialized Neural Engine optimization |
| Inference speed | Higher on compatible hardware: FP path, lower dequantization overhead, higher throughput | Kernel‑dependent; usually lower or comparable at similar quality |
| Quality | Better preserves dynamic range, less degradation on outliers | Higher risk of accuracy loss on outliers at the same bitrate |
Key takeaways:
safetensors file (~1.34 GB vs ~1.42 GB). This reflects the actual file sizes from the respective repositories; the MXFP4 format with microscaling and floating‑point storage (U8/U32/BF16) results in a more compact representation in this case compared to the integer version (BF16/U32).Actual speed depends on the backend, GPU, batch size, and quantization implementation.
4-bit
Base model
openbmb/MiniCPM5-2B