Text Generation
Transformers
Safetensors
English
Chinese
llama
minicpm
minicpm5
thinking
fable5
tool-calling
function-calling
coding
instruction-following
conversational
text-generation-inference
Instructions to use GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking") model = AutoModelForCausalLM.from_pretrained("GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking") 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 GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking
- SGLang
How to use GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking 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 "GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking" \ --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": "GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking", "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 "GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking" \ --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": "GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking with Docker Model Runner:
docker model run hf.co/GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking
File size: 4,314 Bytes
ae62103 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | ---
library_name: transformers
license: apache-2.0
language:
- en
- zh
base_model: openbmb/MiniCPM5-1B
base_model_relation: finetune
pipeline_tag: text-generation
tags:
- minicpm
- minicpm5
- thinking
- fable5
- tool-calling
- function-calling
- coding
- instruction-following
---
<p align="center">
<img src="assets/banner.png" alt="MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking" width="100%"/>
</p>
# MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking
GGUF 量化版:**[MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking-GGUF](https://huggingface.co/GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking-GGUF)**
[English README](./README.md)
**MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking** 是基于 [openbmb/MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B) 的 1B **Thinking** 语言模型。相对 V1,本 V2 版本在 **Fable 5** 数据上进一步微调,重点增强了 **工具调用(Tool Calling / Function Calling)**,同时继续提升 **Coding** 与 **指令遵循**,并保留 MiniCPM5 原生 Thinking 对话模板与 XML 工具调用格式。
上一版本:**[MiniCPM5-1B-Claude-Opus-Fable5-Thinking](https://huggingface.co/GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-Thinking)**(V1)
llama.cpp / Ollama / LM Studio 部署请参阅 **[GGUF 仓库](https://huggingface.co/GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking-GGUF)**。
---
## 模型概述
| 项目 | 说明 |
|---|---|
| **基座模型** | [openbmb/MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B)(1B 稠密 Llama 架构) |
| **后训练数据** | Fable 5 traces(V2) |
| **主要提升(相对 V1 / 基座)** | 更强的 **工具调用**,以及更好的 Coding 与指令遵循 |
| **对话格式** | MiniCPM5 原生 Thinking 模板,支持可选的思维链推理块 |
| **上下文长度** | **128K**(`max_position_embeddings = 131072`) |
| **部署特点** | 单卡友好,适合边缘 / 本地场景 |
---
## 能力
- **工具调用(V2 增强)** — 在 MiniCPM5 原生 XML / Function Calling 格式上更稳定可靠
- **Coding** — 代码生成、调试及软件工程类任务
- **Instruction Following** — 更稳定地遵循用户提示与结构化任务约束
- **Thinking 模式** — 通过 MiniCPM5 对话模板进行思维链推理
- **长上下文** — 最高 **128K tokens**(`config.json` 中为 131,072)
---
## Benchmark
### BFCL + API-Bank
| 模型 | BFCL non_live | BFCL live | API-Bank |
|---|---|---|---|
| MiniCPM5-1B(基座) | 41.51% | 60.24% | 7.30% |
| MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking | 43.06% | 63.33% | 22.10% |
### Tau-Bench
| 域 | MiniCPM5-1B(基座) | MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking |
|---|---|---|
| Airline | 0.34 (17/50) | 0.36 (18/50) |
| Retail | 0.052 (6/115) | 0.070 (8/115) |
---
## 快速开始
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "GnLOLot/MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id, trust_remote_code=True,
torch_dtype=torch.bfloat16, device_map="auto",
)
messages = [{"role": "user", "content": "写一个 Python 函数,合并两个有序链表。"}]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
```
---
## 采样建议
生成参数继承自 **[MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B)**:
| 模式 | 参数 |
|---|---|
| **Think**(默认) | `temperature=0.9, top_p=0.95` |
| **No Think** | `temperature=0.7, top_p=0.95`,`enable_thinking=False` |
---
## 局限性
- **Thinking 输出** — 模型可能在最终回答前输出推理块;下游应用可在展示前将其剥离
- **1B 体量** — 面向轻量本地部署,非前沿规模通用推理模型
---
## 许可与致谢
- 许可证:**Apache-2.0**(继承自 MiniCPM5-1B)
- 基座:[OpenBMB / MiniCPM5-1B](https://huggingface.co/openbmb/MiniCPM5-1B)
- GGUF:[llama.cpp](https://github.com/ggml-org/llama.cpp)
|