Text Generation
Transformers
Safetensors
English
Chinese
llama
minicpm
minicpm5
thinking
fable5
tool-calling
function-calling
agentic
coding
instruction-following
conversational
text-generation-inference
Instructions to use GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic") model = AutoModelForCausalLM.from_pretrained("GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic", 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 GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic" # 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-2B-Claude-Fable5-1-Thinking-Agentic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic
- SGLang
How to use GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic 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-2B-Claude-Fable5-1-Thinking-Agentic" \ --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-2B-Claude-Fable5-1-Thinking-Agentic", "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-2B-Claude-Fable5-1-Thinking-Agentic" \ --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-2B-Claude-Fable5-1-Thinking-Agentic", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic with Docker Model Runner:
docker model run hf.co/GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic
|
Download README.md from GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic: direct link, hf CLI and curl.
- Browser
- Download file 5.72 kB
-
https://huggingface.co/GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic/resolve/main/README.md
- Command line
-
hf download hf://GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic/README.md
-
curl -L -o README.md https://huggingface.co/GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic/resolve/main/README.md
5.72 kB
| library_name: transformers | |
| license: apache-2.0 | |
| language: | |
| - en | |
| - zh | |
| base_model: openbmb/MiniCPM5-2B | |
| base_model_relation: finetune | |
| pipeline_tag: text-generation | |
| tags: | |
| - minicpm | |
| - minicpm5 | |
| - llama | |
| - text-generation | |
| - thinking | |
| - fable5 | |
| - tool-calling | |
| - function-calling | |
| - agentic | |
| - coding | |
| - instruction-following | |
| - conversational | |
| <p align="center"> | |
| <img src="assets/banner.png" alt="MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic" width="100%"/> | |
| </p> | |
| # MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic | |
| GGUF quantizations for local deployment: **[MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic-GGUF](https://huggingface.co/GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic-GGUF)** | |
| **MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic** is a compact 2B **Thinking** language model built on [openbmb/MiniCPM5-2B](https://huggingface.co/openbmb/MiniCPM5-2B). Fine-tuned on **Claude** data with a strong focus on **agentic tool calling / function calling**, **coding**, and **instruction following**. It keeps MiniCPM5's native Thinking chat template and XML tool-call format. | |
| For llama.cpp / Ollama / LM Studio deployment, see the **[GGUF repository](https://huggingface.co/GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic-GGUF)**. | |
| --- | |
| ## Overview | |
| | Item | Detail | | |
| |---|---| | |
| | **Base model** | [openbmb/MiniCPM5-2B](https://huggingface.co/openbmb/MiniCPM5-2B) (2B dense Llama architecture) | | |
| | **Post-training** | Claude data | | |
| | **Key capabilities** | **Agentic tool calling**, coding, instruction following, chain-of-thought reasoning | | |
| | **Chat format** | MiniCPM5 native Thinking template with optional chain-of-thought blocks | | |
| | **Context length** | **128K** (`max_position_embeddings = 131072`) | | |
| | **Precision** | bfloat16 | | |
| | **Deployment** | Single-GPU friendly; suitable for edge / local use | | |
| --- | |
| ## Capabilities | |
| - **Agentic tool calling** β reliable XML / function-calling style tool use on top of MiniCPM5's native format, designed for multi-step agentic workflows | |
| - **Coding** β code generation, debugging, and software-engineering-style tasks | |
| - **Instruction following** β reliable adherence to user prompts and structured constraints | |
| - **Thinking mode** β chain-of-thought reasoning via the MiniCPM5 chat template | |
| - **Long context** β up to **128K tokens** (131,072 tokens per `config.json`) | |
| --- | |
| ## Benchmark | |
| ### ClawBench (Agentic Coding) | |
| | Model | QwenClawBench | WildClawBench | | |
| |---|---|---| | |
| | MiniCPM5-2B (Base, RL-only) | 42.11 | 23.19 | | |
| | **MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic** | **44.56** (+2.45) | **24.32** (+1.13) | | |
| > ClawBench evaluates agentic coding ability β the model's capacity to autonomously use tools, navigate codebases, and complete multi-step software engineering tasks. QwenClawBench uses structured coding scenarios; WildClawBench tests on diverse real-world tasks. | |
| > **More benchmarks (BFCL, SWE-bench, Tau-Bench, etc.) coming soon.** | |
| --- | |
| ## Quick start | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| import torch | |
| model_id = "GnLOLot/MiniCPM5-2B-Claude-Fable5-1-Thinking-Agentic" | |
| 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": "Write a Python function to merge two sorted lists."}] | |
| 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)) | |
| ``` | |
| ### Tool calling example | |
| ```python | |
| tools = [ | |
| { | |
| "type": "function", | |
| "function": { | |
| "name": "get_weather", | |
| "description": "Get the current weather for a given city.", | |
| "parameters": { | |
| "type": "object", | |
| "properties": { | |
| "city": {"type": "string", "description": "City name"} | |
| }, | |
| "required": ["city"] | |
| } | |
| } | |
| } | |
| ] | |
| messages = [ | |
| {"role": "user", "content": "What's the weather like in Beijing?"} | |
| ] | |
| text = tokenizer.apply_chat_template( | |
| messages, tools=tools, tokenize=False, add_generation_prompt=True | |
| ) | |
| inputs = tokenizer(text, return_tensors="pt").to(model.device) | |
| outputs = model.generate(**inputs, max_new_tokens=256, do_sample=False) | |
| print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)) | |
| ``` | |
| --- | |
| ## Sampling recommendations | |
| Inherited from [openbmb/MiniCPM5-2B](https://huggingface.co/openbmb/MiniCPM5-2B): | |
| | Scenario | Params | | |
| |---|---| | |
| | **Default** | `temperature=1.0, top_p=0.95, min_p=0.0` | | |
| | **If repetitive outputs** | `temperature=1.0, top_p=0.95, min_p=0.0, repetition_penalty=1.05` | | |
| This model is **Thinking-only** β chain-of-thought reasoning is always active. | |
| > Support for sampling parameters varies across inference frameworks β check your runtime's documentation. | |
| --- | |
| ## Limitations | |
| - **Thinking outputs** β the model may emit reasoning blocks before the final answer; downstream apps can strip them before display | |
| - **2B scale** β optimized for lightweight local deployment, not frontier-scale general reasoning | |
| --- | |
| ## Provenance & licensing | |
| Released under **Apache-2.0**, inherited from [MiniCPM5-2B](https://huggingface.co/openbmb/MiniCPM5-2B). | |
| ## Acknowledgements | |
| - Base model: [OpenBMB / MiniCPM5-2B](https://huggingface.co/openbmb/MiniCPM5-2B) | |
| - GGUF conversion: [llama.cpp](https://github.com/ggml-org/llama.cpp) | |