Run this model with HF Jobs

Run lee-loo/MiniCPM5-2B-MLX-bf16 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/lee-loo/MiniCPM5-2B-MLX-bf16. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/lee-loo/MiniCPM5-2B-MLX-bf16 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/lee-loo/MiniCPM5-2B-MLX-bf16. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/lee-loo/MiniCPM5-2B-MLX-bf16. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
How to use from the
Use from the
MLX library
# 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("lee-loo/MiniCPM5-2B-MLX-bf16")

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)

MiniCPM5-2B MLX BF16

BF16 MLX conversion of openbmb/MiniCPM5-2B.

This conversion preserves BF16 precision and performs no quantization.

Why?

At the time the official MLX version was only 4 bit quant.

Conversion

Converted from the official OpenBMB checkpoint using mlx-lm 0.31.3:

mlx_lm.convert \
  --hf-path openbmb/MiniCPM5-2B \
  --mlx-path MiniCPM5-2B-MLX-bf16 \
  --dtype bfloat16

Precision verification

All tensors in the converted safetensors files were verified as BF16:

Counter({'mlx.core.bfloat16': 381})

Tested hardware

Apple M4 Max with 128 GB unified memory.

Observed with mlx_lm.generate:

  • Peak memory: approximately 5.1 GB
  • Decode: approximately 96 tokens/sec
  • Prefill: approximately 2300 tokens/sec on a short test
  • MLX-LM: 0.31.3

Performance varies with prompt length, generation settings, and hardware.

Usage

mlx_lm.generate \
  --model MiniCPM5-2B-MLX-bf16 \
  --prompt "explain in two sentences quantum physics" \
  --max-tokens 512

MiniCPM5-2B supports thinking/reasoning output. For interactive or low-latency workloads, generation settings should be chosen according to the intended use case.

Original model

Architecture, training details, benchmarks, limitations, license information, and citation are available from the original model:

openbmb/MiniCPM5-2B

https://huggingface.co/openbmb/MiniCPM5-2B

Conversion provenance

OpenBMB official MiniCPM5-2B BF16 weights => mlx-lm 0.31.3 => MLX BF16 weights no quantization

Downloads last month
35
Safetensors
Model size
3B params
Tensor type
BF16
ยท
MLX
Hardware compatibility
Log In to add your hardware

Quantized

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for lee-loo/MiniCPM5-2B-MLX-bf16

Finetuned
(95)
this model