Text Generation
Transformers
Safetensors
llama
minicpm
compressed-tensors
vllm
quantized
fp8
conversational
text-generation-inference
Instructions to use axteam/MiniCPM5-2B-FP8-dynamic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use axteam/MiniCPM5-2B-FP8-dynamic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="axteam/MiniCPM5-2B-FP8-dynamic") 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-FP8-dynamic") model = AutoModelForCausalLM.from_pretrained("axteam/MiniCPM5-2B-FP8-dynamic", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use axteam/MiniCPM5-2B-FP8-dynamic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "axteam/MiniCPM5-2B-FP8-dynamic" # 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-FP8-dynamic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/axteam/MiniCPM5-2B-FP8-dynamic
- SGLang
How to use axteam/MiniCPM5-2B-FP8-dynamic with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "axteam/MiniCPM5-2B-FP8-dynamic" \ --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-FP8-dynamic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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-FP8-dynamic" \ --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-FP8-dynamic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use axteam/MiniCPM5-2B-FP8-dynamic with Docker Model Runner:
docker model run hf.co/axteam/MiniCPM5-2B-FP8-dynamic
|
Download README.md from axteam/MiniCPM5-2B-FP8-dynamic: direct link, hf CLI and curl.
- Browser
- Download file 2.47 kB
-
https://huggingface.co/axteam/MiniCPM5-2B-FP8-dynamic/resolve/main/README.md
- Command line
-
hf download hf://axteam/MiniCPM5-2B-FP8-dynamic/README.md
-
curl -L -o README.md https://huggingface.co/axteam/MiniCPM5-2B-FP8-dynamic/resolve/main/README.md
2.47 kB
| base_model: openbmb/MiniCPM5-2B | |
| base_model_relation: quantized | |
| library_name: transformers | |
| license: apache-2.0 | |
| pipeline_tag: text-generation | |
| tags: | |
| - minicpm | |
| - compressed-tensors | |
| - vllm | |
| - quantized | |
| - fp8 | |
| # MiniCPM5-2B ยท FP8 (dynamic) | |
| 8-bit quantization of [`openbmb/MiniCPM5-2B`](https://huggingface.co/openbmb/MiniCPM5-2B) for **vLLM serving**. Quantized by **axteam**. | |
| | | | | |
| |---|---| | |
| | **Base model** | [`openbmb/MiniCPM5-2B`](https://huggingface.co/openbmb/MiniCPM5-2B) | | |
| | **Method** | FP8 (dynamic) | | |
| | **Format** | compressed-tensors `FP8_DYNAMIC` | | |
| | **Weights / activations** | W8A8 โ FP8 E4M3 weights (per-channel), dynamic per-token FP8 activations | | |
| | **Architecture** | Dense (Llama-architecture) ยท text-only | | |
| | **Size on disk** | ~2.8 GB | | |
| | **Calibration** | None (data-free) | | |
| | **License** | Apache-2.0 | | |
| ## Quantization details | |
| - **Scheme** โ W8A8 โ FP8 E4M3 weights (per-channel), dynamic per-token FP8 activations, stored as compressed-tensors `FP8_DYNAMIC`. | |
| - **Kept in BF16** โ token embeddings, the LM head, and all RMSNorms (a small fraction of parameters). | |
| - Post-training quantization (no retraining). Tokenizer / `chat_template` identical to the original. | |
| ## Evaluation (measured) | |
| 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) | 1.6494 | 1.5988 (**+3.2%**) | | |
| | Top-1 next-token agreement | 92.9% | 98.9% | | |
| ## Usage (vLLM) | |
| ```bash | |
| vllm serve axteam/MiniCPM5-2B-FP8-dynamic | |
| ``` | |
| ## License | |
| Quantized derivative of [`openbmb/MiniCPM5-2B`](https://huggingface.co/openbmb/MiniCPM5-2B) (Apache-2.0). Original weights & tokenizer belong to OpenBMB. | |
| --- | |
| ## ํ๊ตญ์ด ์์ฝ | |
| [`openbmb/MiniCPM5-2B`](https://huggingface.co/openbmb/MiniCPM5-2B) ๋ฅผ **FP8 (dynamic)** ๋ก ์์ํํ ์๋น์ฉ(8-bit) ๋ชจ๋ธ์ ๋๋ค. ์์ฑ: **axteam**. | |
| - **๋ฐฉ์** โ FP8 E4M3, ๊ฐ์ค์น ์ฑ๋๋ณ ์ค์ผ์ผ(์ ์ ยท๋ณด์ ๋ถํ์), ํ์ฑํ ๋์ FP8. ํ์ compressed-tensors `FP8_DYNAMIC`. | |
| - **BF16 ์ ์ง** โ ํ ํฐ ์๋ฒ ๋ฉยทLM ํค๋ยท๋ชจ๋ norm. | |
| - PTQ(์ฌํ์ต ์์), ํ ํฌ๋์ด์ ยทchat_template ์๋ณธ ๋์ผ. | |
| - **ํ์ง(์ค์ธก)** โ BF16 ๋๋น perplexity 1.6494(์๋ณธ 1.5988, **+3.2%**), top-1 92.9%(์๋ณธ 98.9%). ๋ด๋ถ ์/ํ 100๋ฌธํญ. | |
| - **์ฌ์ฉ** โ `vllm serve axteam/MiniCPM5-2B-FP8-dynamic`. ๋ผ์ด์ ์ค Apache-2.0(์๋ณธ OpenBMB). | |