Text Generation
Transformers
Safetensors
English
Chinese
llama
minicpm
minicpm5
long-context
tool-calling
on-device
edge-ai
conversational
text-generation-inference
4-bit precision
Instructions to use openbmb/MiniCPM5-2B-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM5-2B-MLX with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM5-2B-MLX") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("openbmb/MiniCPM5-2B-MLX") model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM5-2B-MLX", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM5-2B-MLX with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM5-2B-MLX" # 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-2B-MLX", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM5-2B-MLX
- SGLang
How to use openbmb/MiniCPM5-2B-MLX 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-2B-MLX" \ --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-2B-MLX", "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-2B-MLX" \ --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-2B-MLX", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/MiniCPM5-2B-MLX with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM5-2B-MLX
docs: update README
Browse files- README-cn.md +1 -1
- README.md +1 -1
README-cn.md
CHANGED
|
@@ -161,7 +161,7 @@ datasets:
|
|
| 161 |
- **[MiniCPM5-2B-MLX](https://huggingface.co/openbmb/MiniCPM5-2B-MLX)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-MLX) · MLX / 4bit,适用于 Apple Silicon **👈 当前页面**
|
| 162 |
- **[MiniCPM5-2B-GPTQ](https://huggingface.co/openbmb/MiniCPM5-2B-GPTQ)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-GPTQ) · GPTQ / 4bit 量化模型
|
| 163 |
- **[MiniCPM5-2B-DSpark](https://huggingface.co/openbmb/MiniCPM5-2B-DSpark)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-DSpark) · DSpark 草稿模型,用于推理加速
|
| 164 |
-
- **[MiniCPM5-2B-DSpark-GGUF](https://huggingface.co/openbmb/MiniCPM5-2B-DSpark-GGUF)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-DSpark-GGUF) · GGUF 版本的 DSpark 草稿模型
|
| 165 |
- **[MiniCPM5-2B-LiteRT](https://huggingface.co/litert-community/MiniCPM5-2B)** · [ModelScope](https://www.modelscope.cn/models/litert-community/MiniCPM5-2B) · MiniCPM5-2B 的 LiteRT-LM 版本
|
| 166 |
|
| 167 |
**MiniCPM5-1B**
|
|
|
|
| 161 |
- **[MiniCPM5-2B-MLX](https://huggingface.co/openbmb/MiniCPM5-2B-MLX)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-MLX) · MLX / 4bit,适用于 Apple Silicon **👈 当前页面**
|
| 162 |
- **[MiniCPM5-2B-GPTQ](https://huggingface.co/openbmb/MiniCPM5-2B-GPTQ)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-GPTQ) · GPTQ / 4bit 量化模型
|
| 163 |
- **[MiniCPM5-2B-DSpark](https://huggingface.co/openbmb/MiniCPM5-2B-DSpark)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-DSpark) · DSpark 草稿模型,用于推理加速
|
| 164 |
+
- **[MiniCPM5-2B-DSpark-GGUF](https://huggingface.co/openbmb/MiniCPM5-2B-DSpark-GGUF)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-DSpark-GGUF) · GGUF 版本的 DSpark 草稿模型
|
| 165 |
- **[MiniCPM5-2B-LiteRT](https://huggingface.co/litert-community/MiniCPM5-2B)** · [ModelScope](https://www.modelscope.cn/models/litert-community/MiniCPM5-2B) · MiniCPM5-2B 的 LiteRT-LM 版本
|
| 166 |
|
| 167 |
**MiniCPM5-1B**
|
README.md
CHANGED
|
@@ -172,7 +172,7 @@ Use this directory to choose the model format that matches your runtime:
|
|
| 172 |
- **[MiniCPM5-2B-MLX](https://huggingface.co/openbmb/MiniCPM5-2B-MLX)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-MLX) · MLX / 4bit for Apple Silicon **👈 you are here**
|
| 173 |
- **[MiniCPM5-2B-GPTQ](https://huggingface.co/openbmb/MiniCPM5-2B-GPTQ)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-GPTQ) · GPTQ / 4bit quantized model
|
| 174 |
- **[MiniCPM5-2B-DSpark](https://huggingface.co/openbmb/MiniCPM5-2B-DSpark)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-DSpark) · DSpark draft model for inference acceleration
|
| 175 |
-
- **[MiniCPM5-2B-DSpark-GGUF](https://huggingface.co/openbmb/MiniCPM5-2B-DSpark-GGUF)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-DSpark-GGUF) · GGUF version of DSpark draft model
|
| 176 |
- **[MiniCPM5-2B-LiteRT](https://huggingface.co/litert-community/MiniCPM5-2B)** · [ModelScope](https://www.modelscope.cn/models/litert-community/MiniCPM5-2B) · the LiteRT-LM version of MiniCPM5-2B
|
| 177 |
|
| 178 |
**MiniCPM5-1B**
|
|
|
|
| 172 |
- **[MiniCPM5-2B-MLX](https://huggingface.co/openbmb/MiniCPM5-2B-MLX)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-MLX) · MLX / 4bit for Apple Silicon **👈 you are here**
|
| 173 |
- **[MiniCPM5-2B-GPTQ](https://huggingface.co/openbmb/MiniCPM5-2B-GPTQ)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-GPTQ) · GPTQ / 4bit quantized model
|
| 174 |
- **[MiniCPM5-2B-DSpark](https://huggingface.co/openbmb/MiniCPM5-2B-DSpark)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-DSpark) · DSpark draft model for inference acceleration
|
| 175 |
+
- **[MiniCPM5-2B-DSpark-GGUF](https://huggingface.co/openbmb/MiniCPM5-2B-DSpark-GGUF)** · [ModelScope](https://www.modelscope.cn/models/OpenBMB/MiniCPM5-2B-DSpark-GGUF) · GGUF version of DSpark draft model
|
| 176 |
- **[MiniCPM5-2B-LiteRT](https://huggingface.co/litert-community/MiniCPM5-2B)** · [ModelScope](https://www.modelscope.cn/models/litert-community/MiniCPM5-2B) · the LiteRT-LM version of MiniCPM5-2B
|
| 177 |
|
| 178 |
**MiniCPM5-1B**
|