--- 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 ---

MiniCPM5-1B-Claude-Opus-Fable5-V2-Thinking

# 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)