Run this model with HF Jobs
Run openbmb/MiniCPM4-Survey on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/openbmb/MiniCPM4-Survey. Ask me which dataset to train on, then push the LoRA adapter to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs and Transformers to run batch inference with https://huggingface.co/openbmb/MiniCPM4-Survey on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the predictions back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs and Lighteval to evaluate https://huggingface.co/openbmb/MiniCPM4-Survey. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/openbmb/MiniCPM4-Survey with Transformers and bitsandbytes. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use openbmb/MiniCPM4-Survey with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use openbmb/MiniCPM4-Survey with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="openbmb/MiniCPM4-Survey", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("openbmb/MiniCPM4-Survey", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use openbmb/MiniCPM4-Survey with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "openbmb/MiniCPM4-Survey" # 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/MiniCPM4-Survey", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/openbmb/MiniCPM4-Survey
- SGLang
How to use openbmb/MiniCPM4-Survey 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/MiniCPM4-Survey" \ --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/MiniCPM4-Survey", "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/MiniCPM4-Survey" \ --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/MiniCPM4-Survey", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use openbmb/MiniCPM4-Survey with Docker Model Runner:
docker model run hf.co/openbmb/MiniCPM4-Survey
init
Browse filesFiles changed (7)
1 unmodified line2345671 unmodified linelicense: apache-2.0---## News* [2025-06-05] 🚀🚀🚀 We have open-sourced **MiniCPM4-Survey**, a model built upon MiniCPM4-8B that is capable of generating trustworthy, long-form survey papers while maintaining competitive performance relative to significantly larger models.1 unmodified line2345678910111213141516171 unmodified linelicense: apache-2.0---## MiniCPM4 Series- [MiniCPM4-0.5B](https://huggingface.co/openbmb/MiniCPM4-0.5B)- [MiniCPM4-8B](https://huggingface.co/openbmb/MiniCPM4-8B)- [MiniCPM4-8B-Eagle-FRSpec](https://huggingface.co/openbmb/MiniCPM4-8B-Eagle-FRSpec)- [MiniCPM4-8B-Eagle-FRSpec-QAT](https://huggingface.co/openbmb/MiniCPM4-8B-Eagle-FRSpec-QAT)- [BitCPM4-0.5B](https://huggingface.co/openbmb/BitCPM4-0.5B)- [BitCPM4-1B](https://huggingface.co/openbmb/BitCPM4-1B)- [MiniCPM4-Survey](https://huggingface.co/openbmb/MiniCPM4-Survey): **<-- you are here**- [MiniCPM4-MCP](https://huggingface.co/openbmb/MiniCPM4-MCP)## News* [2025-06-05] 🚀🚀🚀 We have open-sourced **MiniCPM4-Survey**, a model built upon MiniCPM4-8B that is capable of generating trustworthy, long-form survey papers while maintaining competitive performance relative to significantly larger models.
123456789101112131415161718193 unmodified lines2324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173{"architectures": ["MiniCPMForCausalLM"],"attention_bias": false,"attention_dropout": 0.0,"auto_map": {"AutoConfig": "configuration_minicpm.MiniCPMConfig","AutoModel": "modeling_minicpm.MiniCPMForCausalLM","AutoModelForCausalLM": "modeling_minicpm.MiniCPMForCausalLM","AutoModelForSeq2SeqLM": "modeling_minicpm.MiniCPMForCausalLM","AutoModelForSequenceClassification": "modeling_minicpm.MiniCPMForSequenceClassification"},"bos_token_id": 1,"dim_model_base": 256,"eos_token_id": 73440,"hidden_act": "silu","hidden_size": 4096,"initializer_range": 0.1,3 unmodified lines"num_attention_heads": 32,"num_hidden_layers": 32,"num_key_value_heads": 2,"pad_token_id": 73440,"pretraining_tp": 1,"rms_norm_eps": 1e-06,"rope_scaling": {"long_factor": [0.9977997200264581,1.014658295992452,1.0349680404997148,1.059429246056193,1.0888815016813513,1.1243301355211495,1.166977103606075,1.2182568066927284,1.2798772354275727,1.3538666751582975,1.4426259039919596,1.5489853358570191,1.6762658237220625,1.8283407612492941,2.0096956085876183,2.225478927469756,2.481536379650452,2.784415934557119,3.1413289096347365,3.560047844772632,4.048719380066383,4.615569542115128,5.2684819496549835,6.014438591970396,6.858830049237097,7.804668263503327,8.851768731513417,9.99600492938444,11.228766118181639,12.536757560834843,13.902257701387796,15.303885189125953,16.717837610115794,18.119465097853947,19.484965238406907,20.792956681060105,22.02571786985731,23.16995406772833,24.217054535738416,25.16289275000465,26.007284207271347,26.753240849586767,27.40615325712662,27.973003419175363,28.461674954469114,28.880393889607006,29.237306864684626,29.540186419591297,29.79624387177199,30.01202719065413,30.193382037992453,30.34545697551969,30.47273746338473,30.579096895249787,30.66785612408345,30.741845563814174,30.80346599254902,30.85474569563567,30.897392663720595,30.932841297560394,30.962293553185553,30.986754758742034,31.007064503249293,31.02392307921529],"original_max_position_embeddings": 32768,"rope_type": "longrope","short_factor": [0.9977997200264581,1.014658295992452,1.0349680404997148,1.059429246056193,1.0888815016813513,1.1243301355211495,1.166977103606075,1.2182568066927284,1.2798772354275727,1.3538666751582975,1.4426259039919596,1.5489853358570191,1.6762658237220625,1.8283407612492941,2.0096956085876183,2.225478927469756,2.481536379650452,2.784415934557119,3.1413289096347365,3.560047844772632,4.048719380066383,4.615569542115128,5.2684819496549835,6.014438591970396,6.858830049237097,7.804668263503327,8.851768731513417,9.99600492938444,11.228766118181639,12.536757560834843,13.902257701387796,15.303885189125953,16.717837610115794,18.119465097853947,19.484965238406907,20.792956681060105,22.02571786985731,23.16995406772833,24.217054535738416,25.16289275000465,26.007284207271347,26.753240849586767,27.40615325712662,27.973003419175363,28.461674954469114,28.880393889607006,29.237306864684626,29.540186419591297,29.79624387177199,30.01202719065413,30.193382037992453,30.34545697551969,30.47273746338473,30.579096895249787,30.66785612408345,30.741845563814174,30.80346599254902,30.85474569563567,30.897392663720595,30.932841297560394,30.962293553185553,30.986754758742034,31.007064503249293,31.02392307921529]},"rope_theta": 10000.0,"scale_depth": 1.4,"scale_emb": 12,"tie_word_embeddings": false,"torch_dtype": "bfloat16","transformers_version": "4.51.3","use_cache": false,"vocab_size": 73448}1234567891011121314151617183 unmodified lines22232425262728293031323334353637383940{"_name_or_path": "openbmb/MiniCPM4-8B","architectures": ["MiniCPMForCausalLM"],"auto_map": {"AutoConfig": "configuration_minicpm.MiniCPMConfig","AutoModel": "modeling_minicpm.MiniCPMModel","AutoModelForCausalLM": "modeling_minicpm.MiniCPMForCausalLM","AutoModelForSeq2SeqLM": "modeling_minicpm.MiniCPMForCausalLM","AutoModelForSequenceClassification": "modeling_minicpm.MiniCPMForSequenceClassification"},"bos_token_id": 1,"eos_token_id": [2, 73440],"pad_token_id": 2,"hidden_act": "silu","hidden_size": 4096,"initializer_range": 0.1,3 unmodified lines"num_attention_heads": 32,"num_hidden_layers": 32,"num_key_value_heads": 2,"rms_norm_eps": 1e-06,"rope_scaling": {"rope_type": "longrope","long_factor": [0.9977997200264581, 1.014658295992452, 1.0349680404997148, 1.059429246056193, 1.0888815016813513, 1.1243301355211495, 1.166977103606075, 1.2182568066927284, 1.2798772354275727, 1.3538666751582975, 1.4426259039919596, 1.5489853358570191, 1.6762658237220625, 1.8283407612492941, 2.0096956085876183, 2.225478927469756, 2.481536379650452, 2.784415934557119, 3.1413289096347365, 3.560047844772632, 4.048719380066383, 4.615569542115128, 5.2684819496549835, 6.014438591970396, 6.858830049237097, 7.804668263503327, 8.851768731513417, 9.99600492938444, 11.228766118181639, 12.536757560834843, 13.902257701387796, 15.303885189125953, 16.717837610115794, 18.119465097853947, 19.484965238406907, 20.792956681060105, 22.02571786985731, 23.16995406772833, 24.217054535738416, 25.16289275000465, 26.007284207271347, 26.753240849586767, 27.40615325712662, 27.973003419175363, 28.461674954469114, 28.880393889607006, 29.237306864684626, 29.540186419591297, 29.79624387177199, 30.01202719065413, 30.193382037992453, 30.34545697551969, 30.47273746338473, 30.579096895249787, 30.66785612408345, 30.741845563814174, 30.80346599254902, 30.85474569563567, 30.897392663720595, 30.932841297560394, 30.962293553185553, 30.986754758742034, 31.007064503249293, 31.02392307921529],"short_factor": [0.9977997200264581, 1.014658295992452, 1.0349680404997148, 1.059429246056193, 1.0888815016813513, 1.1243301355211495, 1.166977103606075, 1.2182568066927284, 1.2798772354275727, 1.3538666751582975, 1.4426259039919596, 1.5489853358570191, 1.6762658237220625, 1.8283407612492941, 2.0096956085876183, 2.225478927469756, 2.481536379650452, 2.784415934557119, 3.1413289096347365, 3.560047844772632, 4.048719380066383, 4.615569542115128, 5.2684819496549835, 6.014438591970396, 6.858830049237097, 7.804668263503327, 8.851768731513417, 9.99600492938444, 11.228766118181639, 12.536757560834843, 13.902257701387796, 15.303885189125953, 16.717837610115794, 18.119465097853947, 19.484965238406907, 20.792956681060105, 22.02571786985731, 23.16995406772833, 24.217054535738416, 25.16289275000465, 26.007284207271347, 26.753240849586767, 27.40615325712662, 27.973003419175363, 28.461674954469114, 28.880393889607006, 29.237306864684626, 29.540186419591297, 29.79624387177199, 30.01202719065413, 30.193382037992453, 30.34545697551969, 30.47273746338473, 30.579096895249787, 30.66785612408345, 30.741845563814174, 30.80346599254902, 30.85474569563567, 30.897392663720595, 30.932841297560394, 30.962293553185553, 30.986754758742034, 31.007064503249293, 31.02392307921529],"original_max_position_embeddings": 32768},"torch_dtype": "bfloat16","transformers_version": "4.46.3","use_cache": true,"vocab_size": 73448,"rope_theta": 10000.0,"scale_emb": 12,"scale_depth": 1.4,"tie_word_embeddings": false}
123417 unmodified lines2223242526272882 unmodified lines1111121131141151161171183 unmodified lines12212312412512612712810 unmodified lines13914014114214314414514620 unmodified lines1671681691701711723 unmodified lines1761771781791801811826 unmodified lines189190191192193194195196197198199200# coding=utf-8# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.## This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX17 unmodified linesfrom transformers.configuration_utils import PretrainedConfigfrom transformers.utils import logginglogger = logging.get_logger(__name__)MINICPM_PRETRAINED_CONFIG_ARCHIVE_MAP = {}82 unmodified lines>>> configuration = model.config```"""model_type = "minicpm"keys_to_ignore_at_inference = ["past_key_values"]def __init__(self,3 unmodified linesnum_hidden_layers=32,num_attention_heads=32,num_key_value_heads=None,hidden_act="silu",max_position_embeddings=2048,initializer_range=0.02,rms_norm_eps=1e-6,10 unmodified linesscale_emb=1,dim_model_base=1,scale_depth=1,**kwargs,):self.vocab_size = vocab_sizeself.max_position_embeddings = max_position_embeddingsself.hidden_size = hidden_size20 unmodified linesself.dim_model_base = dim_model_baseself.scale_depth = scale_depthsuper().__init__(pad_token_id=pad_token_id,bos_token_id=bos_token_id,3 unmodified lines)try:import flash_attnself._attn_implementation = "flash_attention_2"except:pass6 unmodified linesif not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 2:raise ValueError("`rope_scaling` must be a dictionary with with two fields, `type` and `factor`, "f"got {self.rope_scaling}")rope_scaling_type = self.rope_scaling.get("type", None)rope_scaling_factor = self.rope_scaling.get("factor", None)if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:raise ValueError(f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}")12317 unmodified lines21222324252682 unmodified lines1091101111121131141151163 unmodified lines12012112212312412512610 unmodified lines13713813914014114214314414520 unmodified lines1661671681691701711721731743 unmodified lines1781791801811821831846 unmodified lines191192193194195196197198199200201202# Copyright 2022 EleutherAI and the HuggingFace Inc. team. All rights reserved.## This code is based on EleutherAI's GPT-NeoX library and the GPT-NeoX17 unmodified linesfrom transformers.configuration_utils import PretrainedConfigfrom transformers.utils import logginglogger = logging.get_logger(__name__)MINICPM_PRETRAINED_CONFIG_ARCHIVE_MAP = {}82 unmodified lines>>> configuration = model.config```"""model_type = 'minicpm'keys_to_ignore_at_inference = ['past_key_values']def __init__(self,3 unmodified linesnum_hidden_layers=32,num_attention_heads=32,num_key_value_heads=None,hidden_act='silu',max_position_embeddings=2048,initializer_range=0.02,rms_norm_eps=1e-6,10 unmodified linesscale_emb=1,dim_model_base=1,scale_depth=1,sparse_config=None,**kwargs):self.vocab_size = vocab_sizeself.max_position_embeddings = max_position_embeddingsself.hidden_size = hidden_size20 unmodified linesself.dim_model_base = dim_model_baseself.scale_depth = scale_depth# sparse configself.sparse_config = sparse_configsuper().__init__(pad_token_id=pad_token_id,bos_token_id=bos_token_id,3 unmodified lines)try:import flash_attnself._attn_implementation = 'flash_attention_2'except:pass6 unmodified linesif not isinstance(self.rope_scaling, dict) or len(self.rope_scaling) != 2:raise ValueError('`rope_scaling` must be a dictionary with with two fields, `type` and `factor`, 'f'got {self.rope_scaling}')rope_scaling_type = self.rope_scaling.get('type', None)rope_scaling_factor = self.rope_scaling.get('factor', None)if rope_scaling_type is None or rope_scaling_type not in ['linear', 'dynamic']:raise ValueError(f"`rope_scaling`'s type field must be one of ['linear', 'dynamic'], got {rope_scaling_type}")
12345678{"_from_model_config": true,"bos_token_id": 1,"eos_token_id": 73440,"pad_token_id": 73440,"transformers_version": "4.51.3","use_cache": false}123456789101112{"bos_token_id": 1,"do_sample": true,"eos_token_id": [2,73440],"pad_token_id": 2,"temperature": 0.8,"top_p": 0.8,"transformers_version": "4.46.1"}
22 unmodified lines2324252627282930313233343522 unmodified lines"rstrip": false,"single_word": false},"pad_token": {"content": "<|im_end|>","lstrip": false,"normalized": false,"rstrip": false,"single_word": false},"unk_token": {"content": "<unk>","lstrip": false,22 unmodified lines23242526272822 unmodified lines"rstrip": false,"single_word": false},"unk_token": {"content": "<unk>","lstrip": false,
102 unmodified lines103104105106107108109110111112113114115116117118119102 unmodified lines"<|fim_suffix|>"],"bos_token": "<s>","chat_template": "{% if messages[0]['role'] == 'system' %}{% set loop_messages = messages[1:] %}{% set system_message = messages[0]['content'] %}{% else %}{% set loop_messages = messages %}{% endif %}{% if system_message is defined %}{{ '<|im_start|>system\n' + system_message + '<|im_end|>\n' }}{% endif %}{% for message in loop_messages %}{% set content = message['content'] %}{% if message['role'] == 'user' %}{{ '<|im_start|>user\n' + content + '<|im_end|>\n<|im_start|>assistant\n' }}{% elif message['role'] == 'assistant' %}{{ content + '<|im_end|>' }}{% endif %}{% endfor %}","clean_up_tokenization_spaces": false,"eos_token": "<|im_end|>","extra_special_tokens": {},"legacy": true,"model_max_length": 1000000000000000019884624838656,"pad_token": "<|im_end|>","padding_side": "right","sp_model_kwargs": {},"spaces_between_special_tokens": false,"split_special_tokens": false,"tokenizer_class": "LlamaTokenizer","unk_token": "<unk>","use_default_system_prompt": false102 unmodified lines103104105106107108109110111112113114115116102 unmodified lines"<|fim_suffix|>"],"bos_token": "<s>","chat_template": "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}","clean_up_tokenization_spaces": false,"eos_token": "<|im_end|>","legacy": true,"model_max_length": 1000000000000000019884624838656,"pad_token": null,"sp_model_kwargs": {},"spaces_between_special_tokens": false,"tokenizer_class": "LlamaTokenizer","unk_token": "<unk>","use_default_system_prompt": false
README.md+10
config.json+14-147
configuration_minicpm.py+15-13
generation_config.json+9-5
modeling_minicpm.pyAdded
special_tokens_map.json-7
tokenizer_config.json+2-5