Text Generation
Transformers
Safetensors
English
Chinese
llama
minicpm
minicpm5
long-context
tool-calling
on-device
edge-ai
parallel-constrained-decoding
structured-generation
classification
inference-only
modal
conversational
text-generation-inference
Instructions to use monotykamary/MiniCPM5-2B-PCD with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use monotykamary/MiniCPM5-2B-PCD with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="monotykamary/MiniCPM5-2B-PCD") 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("monotykamary/MiniCPM5-2B-PCD") model = AutoModelForCausalLM.from_pretrained("monotykamary/MiniCPM5-2B-PCD", 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 monotykamary/MiniCPM5-2B-PCD with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "monotykamary/MiniCPM5-2B-PCD" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "monotykamary/MiniCPM5-2B-PCD", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/monotykamary/MiniCPM5-2B-PCD
- SGLang
How to use monotykamary/MiniCPM5-2B-PCD 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 "monotykamary/MiniCPM5-2B-PCD" \ --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": "monotykamary/MiniCPM5-2B-PCD", "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 "monotykamary/MiniCPM5-2B-PCD" \ --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": "monotykamary/MiniCPM5-2B-PCD", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use monotykamary/MiniCPM5-2B-PCD with Docker Model Runner:
docker model run hf.co/monotykamary/MiniCPM5-2B-PCD
Download ARTIFACTS.json from monotykamary/MiniCPM5-2B-PCD: direct link, hf CLI and curl.
- Browser
- Download file 3.32 kB
-
https://huggingface.co/monotykamary/MiniCPM5-2B-PCD/resolve/main/ARTIFACTS.json
- Command line
-
hf download hf://monotykamary/MiniCPM5-2B-PCD/ARTIFACTS.json
-
curl -L -o ARTIFACTS.json https://huggingface.co/monotykamary/MiniCPM5-2B-PCD/resolve/main/ARTIFACTS.json
3.32 kB
| { | |
| "files": { | |
| "requirements-pcd.txt": "3aa238d3352bda6f720b8c48c3f7cbeb6ddad4bac4fe1d94bf27924d077e1d83", | |
| "minicpm5_pcd_modal.py": "db5341e53a3f3e2a2b74ac8cd33928905d501319111b95374f9fb87ddbe0a4ef", | |
| "README-MINICPM5-PCD.md": "aaa3c3b5460d267e651f2b63acda25f21d63bfae05bab6228a49a92a27589499", | |
| "LICENSE-CODE": "6c6d531bb55d1105ce57394979dbc2dc6cdeb0f9f5ef39856489378a71f380b0", | |
| "THIRD_PARTY_NOTICES.md": "0978a32d7a823f89cdbd9496aff154f37195b366a86185a744d9ebbdae96112d", | |
| "ruff.toml": "d5eaf462a77af92f39be2cf5e345936451eb717403a8b380cb918e8b5440fdf1", | |
| "pcd/__init__.py": "691b9d06e8effb0595a1a5c63906624bcdc6b4c2d482f1fc0f674d52439cad72", | |
| "pcd/benchmark.py": "58d035634442a78772919d7b6e857fd9d7f2735e2e8d3f80ded76fbb8b5f50d0", | |
| "pcd/cache.py": "213061dc97d9a3b3315d7063868a12b1ce4dce167ef7d9cdaa84980ae08fb6bb", | |
| "pcd/config.py": "18f6a7fa6b84cbd7c48aeb2e60db1e2cb056a28d0bb406ad3d8e1c02a2c7bbc9", | |
| "pcd/engine.py": "cbfe1c69740300b6fcd11100ea79e05a3d0e155236a0ed830e1c597144e6b63f", | |
| "pcd/minicpm.py": "ae959bd01e465203ce11aeeb235386a4905ad9c7833d0643bad9475f62929f0e", | |
| "pcd/profiles.py": "5371a7f64522ba816e39ec28be1d4ee43206107a0e8326f45f21ec9f99c70d1b", | |
| "pcd/prompting.py": "511bff9d4a06006e02a50ead8afe34fc9eec403880d021cd8f874a72f78e8f4a", | |
| "pcd/publishing.py": "a9a07e4db771533f49cb9b13d74a2520d255d7f05876bec49fa00ddeb963e5bb", | |
| "pcd/schema.py": "b70db7a1d5bb5ce41df485142167a1802711d267a46ef46ccd1cf254baf0ebfd", | |
| "pcd/tasks.py": "b76ca325125fc2d4304d1e395a81e32caa02165c1ad8451e1f5d7a73742db968", | |
| "tests/pcd/conftest.py": "39c365aed040ea13bad97f11998ccaae860a0b2750e57de0d3e11284a6deadd9", | |
| "tests/pcd/test_engine.py": "a059463869bc12f9abbaad3a51b7be741f0905dc54d1174f73189c6e2889e324", | |
| "tests/pcd/test_minicpm.py": "8c01febbd73f50171f47dbad104d495cfa5c29a1584183b0c60a6b461c7e319e", | |
| "tests/pcd/test_release.py": "7b6f82c2e9b702e7d576f4238a9655dcc1b088e467f6ec17a1c015b1217c8a20", | |
| "scripts/build_pcd_release.py": "4ffff3db5d9ce17cf8e6ce8a6af0a245963de9615d956101bcba7a41f7c1c959", | |
| "scripts/report_minicpm_pcd.py": "3359f8332254eafc1e57ea5154af0eef13caec975a126058489be5272aed8fd3", | |
| "scripts/report_pcd.py": "5ceda179cd8715b4504fda93523c4b4037a907c72b2d0c0f04a6536bcc0cc507", | |
| "docs/minicpm5-pcd-results.md": "df7c10ba00ebc3a9c249accd8c8889028f1473e13acad158b072e08d962d2bd8", | |
| "licenses/MiniCPM5-APACHE-2.0.txt": "202d02b14796563546e1a1d1e761410fa9e399bf7e1b85d8b43c972658341202", | |
| "results/minicpm5/20260916-184634-benchmark-diagnostic-403000.json": "2994d2bafc1a1b2dd25478f467652f29a5cbab9ae0d39cc4a5687113e62e4d84", | |
| "results/minicpm5/20260916-184917-benchmark-stress-2cc98a.json": "3a2b85d94f284c46a25f7ba5877a0c539c1a38008777834d3f2ae37675224d7b", | |
| "results/minicpm5/low-precision-validation-failures.json": "f7ec4e2f6f703b6b710609a667770dbe78697aa6bbd754d5f3e4c62b75da5218" | |
| }, | |
| "reports": [ | |
| "results/minicpm5/20260916-184634-benchmark-diagnostic-403000.json", | |
| "results/minicpm5/20260916-184917-benchmark-stress-2cc98a.json" | |
| ], | |
| "supplemental_evidence": [ | |
| "results/minicpm5/low-precision-validation-failures.json" | |
| ], | |
| "core_files": [ | |
| "engine.py", | |
| "cache.py", | |
| "schema.py", | |
| "prompting.py", | |
| "config.py", | |
| "tasks.py", | |
| "profiles.py", | |
| "minicpm.py" | |
| ] | |
| } | |