Instructions to use openbmb/MiniCPM3-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM3-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM3-4B", 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/MiniCPM3-4B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use openbmb/MiniCPM3-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM3-4B" # 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/MiniCPM3-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM3-4B
- SGLang
How to use openbmb/MiniCPM3-4B 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/MiniCPM3-4B" \ --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/MiniCPM3-4B", "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/MiniCPM3-4B" \ --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/MiniCPM3-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/MiniCPM3-4B with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM3-4B
Add link to paper
#43 opened 11 months ago
by
nielsr
Safetensors converted is here --> Goekdeniz-Guelmez/OpenBNB-MiniCPM3-4b
#42 opened about 1 year ago
by
Goekdeniz-Guelmez
Adding `safetensors` variant of this model
#41 opened about 1 year ago
by
SFconvertbot
Remove torch.fx guard for pytorch < 1.13
#39 opened over 1 year ago
by
tms-jr
关于 onnx 版本模型
#37 opened over 1 year ago
by
a20185
llamafied version
#36 opened over 1 year ago
by
KnutJaegersberg
Make it fully free software LLM, with free usage of weights
#35 opened over 1 year ago
by
JLouisBiz
Adding `safetensors` variant of this model
#34 opened over 1 year ago
by
SFconvertbot
Add bos token or not?
#33 opened over 1 year ago
by
CISCai
Adding `safetensors` variant of this model
#32 opened over 1 year ago
by
SFconvertbot
About cooldown
#31 opened over 1 year ago
by
ldwang
Adding `safetensors` variant of this model
#30 opened over 1 year ago
by
SFconvertbot
Adding `safetensors` variant of this model
#28 opened over 1 year ago
by
SFconvertbot
Adding `safetensors` variant of this model
#26 opened over 1 year ago
by
SFconvertbot
vllm error: Hermes 2 Pro Tool parser could not locate tool call start/end tokens in the tokenizer!
#25 opened over 1 year ago
by
mengxuanting
Adding `safetensors` variant of this model
#23 opened over 1 year ago
by
SFconvertbot
Add stream output support
1
#21 opened over 1 year ago
by
JamePeng2023
Run on CPU
👍 3
1
#13 opened over 1 year ago
by
J22
Speed slower than Qwen7B
#4 opened over 1 year ago
by
MonolithFoundation
V100上无法直接推理
1
#3 opened over 1 year ago
by
MonolithFoundation
这个有官方支持在ollama上部署的吗?
🚀 1
2
#2 opened over 1 year ago
by
zhaoyang0618
Adding `safetensors` variant of this model
#1 opened over 1 year ago
by
SFconvertbot