ERNIE 4.5

ERNIE-4.5-21B-A3B

by Baidu · Current and available; open-weight model with hosted inference available through Baidu Qianfan

Baidu’s ERNIE-4.5-21B-A3B is an Apache 2.0 open-weight text model using a 21B-parameter mixture-of-experts architecture with approximately 3B active parameters. It provides a 128K context window, Qianfan-hosted inference with up to 12,288 output tokens, local deployment through PaddlePaddle or Transformers, and fine-tuning options. The model is suited to long-context language workloads but does not have verified native multimodal input, function calling, structured output, or exact public pricing.

Text Reasoning Coding
ERNIE-4.5-21B-A3B is a lightweight member of Baidu’s ERNIE 4.5 family. Its mixture-of-experts design activates approximately 3 billion of its 21 billion total parameters for each token, aiming to reduce inference cost and improve serving efficiency without using a small conventional model. The open-weight release is available under the Apache 2.0 license, with PaddlePaddle and Transformer-compatible formats for local use.
Outputs

What ERNIE-4.5-21B-A3B can produce

Text
Inputs

What it can understand

Text
Capabilities

Support features

Streaming Fine-tuning Batch API
Model profile

Performance characteristics

7/10 Reasoning
7/10 Coding
8/10 Speed
8/10 Cost efficiency
Specifications

Technical details

Family ERNIE 4.5
Type General Purpose
Context window 128K tokens
Max output tokens 12K tokens
Release date 2025-06-29
Status Current and available; open-weight model with hosted inference available through Baidu Qianfan
Knowledge cutoff notes

No authoritative first-party knowledge-cutoff date was found for the exact ERNIE-4.5-21B-A3B model. The 128K context window and hosted web-search or retrieval features, where available in the platform, should not be interpreted as changing the underlying model knowledge cutoff.

Model notes

The exact canonical model identity is ERNIE-4.5-21B-A3B. Baidu describes it as an aligned MoE model with 21B total parameters and 3B active parameters. The model is text-only and is distinct from ERNIE-4.5-VL-28B-A3B. Official model materials list a 128K context window. Qianfan lists the model identifier as ernie-4.5-21b-a3b and supports up to 12,288 output tokens. Baidu's official ERNIE repository documents SFT, SFT-LoRA, DPO, DPO-LoRA, and BF16, W4A16C16, W8A16C16, and FP8 inference options for this model. The Apache 2.0 open-weight release is available in PaddlePaddle and Transformer-style PyTorch formats. Pricing is not populated because a current exact-model public price was not verified from a directly applicable official pricing table. Reasoning, coding, speed, and cost scores are editorial estimates based on the model's lightweight MoE design, published benchmark positioning, long context, and deployment options; they are not vendor-provided scores. The exact model is not listed in the current first-party capability table for web search, function calling, or structured output, so those fields are marked negative rather than inherited from other ERNIE models.

Model guide

ERNIE-4.5-21B-A3B: Baidu’s Efficient 21B MoE Model for Long-Context Text Generation

ERNIE-4.5-21B-A3B is Baidu’s open-weight, text-only mixture-of-experts language model with 21 billion total parameters and approximately 3 billion active parameters per token. It offers a 128K-token context window, supports local deployment and fine-tuning, and is available for hosted inference through Baidu’s Qianfan platform.

What is ERNIE-4.5-21B-A3B?

ERNIE-4.5-21B-A3B is a general-purpose, text-only language model provided by Baidu. The name describes its position in the ERNIE 4.5 family and its mixture-of-experts configuration: the model contains 21 billion total parameters, while approximately 3 billion parameters are active for a given token.

This architecture is intended to make a relatively large model more economical to run. In a conventional dense model, most parameters participate in processing every token. In a mixture-of-experts, or MoE, model, a routing mechanism selects a subset of expert components for each token. The total parameter count therefore describes the model’s overall capacity, while the active parameter count is more relevant to the computation required for each token.

Baidu released ERNIE-4.5-21B-A3B as an open-weight model under the Apache 2.0 license. Official materials provide PaddlePaddle and Transformer-compatible weights, making the model suitable for both self-hosted experimentation and hosted inference through Baidu’s Qianfan platform.

Position in Baidu’s ERNIE lineup

ERNIE-4.5-21B-A3B is the efficient, text-only option described on this page. It should not be confused with Baidu’s multimodal ERNIE-4.5-VL-28B-A3B model. The latter belongs to a different model configuration designed for vision-language tasks, whereas ERNIE-4.5-21B-A3B is intended for text input and text output.

Its combination of 21 billion total parameters, approximately 3 billion active parameters, open weights, and a long context window places it between small models optimized primarily for low-resource inference and larger dense or multimodal systems that may offer broader capabilities at greater serving cost. Baidu’s materials position it for general language tasks, reasoning-oriented workloads, and deployment scenarios where computational efficiency matters.

Key specifications and limits

SpecificationVerified information
ProviderBaidu
Model familyERNIE 4.5
ArchitectureMixture of experts
Total parameters21 billion
Active parametersApproximately 3 billion per token
Context window128,000 tokens
Maximum Qianfan output12,288 tokens
InputText
OutputText
LicenseApache 2.0
Release dateJune 29, 2025

The 128K-token context window is useful for long documents, extended conversations, large collections of source code, and multi-document analysis. The Qianfan limit of 12,288 output tokens applies to the hosted API information supplied for this model. Local deployments may have different practical limits depending on the checkpoint, runtime, available memory, and configuration; no single universal local maximum is established by the supplied research.

Capabilities and modalities

ERNIE-4.5-21B-A3B accepts text and produces text. It does not provide native image, audio, or video input or output according to the available model information. It is therefore appropriate for chat, summarization, translation, extraction, drafting, question answering, and other language-centered workflows, but not for directly interpreting photographs, transcribing audio, generating images, or creating video.

The model’s long context is one of its clearest practical advantages. A developer can provide substantially more material in one request than with a short-context model, although long prompts still increase memory use, latency, and overall inference cost. A 128K window also does not guarantee that every detail in a very long prompt will receive equal attention; applications should still structure documents and test retrieval or summarization quality on their own data.

Official materials supplied for this review do not verify built-in function calling, structured output, web search, or retrieval tools for the exact ERNIE-4.5-21B-A3B model. Those capabilities should not be assumed merely because they may exist for other ERNIE models or as platform-level features. Developers who need reliable machine-readable responses should validate the specific Qianfan endpoint and model documentation rather than treating ordinary text generation as a guaranteed JSON mode.

Reasoning and coding performance

ERNIE-4.5-21B-A3B is intended for general text generation and includes reasoning-oriented use cases in its positioning. Its 21B total-parameter architecture gives it more capacity than a very small language model, while the approximately 3B active-parameter design is intended to keep token processing relatively efficient.

The supplied editorial assessment rates its reasoning and coding capability at 7 out of 10. These are review scores, not Baidu-published benchmark results. They indicate a practical expectation that the model can handle ordinary reasoning, instruction following, code generation, and code explanation, but they should not be interpreted as a verified ranking against other models.

For coding tasks, the long context can help when a request includes multiple files, extended logs, or a large technical specification. However, the available research does not establish native code execution, repository tools, agent actions, or verified function calling. A development workflow should therefore treat generated code as unexecuted output unless external tools are explicitly integrated and tested.

Deployment and efficiency trade-offs

The model’s main technical trade-off is between broad model capacity and lower per-token activation. The MoE configuration can make serving more efficient than processing all 21 billion parameters for every token, but it does not make the model equivalent to a 3B model in every deployment respect. The complete weights, routing behavior, memory requirements, and runtime implementation still matter.

Baidu’s official repository documents supervised fine-tuning, SFT-LoRA, DPO, DPO-LoRA, and several inference formats, including BF16, W4A16C16, W8A16C16, and FP8. These options give operators flexibility to balance quality, memory use, and throughput. The practical result depends on hardware and software support, so the existence of a quantization or precision option should not be read as a guaranteed speed improvement on every system.

The supplied editorial scores rate speed and cost at 8 out of 10. Again, these are subjective estimates based on the lightweight MoE design, hosted positioning, and deployment choices rather than vendor-published measurements. Actual latency and cost will vary with prompt length, output length, concurrency, hardware, quantization, and whether the model is self-hosted or accessed through Qianfan.

Pricing and hosted access

Baidu provides hosted inference through Qianfan and identifies the hosted model as ernie-4.5-21b-a3b. A current, exact public price for this specific model was not verified from a directly applicable official pricing table, so no reliable input-token or output-token price is stated here.

This absence of a verified price does not mean that hosted access is free. Qianfan billing, account requirements, regional availability, quotas, and current promotional terms should be checked directly before deployment. Self-hosting has no per-token API charge from Baidu, but it introduces infrastructure, storage, operations, and monitoring costs.

Best use cases

  • Long-context text analysis: reviewing lengthy documents, specifications, policies, transcripts supplied as text, or collections of related material.
  • Chinese and multilingual generation: drafting, rewriting, summarization, translation, and conversational applications where Baidu’s language-model ecosystem is a good fit.
  • Cost-sensitive hosted inference: applications that need more capacity than a small model while benefiting from an MoE design and Qianfan access.
  • Self-hosted language applications: teams that need open weights, Apache 2.0 licensing, local inference, or the ability to fine-tune the model.
  • Reasoning and coding assistance: text-based analysis, code drafting, explanation, and transformation, provided that outputs are checked and external execution or tools are supplied separately.

When to choose this model

Choose ERNIE-4.5-21B-A3B when you want an open-weight text model with a 128K context window and a potentially favorable capacity-to-compute balance. It is especially appealing when local deployment, fine-tuning, Apache 2.0 licensing, or Baidu Qianfan access is more important than having a verified set of built-in agent features.

It may be a better fit than a smaller dense model when the application benefits from additional model capacity or long prompts. It may also be preferable to a larger, more expensive model when the workload is primarily text-based and does not require image or audio understanding.

Another option may be more appropriate if the application needs native multimodal input, image or media generation, dependable structured-output enforcement, documented function calling, integrated web search, or a verified price and service-level commitment. For visual tasks in particular, the text-only nature of this model means that a vision-language model such as Baidu’s separately identified ERNIE-4.5-VL-28B-A3B should be evaluated instead, subject to that model’s own specifications and availability.

Limitations to check before deployment

  • The model is text-only and cannot directly process images, audio, or video.
  • A verified knowledge-cutoff date is not available for this exact model.
  • Built-in web search, function calling, and structured output are not verified for this exact model.
  • Exact current Qianfan pricing was not verified from a directly applicable official pricing table.
  • Long contexts can increase memory use, latency, and cost even when the nominal context limit is 128K tokens.
  • Local performance depends on hardware, precision, quantization, runtime, and deployment configuration.

Overall, ERNIE-4.5-21B-A3B is best understood as an efficient, open-weight, long-context text model rather than a complete multimodal or agent platform. Its strongest reasons to consider it are the MoE architecture, approximately 3B active parameters, 128K context, local deployment options, fine-tuning support, and Apache 2.0 license. Its suitability should be judged against the application’s need for tools, modalities, pricing certainty, and operational simplicity.


Answers to Frequently Asked Questions

What are the main use cases and limitations of ERNIE-4.5-21B-A3B?
The model is suitable for long-context text analysis, summarization, translation, drafting, question answering, reasoning assistance, coding support, and cost-sensitive language applications. Built-in function calling, structured output, web search, native code execution, exact current Qianfan pricing, and a verified knowledge-cutoff date are not established for this specific model.
What license does ERNIE-4.5-21B-A3B use, and can it be self-hosted?
ERNIE-4.5-21B-A3B is released under the Apache 2.0 license and can be self-hosted using the available PaddlePaddle and Transformer-compatible weights. Baidu also provides hosted inference through Qianfan under the model identifier ernie-4.5-21b-a3b.
Is ERNIE-4.5-21B-A3B a multimodal model?
No. ERNIE-4.5-21B-A3B accepts text input and produces text output only. It does not natively process images, audio, or video. Baidu’s separate ERNIE-4.5-VL-28B-A3B model is intended for vision-language tasks.
What is ERNIE-4.5-21B-A3B?
ERNIE-4.5-21B-A3B is Baidu’s open-weight, text-only mixture-of-experts language model. It has 21 billion total parameters, with approximately 3 billion active parameters used for each token.
What is the context window of ERNIE-4.5-21B-A3B?
ERNIE-4.5-21B-A3B supports a context window of up to 128,000 tokens. This makes it suitable for long documents, extended conversations, large codebases, and multi-document analysis, although longer prompts can increase memory use, latency, and inference cost.


Sources 6
AI Provider

About Baidu