Instructions to use openbmb/MiniCPM-MoE-8x2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM-MoE-8x2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM-MoE-8x2B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM-MoE-8x2B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM-MoE-8x2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM-MoE-8x2B" # 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/MiniCPM-MoE-8x2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM-MoE-8x2B
- SGLang
How to use openbmb/MiniCPM-MoE-8x2B 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/MiniCPM-MoE-8x2B" \ --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/MiniCPM-MoE-8x2B", "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/MiniCPM-MoE-8x2B" \ --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/MiniCPM-MoE-8x2B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/MiniCPM-MoE-8x2B with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM-MoE-8x2B
Improve model card
#4
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Introduction
|
| 2 |
|
| 3 |
[OpenBMB Technical Blog Series](https://openbmb.vercel.app/)
|
| 4 |
|
| 5 |
-
The MiniCPM-MoE-8x2B is a decoder-only transformer-based generative language model.
|
| 6 |
|
| 7 |
The MiniCPM-MoE-8x2B adopt a Mixture-of-Experts(MoE) architecture, which has 8 experts per layer and activates 2 of 8 experts for each token.
|
| 8 |
|
|
@@ -30,5 +36,4 @@ print(responds)
|
|
| 30 |
1. As a language model, MiniCPM-MoE-8x2B generates content by learning from a vast amount of text.
|
| 31 |
2. However, it does not possess the ability to comprehend or express personal opinions or value judgments.
|
| 32 |
3. Any content generated by MiniCPM-MoE-8x2B does not represent the viewpoints or positions of the model developers.
|
| 33 |
-
4. Therefore, when using content generated by MiniCPM-MoE-8x2B, users should take full responsibility for evaluating and verifying it on their own.
|
| 34 |
-
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
# Introduction
|
| 8 |
|
| 9 |
[OpenBMB Technical Blog Series](https://openbmb.vercel.app/)
|
| 10 |
|
| 11 |
+
The MiniCPM-MoE-8x2B is a decoder-only transformer-based generative language model. For more details, please refer to our [github repo](https://github.com/OpenBMB/MiniCPM). Also check out the [project page](https://openbmb.vercel.app/?category=Chinese+Blog). The model is described in the paper [MiniCPM4: Ultra-Efficient LLMs on End Devices](https://huggingface.co/papers/2506.07900).
|
| 12 |
|
| 13 |
The MiniCPM-MoE-8x2B adopt a Mixture-of-Experts(MoE) architecture, which has 8 experts per layer and activates 2 of 8 experts for each token.
|
| 14 |
|
|
|
|
| 36 |
1. As a language model, MiniCPM-MoE-8x2B generates content by learning from a vast amount of text.
|
| 37 |
2. However, it does not possess the ability to comprehend or express personal opinions or value judgments.
|
| 38 |
3. Any content generated by MiniCPM-MoE-8x2B does not represent the viewpoints or positions of the model developers.
|
| 39 |
+
4. Therefore, when using content generated by MiniCPM-MoE-8x2B, users should take full responsibility for evaluating and verifying it on their own.
|
|
|