GitHub Repo | Technical Report | Join Us

πŸ‘‹ Contact us in Discord and WeChat

What's New

  • [2025.09.05] MiniCPM4.1 series are released! This series is a hybrid reasoning model, which can be used in both deep reasoning mode and non-reasoning mode. πŸ”₯πŸ”₯πŸ”₯
  • [2025.06.06] MiniCPM4 series are released! This model achieves ultimate efficiency improvements while maintaining optimal performance at the same scale! It can achieve over 5x generation acceleration on typical end-side chips! You can find technical report here.πŸ”₯πŸ”₯πŸ”₯

MiniCPM4 and MiniCPM4.1 Series

MiniCPM4 and MiniCPM4.1 series are highly efficient large language models (LLMs) designed explicitly for end-side devices, which achieves this efficiency through systematic innovation in four key dimensions: model architecture, training data, training algorithms, and inference systems.

Introduction

MiniCPM4 and MiniCPM4.1 are extremely efficient edge-side large model that has undergone efficient optimization across four dimensions: model architecture, learning algorithms, training data, and inference systems, achieving ultimate efficiency improvements.

  • πŸ—οΈ Efficient Model Architecture:

    • InfLLM v2 -- Trainable Sparse Attention Mechanism: Adopts a trainable sparse attention mechanism architecture where each token only needs to compute relevance with less than 5% of tokens in 128K long text processing, significantly reducing computational overhead for long texts
  • 🧠 Efficient Learning Algorithms:

    • Model Wind Tunnel 2.0 -- Efficient Predictable Scaling: Introduces scaling prediction methods for performance of downstream tasks, enabling more precise model training configuration search
    • BitCPM -- Ultimate Ternary Quantization: Compresses model parameter bit-width to 3 values, achieving 90% extreme model bit-width reduction
    • Efficient Training Engineering Optimization: Adopts FP8 low-precision computing technology combined with Multi-token Prediction training strategy
  • πŸ“š High-Quality Training Data:

    • UltraClean -- High-quality Pre-training Data Filtering and Generation: Builds iterative data cleaning strategies based on efficient data verification, open-sourcing high-quality Chinese and English pre-training dataset UltraFinweb
    • UltraChat v2 -- High-quality Supervised Fine-tuning Data Generation: Constructs large-scale high-quality supervised fine-tuning datasets covering multiple dimensions including knowledge-intensive data, reasoning-intensive data, instruction-following data, long text understanding data, and tool calling data
  • ⚑ Efficient Inference System:

    • CPM.cu -- Lightweight and Efficient CUDA Inference Framework: Integrates sparse attention, model quantization, and speculative sampling to achieve efficient prefilling and decoding
    • ArkInfer -- Cross-platform Deployment System: Supports efficient deployment across multiple backend environments, providing flexible cross-platform adaptation capabilities

Usage

Prebuilt AutoAWQ

pip install autoawq

Inference

from awq import AutoAWQForCausalLM
import torch
from transformers import AutoTokenizer

prompt = "εŒ—δΊ¬ζœ‰δ»€δΉˆε₯½ηŽ©ηš„εœ°ζ–ΉοΌŸ"
quant_path = "MiniCPM4.1-8B-AutoAWQ"

messages = [{"role": "user", "content": prompt}]

model = AutoAWQForCausalLM.from_quantized(
    quant_path,
    fuse_layers=False, 
    trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained(
    quant_path,
    trust_remote_code=True
)
device = next(model.model.parameters()).device

# if open think mode, use the following code
formatted_prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt = True, enable_thinking = True)
# if close think mode, use the following code
# formatted_prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt = True, enable_thinking = False)

input_ids = tokenizer.encode(formatted_prompt, return_tensors='pt').to(device)
outputs = model.generate(
    input_ids,
    max_new_tokens=1000,
    do_sample=True
)
# if open think mode, use the following code
ans = [i.split("<|im_start|> assistant\n", 1)[1].strip() for i in tokenizer.batch_decode(outputs)]
# if close think mode, use the following code
# ans = [i.split("<|im_start|> assistant\n<think>\n\n</think>", 1)[1].strip() for i in tokenizer.batch_decode(outputs)]
Downloads last month
5
Safetensors
Model size
1.62B params
Tensor type
I32
Β·
BF16
Β·
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Collection including openbmb/MiniCPM4.1-8B-AutoAWQ