{"Code":200,"Data":{"AigcAttributes":"{}","AigcIsTop":0,"AigcType":"","AlreadyStar":false,"ApplyMeta":"{}","ApprovalMode":1,"ApprovalNotifyEmail":"","Architectures":["Ernie4_5_VLMoeForConditionalGeneration"],"Avatar":"https://img.alicdn.com/imgextra/i1/O1CN01yhHrHg1Pdl3UKPhGc_!!6000000001864-2-tps-88-88.png","Backbone":[],"BackendSupport":{"architectures":null,"backend_info":{"deploy_task":null,"lmdeploy":null,"lmdeploy_turbomind":null,"ollama":null,"sglang":null,"vllm":null},"model_id":"PaddlePaddle/ERNIE-4.5-VL-28B-A3B-PT"},"BaseModel":[],"BaseModelRelation":"","CardReady":0,"CardUnreadyReason":"","CertificationCreateBy":"","CertificationCreatedTime":-62135596800,"ChineseName":"","CoverHeight":0,"CoverImages":[],"CoverWidth":0,"CreatedBy":"SFLY5790","CreatedTime":1751099928,"DashSdkParameter":"","Datasets":{},"DemoAvailable":0,"DemoUnavailableReason":"","Description":"","Domain":[],"Downloads":2436,"ExampleCodeAvailable":0,"ExampleCodeUnavailableReason":"","ForbiddenVisibilityUpdate":false,"Frameworks":["Pytorch"],"FromSite":"github","Id":498427,"Integrating":0,"IntegrationFailureLog":"","IntegrationFailureReason":"","IsAccessible":1,"IsCertification":4,"IsHot":0,"IsNewModel":false,"IsOnline":1,"IsOrgClaimed":false,"IsPreTrain":0,"IsPublished":1,"IsTop":0,"Language":["en","zh"],"LastUpdatedTime":1776759990,"Libraries":["pytorch","transformer","safetensors"],"License":"apache-2.0","LicenseLink":"","LicenseName":"","Meta":"","Metrics":[],"ModelDetail":{},"ModelInfos":{"safetensor":{"chat_template":"\n{%- set image_count = namespace(value=0) -%}\n{%- set video_count = namespace(value=0) -%}\n{{- '\u003c|begin_of_sentence|\u003e' }}\n{%- for message in messages -%}\n    {%- if message.role in ['system', 'user'] -%}\n        {%- if message.role == 'user' -%}\n            {{- 'User: ' -}}\n        {%- endif -%}\n        {%- if message.content is string -%}\n            {{- message.content -}}\n        {%- else -%}\n            {%- for content_item in message.content -%}\n                {%- if content_item.type == 'text' -%}\n                    {{- content_item.text -}}\n                {%- elif content_item.type in ['image_url', 'image'] -%}\n                    {%- set image_count.value = image_count.value + 1 -%}\n                    Picture {{ image_count.value }}:\u003c|IMAGE_START|\u003e\u003c|image@placeholder|\u003e\u003c|IMAGE_END|\u003e\n                {%- elif content_item.type in ['video_url', 'video'] -%}\n                    {%- set video_count.value = video_count.value + 1 -%}\n                    Video {{ video_count.value }}:\u003c|VIDEO_START|\u003e\u003c|video@placeholder|\u003e\u003c|VIDEO_END|\u003e\n                {%- endif -%}\n            {%- endfor -%}\n        {%- endif -%}\n        {%- if message.role == 'system' -%}\n            {{- '\n' -}}\n        {%- endif -%}\n    {%- elif message.role == 'assistant' -%}\n        {%- macro extract_text_content(content_field) -%}\n            {%- if content_field is string -%}\n                {{- content_field -}}\n            {%- elif content_field is iterable and content_field is not string -%}\n                {%- set ns = namespace(text_parts=[]) -%}\n                {%- set text_parts = [] -%}\n                {%- for item in content_field -%}\n                    {%- if item.type == 'text' -%}\n                        {%- set ns.text_parts = ns.text_parts + [item.text] -%}\n                    {%- endif -%}\n                {%- endfor -%}\n                {{- ns.text_parts | join('') -}}\n            {%- else -%}\n                {{- '' -}}\n            {%- endif -%}\n        {%- endmacro -%}\n        {%- set reasoning_content = extract_text_content(message.reasoning_content) -%}\n        {%- set content = extract_text_content(message.content) -%}\n        {%- if '\u003c/think\u003e' in content %}\n            {%- set reasoning_content = content.split('\u003c/think\u003e')[0].rstrip('\n').split('\u003cthink\u003e')[-1].lstrip('\n') %}\n            {%- set content = content.split('\u003c/think\u003e')[-1].lstrip('\n') %}\n        {%- endif %}\n        {%- if reasoning_content %}\n            {{- '\n' + 'Assistant: ' + '\u003cthink\u003e\n' + reasoning_content.strip('\n') + '\n\u003c/think\u003e\n\n' + content.lstrip('\n') }}\n        {%- else %}\n            {{- '\n' + 'Assistant: ' + content }}\n        {%- endif %}\n        {{- '\u003c|end_of_sentence|\u003e' }}\n    {%- endif -%}\n{%- endfor -%}\n{%- if add_generation_prompt is not defined or add_generation_prompt is true %}\n    {{- '\nAssistant: ' -}}\n    {%- if enable_thinking is defined and enable_thinking is false %}\n        {{- '\u003cthink\u003e\n\n\u003c/think\u003e\n\n' }}\n    {%- endif %}\n    {%- if enable_thinking is not defined or enable_thinking is true %}\n        {{- '\u003cthink\u003e' }}\n    {%- endif %}\n{%- endif %}\n","files":[{"name":"model.safetensors.index.json","sha256":"928e6000ce3872249a214b746c5e4d843ee8ce7a783224cca90d24d156b7e3d4","size":995503},{"name":"model-00001-of-00012.safetensors","sha256":"9bf21cc35126cba976658743bf6cb834592d62b054df707949aefe54a8819fc1","size":4991358608},{"name":"model-00002-of-00012.safetensors","sha256":"3be2e55d382fd35af01b352ec954d70d9c85e2c9773318873160262eaca94521","size":4988732080},{"name":"model-00003-of-00012.safetensors","sha256":"f015a401233aa4aca5ea6d84fc852ceb8b013ce69906ef8e9363b852908a74ff","size":4999222944},{"name":"model-00004-of-00012.safetensors","sha256":"23c836804da9ffc4fce5ec8514a3e342f6c419ea0919e82722a0d29970cf8462","size":4995307456},{"name":"model-00005-of-00012.safetensors","sha256":"8d0851b85a92ea291f4735588ec5ebd7d9d09700d8f9805995563f1ef0c80e84","size":4988732984},{"name":"model-00006-of-00012.safetensors","sha256":"40f787a8377b43959b388d7cc87c8ee8f4edef03c11441a8d2e1db46d1e909f0","size":4999234272},{"name":"model-00007-of-00012.safetensors","sha256":"4747685c94cb90f9b52233bbf5bc54d037860d90d73771b26b94b53ede995bee","size":4995298008},{"name":"model-00008-of-00012.safetensors","sha256":"e3d5b703c1f51475fcfdbb1bdad942ed3799dbb3486cb392765d9d167a2378cc","size":4999219488},{"name":"model-00009-of-00012.safetensors","sha256":"9fedce1274b09ffb472c999e7954a1152fca9bcc11a3e1ceaee2811c5798a9da","size":4995312664},{"name":"model-00010-of-00012.safetensors","sha256":"6ec0f5133e2cf9170ae86fa8b4edf4c57edff9b69ecff1c9d60d4b6990fb8f2b","size":4988732992},{"name":"model-00011-of-00012.safetensors","sha256":"5b62486df379ff3bacca4a3387c6e2d77158d7c55b5711f17a52c384ad57b2aa","size":4999229776},{"name":"model-00012-of-00012.safetensors","sha256":"c67ec8e731d393ba6c945290fc758a7e132115c30c2328428af9bdfdf5070082","size":3877279408}],"model_size":29399294336,"tensor_type":["F32","F16","BF16"]}},"ModelRevisions":null,"ModelSource":"USER_UPLOAD","ModelTools":"","ModelType":["ernie4_5_moe_vl"],"MuseInfo":null,"NEXA":{"Catalogues":null,"ModelCover":"","ScientificField":"","Source":"","SubScientificField":null},"Name":"ERNIE-4.5-VL-28B-A3B-PT","NewVersion":"","NickName":"","OfficialTags":null,"OpenAiSwingDeployInfo":{"Order":0,"Recommend":null,"lmdeploy":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"ollama":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"pipeline":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""},"vllm":{"eas":{"Script":"","requirements":""},"ens":{"Script":"","requirements":""},"fc":{"Script":"","requirements":""},"image_tag":""}},"Organization":{"ApplyFailureReason":"","ApplyReason":"","Avatar":"https://resouces.modelscope.cn/avatar/5660bb12-f5e7-4102-8272-c9f57a2b29e1.png","CreateCompetition":false,"CreatedBy":"Devkit","Description":"[\"root\",{},[\"p\",{},[\"span\",{\"data-type\":\"text\"},[\"span\",{\"data-type\":\"leaf\"},\"\"]]]]","DisplayUrl":"","Email":"","EmailDomain":"","FollowerCnt":0,"FromSite":"","FullName":"飞桨PaddlePaddle","GithubAddress":"https://github.com/PaddlePaddle/Paddle","GmtCreated":"2025-03-26T07:59:42Z","GmtModified":"2025-11-04T10:07:50Z","Id":1789,"InitAdminMembers":"","IsApply":false,"IsCertification":"","MemberCnt":0,"Mobile":"","Name":"PaddlePaddle","Path":"","Roles":null,"SocialLinks":null,"StarCnt":0,"Status":0,"SubscribeVo":null,"Type":2},"PaiModelGalleryUrl":{"deploy":"https://account.aliyun.com/login/login.htm?oauth_callback=https%3A//pai.console.aliyun.com/regionId%3Dcn-hangzhou%23/quick-start/models/ERNIE-4.5-VL-28B-A3B-PT/intro%3FviewType%3DDeploy%26from%3DModelScope\u0026lang=zh"},"PaiSdkParameter":null,"Path":"PaddlePaddle","ProtectedMode":2,"ReadMeContent":"\n\u003cdiv align=\"center\" style=\"line-height: 1;\"\u003e\n  \u003ca href=\"https://ernie.baidu.com/\" target=\"_blank\" style=\"margin: 2px;\"\u003e\n    \u003cimg alt=\"Chat\" src=\"https://img.shields.io/badge/🤖_Chat-ERNIE_Bot-blue\" style=\"display: inline-block; vertical-align: middle;\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://huggingface.co/baidu\" target=\"_blank\" style=\"margin: 2px;\"\u003e\n    \u003cimg alt=\"Hugging Face\" src=\"https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Baidu-ffc107?color=ffc107\u0026logoColor=white\" style=\"display: inline-block; vertical-align: middle;\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/PaddlePaddle/ERNIE\" target=\"_blank\" style=\"margin: 2px;\"\u003e\n    \u003cimg alt=\"Github\" src=\"https://img.shields.io/badge/GitHub-ERNIE-000?logo=github\u0026color=0000FF\" style=\"display: inline-block; vertical-align: middle;\"/\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://ernie.baidu.com/blog/ernie4.5\" target=\"_blank\" style=\"margin: 2px;\"\u003e\n    \u003cimg alt=\"Blog\" src=\"https://img.shields.io/badge/🖖_Blog-ERNIE4.5-A020A0\" style=\"display: inline-block; vertical-align: middle;\"/\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\" style=\"line-height: 1;\"\u003e\n  \u003ca href=\"#license\" style=\"margin: 2px;\"\u003e\n    \u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-Apache2.0-A5de54\" style=\"display: inline-block; vertical-align: middle;\"/\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n# ERNIE-4.5-VL-28B-A3B\n\n## ERNIE 4.5 Highlights\n\nThe advanced capabilities of the ERNIE 4.5 models, particularly the MoE-based A47B and A3B series, are underpinned by several key technical innovations:\n\n1. **Multimodal Heterogeneous MoE Pre-Training:** Our models are jointly trained on both textual and visual modalities to better capture the nuances of multimodal information and improve performance on tasks involving text understanding and generation, image understanding, and cross-modal reasoning. To achieve this without one modality hindering the learning of another, we designed a *heterogeneous MoE structure*, incorporated *modality-isolated routing*, and employed *router orthogonal loss* and *multimodal token-balanced loss*. These architectural choices ensure that both modalities are effectively represented, allowing for mutual reinforcement during training.\n\n2. **Scaling-Efficient Infrastructure:** We propose a novel heterogeneous hybrid parallelism and hierarchical load balancing strategy for efficient training of ERNIE 4.5 models. By using intra-node expert parallelism, memory-efficient pipeline scheduling, FP8 mixed-precision training and finegrained recomputation methods, we achieve remarkable pre-training throughput. For inference, we propose *multi-expert parallel collaboration* method and *convolutional code quantization* algorithm to achieve 4-bit/2-bit lossless quantization. Furthermore, we introduce PD disaggregation with dynamic role switching for effective resource utilization to enhance inference performance for ERNIE 4.5 MoE models. Built on [PaddlePaddle](https://github.com/PaddlePaddle/Paddle), ERNIE 4.5 delivers high-performance inference across a wide range of hardware platforms.\n\n3. **Modality-Specific Post-Training:** To meet the diverse requirements of real-world applications, we fine-tuned variants of the pre-trained model for specific modalities. Our LLMs are optimized for general-purpose language understanding and generation. The VLMs focuses on visuallanguage understanding and supports both thinking and non-thinking modes. Each model employed a combination of *Supervised Fine-tuning (SFT)*, *Direct Preference Optimization (DPO)* or a modified reinforcement learning method named *Unified Preference Optimization (UPO)* for post-training.\n\nDuring the fine-tuning stage of a vision-language model, the deep integration between vision and language plays a decisive role in the model’s performance across complex tasks such as understanding, reasoning, and generation. To enhance the generalization and adaptability of the model on multimodal tasks, we focused on three core capabilities—image understanding, task-specific fine-tuning, and multimodal chain-of-thought reasoning—and carried out systematic data construction and training strategy optimization. Additionally, we use RLVR(Reinforcement Learning with Verifiable Rewards) to further improve alignment and performance. After the SFT and RL stages, we obtained ERNIE-4.5-VL-28B-A3B.\n\n## Model Overview\n\nERNIE-4.5-VL-28B-A3B is a multimodal MoE Chat model, with 28B total parameters and 3B activated parameters for each token. The following are the model configuration details:\n\n| Key                               | Value         |\n| --------------------------------- | ------------- |\n| Modality                          | Text \u0026 Vision |\n| Training Stage                    | Posttraining  |\n| Params(Total / Activated)         | 28B / 3B      |\n| Layers                            | 28            |\n| Heads(Q/KV)                       | 20 / 4        |\n| Text Experts(Total / Activated)   | 64 / 6        |\n| Vision Experts(Total / Activated) | 64 / 6        |\n| Shared Experts                    | 2             |\n| Context Length                    | 131072        |\n\n## Quickstart\n\n### FastDeploy Inference\n\nQuickly deploy services using FastDeploy as shown below. For more detailed usage, refer to the [FastDeploy GitHub Repository](https://github.com/PaddlePaddle/FastDeploy).\n\n**Note**: For single-card deployment, at least 80GB of GPU memory is required.\n\n```bash\npython -m fastdeploy.entrypoints.openai.api_server \\\n       --model baidu/ERNIE-4.5-VL-28B-A3B-Paddle \\\n       --port 8180 \\\n       --metrics-port 8181 \\\n       --engine-worker-queue-port 8182 \\\n       --max-model-len 32768 \\\n       --enable-mm \\\n       --reasoning-parser ernie-45-vl \\\n       --max-num-seqs 32\n```\n\nThe ERNIE-4.5-VL model supports enabling or disabling thinking mode through request parameters.\n\n#### Enable Thinking Mode\n\n```bash\ncurl -X POST \"http://0.0.0.0:8180/v1/chat/completions\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"messages\": [\n    {\"role\": \"user\", \"content\": [\n      {\"type\": \"image_url\", \"image_url\": {\"url\": \"https://paddlenlp.bj.bcebos.com/datasets/paddlemix/demo_images/example2.jpg\"}},\n      {\"type\": \"text\", \"text\": \"Descript this image\"}\n    ]}\n  ],\n  \"metadata\": {\"enable_thinking\": true}\n}'\n```\n\n#### Disable Thinking Mode\n\n```bash\ncurl -X POST \"http://0.0.0.0:8180/v1/chat/completions\" \\\n-H \"Content-Type: application/json\" \\\n-d '{\n  \"messages\": [\n    {\"role\": \"user\", \"content\": [\n      {\"type\": \"image_url\", \"image_url\": {\"url\": \"https://paddlenlp.bj.bcebos.com/datasets/paddlemix/demo_images/example2.jpg\"}},\n      {\"type\": \"text\", \"text\": \"Descript this image\"}\n    ]}\n  ],\n  \"metadata\": {\"enable_thinking\": false}\n}'\n```\n\n### Using `transformers` library\n\nHere is an example of how to use the transformers library for inference:\n\n```python\nimport torch\nfrom transformers import AutoProcessor, AutoTokenizer, AutoModelForCausalLM\n\nmodel_path = 'baidu/ERNIE-4.5-VL-28B-A3B-PT'\nmodel = AutoModelForCausalLM.from_pretrained(\n    model_path,\n    device_map=\"auto\",\n    torch_dtype=torch.bfloat16,\n    trust_remote_code=True\n)\n\nprocessor = AutoProcessor.from_pretrained(model_path, trust_remote_code=True)\nprocessor.eval()\nmodel.add_image_preprocess(processor)\n\nmessages = [\n    {\n        \"role\": \"user\",\n        \"content\": [\n            {\"type\": \"text\", \"text\": \"Describe the image.\"},\n            {\"type\": \"image_url\", \"image_url\": {\"url\": \"https://paddlenlp.bj.bcebos.com/datasets/paddlemix/demo_images/example1.jpg\"}},\n        ]\n    },\n]\n\ntext = processor.apply_chat_template(\n    messages, tokenize=False, add_generation_prompt=True, enable_thinking=False\n)\nimage_inputs, video_inputs = processor.process_vision_info(messages)\ninputs = processor(\n    text=[text],\n    images=image_inputs,\n    videos=video_inputs,\n    padding=True,\n    return_tensors=\"pt\",\n)\n\ndevice = next(model.parameters()).device\ninputs = inputs.to(device)\n\ngenerated_ids = model.generate(\n    inputs=inputs['input_ids'].to(device),\n    **inputs,\n    max_new_tokens=128\n    )\noutput_text = processor.decode(generated_ids[0])\nprint(output_text)\n```\n\n### vLLM inference\n\nWe are working with the community to fully support ERNIE4.5 models, stay tuned.\n\n## License\n\nThe ERNIE 4.5 models are provided under the Apache License 2.0. This license permits commercial use, subject to its terms and conditions. Copyright (c) 2025 Baidu, Inc. All Rights Reserved.\n\n## Citation\n\nIf you find ERNIE 4.5 useful or wish to use it in your projects, please kindly cite our technical report:\n\n```bibtex\n@misc{ernie2025technicalreport,\n      title={ERNIE 4.5 Technical Report},\n      author={Baidu ERNIE Team},\n      year={2025},\n      eprint={},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL},\n      url={}\n}\n```\n\n","ReadMeTips":null,"RelatedArxivId":[],"RelatedPaper":[],"Revision":"master","Stars":24,"StorageSize":58820708645,"Studios":[],"SubVisionFoundation":"","SupportApiInference":false,"SupportDashDeployment":0,"SupportDashInference":0,"SupportDashTraining":0,"SupportDeployment":0,"SupportExperience":1,"SupportFinetuning":0,"SupportFlexTrain":0,"SupportInference":"txt2txt","SupportPaiModelGallery":["deploy"],"SupportPaiSdk":0,"SupportPivotEval":false,"SwingDeployInfo":null,"Tags":["ERNIE4.5"],"Tasks":[{"ChineseName":"视觉多模态理解","Description":"","DomainName":"multi-modal","Id":295,"IsExhibition":true,"IsHot":0,"IsLeaf":true,"IsLoginRequired":true,"IsRetrieval":true,"Level":1,"Name":"image-text-to-text","ParentId":-1,"ParentTask":null,"Sorting":0,"SupportWidgets":false,"TypicalModel":"","WidgetConfig":"{}","WidgetValidator":""}],"Tools":[],"TriggerWords":null,"Visibility":5,"VisionFoundation":"","_":null,"widgets":[{"enable":true,"enabled":false,"examples":[{"inputs":[{"data":"Describe the content of this image","name":"text"},{"data":"https://modelscope.oss-cn-beijing.aliyuncs.com/vlm_example_image.png","name":"image"}],"name":"","parameters":null,"title":""}],"inferencespec":null,"inputs":null,"parameters":null,"task":"image-text-to-text","template":{"general":true}}]},"Message":"success","RequestId":"7f498878-3d92-4a37-a3bf-0f548111a3d9","Success":true}