Instructions to use openbmb/BitCPM-CANN-0.5B-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/BitCPM-CANN-0.5B-gguf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/BitCPM-CANN-0.5B-gguf") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("openbmb/BitCPM-CANN-0.5B-gguf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use openbmb/BitCPM-CANN-0.5B-gguf with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf openbmb/BitCPM-CANN-0.5B-gguf:BF16 # Run inference directly in the terminal: llama cli -hf openbmb/BitCPM-CANN-0.5B-gguf:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf openbmb/BitCPM-CANN-0.5B-gguf:BF16 # Run inference directly in the terminal: llama cli -hf openbmb/BitCPM-CANN-0.5B-gguf:BF16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf openbmb/BitCPM-CANN-0.5B-gguf:BF16 # Run inference directly in the terminal: ./llama-cli -hf openbmb/BitCPM-CANN-0.5B-gguf:BF16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf openbmb/BitCPM-CANN-0.5B-gguf:BF16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf openbmb/BitCPM-CANN-0.5B-gguf:BF16
Use Docker
docker model run hf.co/openbmb/BitCPM-CANN-0.5B-gguf:BF16
- LM Studio
- Jan
- vLLM
How to use openbmb/BitCPM-CANN-0.5B-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/BitCPM-CANN-0.5B-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "openbmb/BitCPM-CANN-0.5B-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/BitCPM-CANN-0.5B-gguf:BF16
- SGLang
How to use openbmb/BitCPM-CANN-0.5B-gguf 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 "openbmb/BitCPM-CANN-0.5B-gguf" \ --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": "openbmb/BitCPM-CANN-0.5B-gguf", "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 "openbmb/BitCPM-CANN-0.5B-gguf" \ --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": "openbmb/BitCPM-CANN-0.5B-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use openbmb/BitCPM-CANN-0.5B-gguf with Ollama:
ollama run hf.co/openbmb/BitCPM-CANN-0.5B-gguf:BF16
- Unsloth Studio
How to use openbmb/BitCPM-CANN-0.5B-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for openbmb/BitCPM-CANN-0.5B-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for openbmb/BitCPM-CANN-0.5B-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for openbmb/BitCPM-CANN-0.5B-gguf to start chatting
- Docker Model Runner
How to use openbmb/BitCPM-CANN-0.5B-gguf with Docker Model Runner:
docker model run hf.co/openbmb/BitCPM-CANN-0.5B-gguf:BF16
- Lemonade
How to use openbmb/BitCPM-CANN-0.5B-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull openbmb/BitCPM-CANN-0.5B-gguf:BF16
Run and chat with the model
lemonade run user.BitCPM-CANN-0.5B-gguf-BF16
List all available models
lemonade list
- Atomic Chat
Update README naming from BitCPM4 to BitCPM
Browse files
README.md
CHANGED
|
@@ -18,14 +18,14 @@ library_name: transformers
|
|
| 18 |
👋 Join us on <a href="https://discord.gg/3cGQn9b3YM" target="_blank">Discord</a> and <a href="https://github.com/OpenBMB/MiniCPM/blob/main/assets/wechat.jpg" target="_blank">WeChat</a>
|
| 19 |
</p>
|
| 20 |
|
| 21 |
-
> **This repository hosts the GGUF (llama.cpp) quantized version of [
|
| 22 |
|
| 23 |
|
| 24 |
## Introduction
|
| 25 |
|
| 26 |
-
|
| 27 |
|
| 28 |
-
We train a family of four models—
|
| 29 |
|
| 30 |
### Key Features
|
| 31 |
|
|
@@ -38,27 +38,27 @@ We train a family of four models—BitCPM4-CANN-0.5B/1B/3B/8B—and evaluate the
|
|
| 38 |
|
| 39 |
> The models in this repository are in **pseudo-quantized (fake quantization) format**. This means the weights are stored in standard floating-point format with ternary values already applied during training. You can load and run inference with these models **exactly the same way as full-precision models**—no special quantization libraries or custom kernels are required.
|
| 40 |
|
| 41 |
-
##
|
| 42 |
|
| 43 |
| Model | HuggingFace | GGUF |
|
| 44 |
|-------|-------------|------|
|
| 45 |
-
|
|
| 46 |
-
|
|
| 47 |
-
|
|
| 48 |
-
|
|
| 49 |
|
| 50 |
## Usage
|
| 51 |
|
| 52 |
### Inference with Transformers
|
| 53 |
|
| 54 |
-
Since
|
| 55 |
|
| 56 |
```python
|
| 57 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 58 |
import torch
|
| 59 |
torch.manual_seed(0)
|
| 60 |
|
| 61 |
-
path = 'openbmb/
|
| 62 |
device = "cuda"
|
| 63 |
tokenizer = AutoTokenizer.from_pretrained(path)
|
| 64 |
model = AutoModelForCausalLM.from_pretrained(path, torch_dtype=torch.bfloat16, device_map=device, trust_remote_code=True)
|
|
@@ -96,7 +96,7 @@ print(responds)
|
|
| 96 |
|
| 97 |
### Main Results
|
| 98 |
|
| 99 |
-
|
| 100 |
|
| 101 |
|
| 102 |
| Task | 8B FP | 8B Ternary | 3B FP | 3B Ternary | 1B FP | 1B Ternary | 0.5B FP | 0.5B Ternary |
|
|
@@ -145,19 +145,19 @@ The system is built as a four-layer vertical stack on Ascend NPU:
|
|
| 145 |
For full technical details, please refer to our [Technical Report](https://github.com/OpenBMB/MiniCPM/blob/main/docs/BitCPM_CANN.pdf).
|
| 146 |
|
| 147 |
## Statement
|
| 148 |
-
- As a language model,
|
| 149 |
- However, it does not possess the ability to comprehend or express personal opinions or value judgments.
|
| 150 |
-
- Any content generated by
|
| 151 |
-
- Therefore, when using content generated by
|
| 152 |
|
| 153 |
## LICENSE
|
| 154 |
-
- This repository and
|
| 155 |
|
| 156 |
## Citation
|
| 157 |
- Please cite our technical report if you find our work valuable.
|
| 158 |
|
| 159 |
```bibtex
|
| 160 |
-
@article{
|
| 161 |
title={{BitCPM-CANN}: Native 1.58-Bit Large Language Model Training on Ascend NPU},
|
| 162 |
author={BitCPM Team},
|
| 163 |
year={2026}
|
|
|
|
| 18 |
👋 Join us on <a href="https://discord.gg/3cGQn9b3YM" target="_blank">Discord</a> and <a href="https://github.com/OpenBMB/MiniCPM/blob/main/assets/wechat.jpg" target="_blank">WeChat</a>
|
| 19 |
</p>
|
| 20 |
|
| 21 |
+
> **This repository hosts the GGUF (llama.cpp) quantized version of [BitCPM-CANN-0.5B](https://huggingface.co/openbmb/BitCPM-CANN-0.5B/).** For the pseudo-quantized weights and the full model card, please refer to [BitCPM-CANN-0.5B](https://huggingface.co/openbmb/BitCPM-CANN-0.5B/).
|
| 22 |
|
| 23 |
|
| 24 |
## Introduction
|
| 25 |
|
| 26 |
+
BitCPM-CANN is the first end-to-end 1.58-bit (ternary) large language model training system natively built on Huawei Ascend NPU. The system integrates quantization-aware training (QAT) into the Megatron-LM framework with MindSpeed acceleration, covering the full training stack from custom ternary operators to distributed parallel training on Ascend 910B.
|
| 27 |
|
| 28 |
+
We train a family of four models—BitCPM-CANN-0.5B/1B/3B/8B—and evaluate them against their full-precision MiniCPM4 counterparts across 11 benchmarks. The 1B/3B/8B models retain **95.7%–97.2%** of full-precision performance, while enabling approximately **6× memory reduction** at inference time. QAT introduces only **5% training throughput overhead** (148 vs. 155 TFLOP/s per NPU).
|
| 29 |
|
| 30 |
### Key Features
|
| 31 |
|
|
|
|
| 38 |
|
| 39 |
> The models in this repository are in **pseudo-quantized (fake quantization) format**. This means the weights are stored in standard floating-point format with ternary values already applied during training. You can load and run inference with these models **exactly the same way as full-precision models**—no special quantization libraries or custom kernels are required.
|
| 40 |
|
| 41 |
+
## BitCPM-CANN Model Family
|
| 42 |
|
| 43 |
| Model | HuggingFace | GGUF |
|
| 44 |
|-------|-------------|------|
|
| 45 |
+
| BitCPM-CANN-0.5B | [openbmb/BitCPM-CANN-0.5B](https://huggingface.co/openbmb/BitCPM-CANN-0.5B) | [openbmb/BitCPM-CANN-0.5B-gguf](https://huggingface.co/openbmb/BitCPM-CANN-0.5B-gguf) |
|
| 46 |
+
| BitCPM-CANN-1B | [openbmb/BitCPM-CANN-1B](https://huggingface.co/openbmb/BitCPM-CANN-1B) | [openbmb/BitCPM-CANN-1B-gguf](https://huggingface.co/openbmb/BitCPM-CANN-1B-gguf) |
|
| 47 |
+
| BitCPM-CANN-3B | [openbmb/BitCPM-CANN-3B](https://huggingface.co/openbmb/BitCPM-CANN-3B) | [openbmb/BitCPM-CANN-3B-gguf](https://huggingface.co/openbmb/BitCPM-CANN-3B-gguf) |
|
| 48 |
+
| BitCPM-CANN-8B | [openbmb/BitCPM-CANN-8B](https://huggingface.co/openbmb/BitCPM-CANN-8B) | [openbmb/BitCPM-CANN-8B-gguf](https://huggingface.co/openbmb/BitCPM-CANN-8B-gguf) |
|
| 49 |
|
| 50 |
## Usage
|
| 51 |
|
| 52 |
### Inference with Transformers
|
| 53 |
|
| 54 |
+
Since BitCPM-CANN models are in pseudo-quantized format, you can use them exactly like standard full-precision models:
|
| 55 |
|
| 56 |
```python
|
| 57 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 58 |
import torch
|
| 59 |
torch.manual_seed(0)
|
| 60 |
|
| 61 |
+
path = 'openbmb/BitCPM-CANN-0.5B'
|
| 62 |
device = "cuda"
|
| 63 |
tokenizer = AutoTokenizer.from_pretrained(path)
|
| 64 |
model = AutoModelForCausalLM.from_pretrained(path, torch_dtype=torch.bfloat16, device_map=device, trust_remote_code=True)
|
|
|
|
| 96 |
|
| 97 |
### Main Results
|
| 98 |
|
| 99 |
+
BitCPM-CANN models are evaluated against their full-precision MiniCPM4 counterparts across 11 benchmarks spanning commonsense reasoning, domain knowledge, and mathematics & reasoning.
|
| 100 |
|
| 101 |
|
| 102 |
| Task | 8B FP | 8B Ternary | 3B FP | 3B Ternary | 1B FP | 1B Ternary | 0.5B FP | 0.5B Ternary |
|
|
|
|
| 145 |
For full technical details, please refer to our [Technical Report](https://github.com/OpenBMB/MiniCPM/blob/main/docs/BitCPM_CANN.pdf).
|
| 146 |
|
| 147 |
## Statement
|
| 148 |
+
- As a language model, BitCPM-CANN generates content by learning from a vast amount of text.
|
| 149 |
- However, it does not possess the ability to comprehend or express personal opinions or value judgments.
|
| 150 |
+
- Any content generated by BitCPM-CANN does not represent the viewpoints or positions of the model developers.
|
| 151 |
+
- Therefore, when using content generated by BitCPM-CANN, users should take full responsibility for evaluating and verifying it on their own.
|
| 152 |
|
| 153 |
## LICENSE
|
| 154 |
+
- This repository and BitCPM-CANN models are released under the [Apache-2.0](https://github.com/OpenBMB/MiniCPM/blob/main/LICENSE) License.
|
| 155 |
|
| 156 |
## Citation
|
| 157 |
- Please cite our technical report if you find our work valuable.
|
| 158 |
|
| 159 |
```bibtex
|
| 160 |
+
@article{bitcpmcann,
|
| 161 |
title={{BitCPM-CANN}: Native 1.58-Bit Large Language Model Training on Ascend NPU},
|
| 162 |
author={BitCPM Team},
|
| 163 |
year={2026}
|