Text Generation
Transformers
Safetensors
English
Chinese
llama
minicpm
minicpm5
long-context
tool-calling
on-device
edge-ai
conversational
text-generation-inference
Instructions to use openbmb/MiniCPM5-1B-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM5-1B-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM5-1B-SFT") 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("openbmb/MiniCPM5-1B-SFT") model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM5-1B-SFT", 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 openbmb/MiniCPM5-1B-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM5-1B-SFT" # 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/MiniCPM5-1B-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM5-1B-SFT
- SGLang
How to use openbmb/MiniCPM5-1B-SFT 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/MiniCPM5-1B-SFT" \ --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/MiniCPM5-1B-SFT", "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/MiniCPM5-1B-SFT" \ --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/MiniCPM5-1B-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/MiniCPM5-1B-SFT with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM5-1B-SFT
Commit History
-
Update README-cn.md
Verified signaturea60b37f -
Update README.md
Verified signaturea5ce20c -
Update README-cn.md
Verified signaturece6a9a2 -
Update README.md
Verified signature8c13230 -
Update README-cn.md
Verified signaturef9156b6 -
Update README.md
Verified signature60e8634 -
Update README-cn.md
Verified signatureb779954 -
Update README.md
Verified signaturea0dfd7d
-
Remove duplicate SFT weights
Co-authored-by: Cursor <cursoragent@cursor.com>fb06dfd -
update README
06a2ec5
-
Update Chinese model card (README-cn.md)
Verified signatureeda4571 -
Update model card README
Verified signaturea9e5c70 -
Delete .ms_upload_cache
Verified signatureac97caa -
Update Chinese model card (README-cn.md)
Verified signature179ed46 -
Update model card README
Verified signature3493237 -
Update Chinese model card (README-cn.md)
Verified signature4101abb -
Update model card README
Verified signatureb214468 -
Update Chinese model card (README-cn.md)
Verified signatureba622fd -
Update model card README
Verified signature12b55a3 -
Update Chinese model card (README-cn.md)
Verified signature6b3a1b3 -
Update model card README
Verified signature347071b -
Add Chinese model card (README-cn.md)
Verified signaturecdda4d5 -
Add model card README
Verified signature991e54b -
Fix config _name_or_path to openbmb/MiniCPM5-1B-SFT
Verified signature3bdaac5
-
Bump transformers_version to 5.6.2
Verified signature873b7e8 -
Bump transformers_version to 5.6.2
Verified signatureab8e37c -
init commit
e9b7901
-
initial commit
Verified signature50c39e3