alt.freeweights.text / ERNIE-4.5-21B-A3B-PT
From: baidu <huggingface.co/baidu>Newsgroups: alt.freeweights.textSubject:

ERNIE-4.5-21B-A3B-PT

Date: 2026-11-15Commit: 87db954Signed: 2DC28CC7B26A283B ✓

Text generation model with 21.9B parameters. Safetensors weights, 43.9 GB in all. Published by baidu under Apache-2.0.

21.9B params43.9GBERNIE-4.5-21B-A3B-PTsafetensorspermissive
FactsParams21.9BSize43.9 GBFormatssafetensorsTasktext generationLicenseApache-2.0From sourcepermissive
$ fw get baidu/ERNIE-4.5-21B-A3B-PT
# manifest sha256 dc62a34448d3… · 43.9 GB · 21 files
$ fw verify ./ERNIE-4.5-21B-A3B-PT baidu/ERNIE-4.5-21B-A3B-PT
From sourceHosted (signed)baidu/ERNIE-4.5-21B-A3B-PTLast check: 2026-11-15 02:40 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Runs withAIBrixBentoMLCTranslate2ExLlamaV2ExLlamaV3exofastllmFlashInfergpu-unlockKTransformersLitServeLMCacheLMDeployLocalAImistral.rsMLC LLMMooncakeSGLangText Generation WebUItinygradTransformersTriton Inference ServervLLMXinferenceFine-tune withAccelerateAlignment HandbookAxolotlColossal-AIDeepSpeedEasyR1FlashAttentionH2O LLM StudioJAXKerasLiger KernelLitGPTLLaMA-FactoryMegatron-LMms-swiftnanotronOLMo-coreOpenRLHFOumiPEFTPyTorch Lightningsd-scriptsSimpleTunerTorchTitantorchtuneTransformer EngineTRLUnslothverlConvert withAQLMAutoRoundCore ML ToolsExecuTorchGPTQModelLLM CompressormergekitNeural CompressorOliveONNXOptimum QuantoOptimumsafetensorsTensorRT Model OptimizertorchaoEvaluate withAutoevalsDeepEvalEvaluateHELMLightEvallm-evaluation-harnessOpenCompassOpikRagassimple-evalsSWE-benchTruLensWeaveScan withAgentDojoAI Fairness 360DeepTeamDetoxifyFairlearngarakGiskardGuardrailsMCP ScannerModelScanNeMo GuardrailspicklescanpromptfooWorks withAgent Development KitAG2Google AI Edge GalleryAiderany-llmAnythingLLMBAMLbrowser-useCAMELHugging Face Chat UIChatboxCherry StudioClineCodex CLICogneeCrewAIDeerFlowDSPyEnchantedGemini CLIGitHub MCP ServergooseGPT ResearcherGradioGraphitiGuidanceHollamaInstructorKilo CodeLangflowLangGraphLiteLLMLlamaIndexLLMLocalAGILoLLMs WebUIMCP Python SDKMem0MetaGPTNextChatOllama JavaScriptOllama PythonOpenAI Agents SDKopencodeOpenHandsotermOutlinesPage AssistPlaywright MCPPortkey AI GatewayPrivateGPTQwen CodeRWKV RunnerSemantic KernelsmolagentsStrands AgentsVaneXGrammar

Overview

Size
43.9 GB
Weights
43.9 GB (safetensors)
Parameters
21.9B
Formats
safetensors
Task
text generation
License
Apache-2.0 (permissive)
Files
21, each with a sha256
Publisher
baidu
Added
2026-11-15
Section
alt.freeweights.text
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 02:40 UTCpassed

Model card

From the publisher at commit 87db954. Shown as plain text with links; images open at the publisher.

Chat Hugging Face Github Blog Discord X

License

ERNIE-4.5-21B#

Note. Note: "-Paddle" models use PaddlePaddle weights, while "-PT" models use Transformer-style PyTorch weights.

ERNIE 4.5 Highlights#

The advanced capabilities of the ERNIE 4.5 models, particularly the MoE-based A47B and A3B series, are underpinned by several key technical innovations:

  1. 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.
  2. 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, ERNIE 4.5 delivers high-performance inference across a wide range of hardware platforms.
  3. 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.

Model Overview#

ERNIE-4.5-21B-A3B is a text MoE Post-trained model, with 21B total parameters and 3B activated parameters for each token. The following are the model configuration details:

KeyValue
ModalityText
Training StagePosttraining
Params(Total / Activated)21B / 3B
Layers28
Heads(Q/KV)20 / 4
Text Experts(Total / Activated)64 / 6
Vision Experts(Total / Activated)64 / 6
Shared Experts2
Context Length131072

Quickstart#

Using transformers library#

Note: You'll need the transformers library (version 4.54.0 or newer) installed to use this model.

The following contains a code snippet illustrating how to use the model generate content based on given inputs.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "baidu/ERNIE-4.5-21B-A3B-PT"

# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    device_map="auto",
    torch_dtype=torch.bfloat16,
)

# prepare the model input
prompt = "Give me a short introduction to large language model."
messages = [
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], add_special_tokens=False, return_tensors="pt").to(model.device)

# conduct text completion
generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=1024
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()

# decode the generated ids
generate_text = tokenizer.decode(output_ids, skip_special_tokens=True)
print("generate_text:", generate_text)
vLLM inference#

VLLM>=0.10.2 (excluding 0.11.0)

vllm serve baidu/ERNIE-4.5-21B-A3B-PT

License#

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

Citation#

If you find ERNIE 4.5 useful or wish to use it in your projects, please kindly cite our technical report:

@misc{ernie2025technicalreport,
      title={ERNIE 4.5 Technical Report},
      author={Baidu ERNIE Team},
      year={2025},
      eprint={},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={}
}

Files

21 files · 43.9 GBWeights 43.9 GB (safetensors). Sizes and sha256 from the signed manifest.
Show all 21 files with their sha256
FileSizesha256
.gitattributes1.48 KB98ae86f235b3b2253319436eb223e94ae2554fa8b2910c94fb36823f09c13a43
LICENSE11.4 KB5d7deeaff0d6f92ef5c74658a46e4750ccbcd0602efcdfd24cd7ec6ae7c822f9
README.md7.07 KB992cd4a473fc9a3271fb5f2edc168b5f526821995e4f31f0a89959754a487193
added_tokens.json25.2 KB08ab98258652553a53455b164c258488ce840322f0949877676d962a1d958cad
chat_template.jinja754 B471fb571976770318fe6f27749e37940be8d29c0a7770558140f141f5906f2a2
config.json936 B7383c7387390746c1fa0327f8cab3d5c6b078a60bbf0841d4f42277eece5a5f6
generation_config.json226 B7ad1494c9fb6d26f0fdf1be2a542fe6e1f776597037661fd360daded217308c1
model-00001-of-00009.safetensors4.99 GBb944665b6bcfe764760828e5a75387528d687379cd3cfbb851eff27520d46c58
model-00002-of-00009.safetensors5.00 GB7e9a63714a61651df13fda0189d2ed585da51f4b65c49139653c42c028b08e5c
model-00003-of-00009.safetensors4.99 GB03ce9d29a546b94149818b83c1ff30cb2da2595535242e031eebba1f217c425e
model-00004-of-00009.safetensors5.00 GBe75826a57d5c36407200e424b49caebcdea4d1d35593dca86ba41ecf39fb336b
model-00005-of-00009.safetensors5.00 GB485c9f55552c3cfe669819f5ebd517510b228f1b8ce4dd6250c8ed08902c34dd
model-00006-of-00009.safetensors5.00 GB7a39850dafad0cf5f733dc89652f059442d6775bdf3e76ac0c57341e956fadf4
model-00007-of-00009.safetensors4.99 GB566602f8aa76b5fbde5bd31be3626b5a812d3e6b3ef5ce2620493041876ddc23
model-00008-of-00009.safetensors4.99 GB9d05d013a896c8d85e9908277e79c817bd8876d00a0b46955d38d1f7c1d50825
model-00009-of-00009.safetensors3.97 GB2c7952c713db4ad21f3e0f969551e3f63d9c0c0ecdcf7d26cb564360f6b08b06
model.safetensors.index.json516 KB4078ac03e2211cf0ce6356a861639dd7dbc0f3a4117afd126234fe2792bf4477
special_tokens_map.json20.2 KBd96a4630d4a8bbddabc3e1ad272a0e6a42f37a515239c8d25626d09154d7603b
tokenizer.json11.2 MB4e5b4d49475d27c7ef7a61eea2d675f9cc013e91e3ddb5e06d964f5027c1814a
tokenizer.model1.61 MB34ef7db83df785924fb83d7b887b6e822a031c56e15cff40aaf9b982988180df
tokenizer_config.json203 KBe9bc80502f0e997cc36b4d1f2bd025a3ca549a108736f7a1cef014229db0a82d
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
87db954879 pinned now2026-11-15 02:40 UTC21 files · 43.9 GB

Use it

$ fw get baidu/ERNIE-4.5-21B-A3B-PT
# manifest sha256 dc62a34448d3… · 43.9 GB · 21 files
$ fw verify ./ERNIE-4.5-21B-A3B-PT baidu/ERNIE-4.5-21B-A3B-PT
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/baidu/ERNIE-4.5-21B-A3B-PT.json --dir ./ERNIE-4.5-21B-A3B-PT $ python3 fw.py verify ./ERNIE-4.5-21B-A3B-PT ./baidu__ERNIE-4.5-21B-A3B-PT.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download baidu/ERNIE-4.5-21B-A3B-PT --revision 87db95487941cb39592ee0abca3b9155a6d19c5c --local-dir ./ERNIE-4.5-21B-A3B-PT
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModelForCausalLM, AutoTokenizer tok = AutoTokenizer.from_pretrained("baidu/ERNIE-4.5-21B-A3B-PT", revision="87db95487941cb39592ee0abca3b9155a6d19c5c") model = AutoModelForCausalLM.from_pretrained("baidu/ERNIE-4.5-21B-A3B-PT", revision="87db95487941cb39592ee0abca3b9155a6d19c5c", device_map="auto")
vLLMServe an OpenAI-compatible API.
$ HF_ENDPOINT=https://freeweights.allternit.com vllm serve baidu/ERNIE-4.5-21B-A3B-PT --revision 87db95487941cb39592ee0abca3b9155a6d19c5c

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
LICENSE
Text sha256
5d7deeaff0d6f92ef5c74658a46e4750ccbcd0602efcdfd24cd7ec6ae7c822f9
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: baidu <huggingface.co/baidu>Newsgroups: alt.freeweights.textSubject: ERNIE-4.5-21B-A3B-PTDate: 2026-11-15Commit: 87db954Signed: 2DC28CC7B26A283B ✓
Upstream
baidu/ERNIE-4.5-21B-A3B-PT
Pinned commit
87db95487941cb39592ee0abca3b9155a6d19c5c
Manifest
ERNIE-4.5-21B-A3B-PT.json · .minisig
Manifest sha256
dc62a34448d385af99391d0fcaea6f29f67d63e9cb8c42ac29cc6f37c093642b
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 02:40 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/baidu/ERNIE-4.5-21B-A3B-PT.json $ curl -O https://freeweights.allternit.com/manifests/baidu/ERNIE-4.5-21B-A3B-PT.json.minisig $ minisign -Vm ERNIE-4.5-21B-A3B-PT.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

6 models in the catalog name this one as their parent.

Quantizations
6
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download baidu/ERNIE-4.5-21B-A3B-PT
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. ERNIE-4.5-21B-A3B-PT.json. Provenance. Takedown history: none.

Variants

6 quantized or adapter builds of ERNIE-4.5-21B-A3B-PT. Each has its own license check and page.

From: laion <huggingface.co/laion>Subject: a2-rl-e2egit_large-50-32B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-large-15-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_e2egit-v2-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_pymethods2test-large-80-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_exp_rpt_unitsyn-python-large-10-8B
From: laion <huggingface.co/laion>Subject: a3-rl-DCAgent_mix_h2_language_proportional-65-8B