Openbmb
Collection
12 items โข Updated
How to use axteam/MiniCPM5-2B-NVFP4 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="axteam/MiniCPM5-2B-NVFP4")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("axteam/MiniCPM5-2B-NVFP4")
model = AutoModelForCausalLM.from_pretrained("axteam/MiniCPM5-2B-NVFP4", device_map="auto")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use axteam/MiniCPM5-2B-NVFP4 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "axteam/MiniCPM5-2B-NVFP4"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "axteam/MiniCPM5-2B-NVFP4",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/axteam/MiniCPM5-2B-NVFP4
How to use axteam/MiniCPM5-2B-NVFP4 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "axteam/MiniCPM5-2B-NVFP4" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "axteam/MiniCPM5-2B-NVFP4",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "axteam/MiniCPM5-2B-NVFP4" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "axteam/MiniCPM5-2B-NVFP4",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use axteam/MiniCPM5-2B-NVFP4 with Docker Model Runner:
docker model run hf.co/axteam/MiniCPM5-2B-NVFP4
4-bit quantization of openbmb/MiniCPM5-2B for vLLM serving. Quantized by axteam.
| Base model | openbmb/MiniCPM5-2B |
| Method | NVFP4 (W4A4, FP4) |
| Format | compressed-tensors nvfp4-pack-quantized |
| Weights / activations | W4A4 โ FP4 (E2M1) weights group 16 + FP8 scale, FP4 activations |
| Architecture | Dense (Llama-architecture) ยท text-only |
| Size on disk | ~2.0 GB |
| Calibration | 256 samples |
| License | Apache-2.0 |
nvfp4-pack-quantized.chat_template identical to the original.Fidelity to the BF16 original on an internal mixed EN/KO set (100 prompts, BF16 greedy answers scored under each build).
| Metric | This model | BF16 original |
|---|---|---|
| Perplexity (lower = closer) | 2.1439 | 1.5988 (+34.1%) |
| Top-1 next-token agreement | 79.1% | 98.9% |
โ ๏ธ Note: noticeable 4-bit degradation here; prefer the 8-bit (FP8 / AWQ INT8) builds.
vllm serve axteam/MiniCPM5-2B-NVFP4
Quantized derivative of openbmb/MiniCPM5-2B (Apache-2.0). Original weights & tokenizer belong to OpenBMB.
openbmb/MiniCPM5-2B ๋ฅผ NVFP4 (W4A4, FP4) ๋ก ์์ํํ ์๋น์ฉ(4-bit) ๋ชจ๋ธ์
๋๋ค. ์์ฑ: axteam.
nvfp4-pack-quantized.vllm serve axteam/MiniCPM5-2B-NVFP4. ๋ผ์ด์ ์ค Apache-2.0(์๋ณธ OpenBMB).Base model
openbmb/MiniCPM5-2B