Marketplace · Text & chat
ERNIE-4.5-21B-A3B-PT-Q4_K_M
Call ERNIE-4.5-21B-A3B-PT-Q4_K_M through one OpenAI-compatible API, served by independent machines at prices their owners set. There's no host for it on the grid at this moment (last live 22 Nov 2026) — so the next machine that loads it serves every request for it.
The grid is one machine short.
ERNIE-4.5-21B-A3B-PT-Q4_K_M is about 12 GB of weights, so a machine with a little more than that in free memory — a gaming GPU, an Apple-silicon Mac, a well-specced mini PC — can usually serve it. Set your own price — you keep 85% of what it earns, and new hosts start with 12 months fee-free (up to £250 of earnings). A payout fee of £2 + 1% per payout to a UK bank account, £2 + 2% to any other country applies when you're paid.
- Install the connector. One command on the machine that runs your models. It dials out over an encrypted link — no ports to open. The connector
- Load
ERNIE-4.5-21B-A3B-PT-Q4_K_M. It has run here on llama_cpp; any supported engine works. The platform benchmarks it on your hardware first. - Set your price. The last host listed it from £0.06 per 1M output tokens. Developers see your price beside the speed your machine measures.
- Get paid when it's called. Switch it off whenever you like. How hosting works
About ERNIE-4.5-21B-A3B-PT-Q4_K_M.
tools
- Type: Text & chat
- Size: 21B parameters, about 12 GB of weights
- Context window: up to 131,072 tokens
- Runs on: llama_cpp
- Last listed from: £0.06 per 1M output tokens
- First on the grid: 19 Nov 2026
- Hosts serving it now: 0
from openai import OpenAI
client = OpenAI(base_url="https://inpherio.co.uk/v1",
api_key=INPHERIO_API_KEY)
reply = client.chat.completions.create(
model="ERNIE-4.5-21B-A3B-PT-Q4_K_M",
messages=[{"role": "user", "content": "Hello"}],
)ERNIE-4.5-21B-A3B-PT-Q4_K_M in detail.
> [!NOTE] > Note: "**-Paddle**" models use [PaddlePaddle](https://github.com/PaddlePaddle/Paddle) weights, while "**-PT**" models use Transformer-style PyTorch weights.
- Published by
- baidu
- Parameters
- 21.9B
- Format
- transformers
- Architecture
- ernie4_5_moe
- Licence
- Apache 2.0
- Task
- text generation
- Library
- transformers
- Languages
- en, zh
- First published
- 28 Jun 2025
- Last updated
- 26 Nov 2025
- Downloads (30 days)
- 17,413 on Hugging Face
- Likes
- 178
ernie4_5_moe text-generation ERNIE4.5 en zh
The model card
Published by the model's authors on Hugging Face — shown as they wrote it, unedited by Inpherio.
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:
- 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.
- 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.
- 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:
| Key | Value |
|---|---|
| Modality | Text |
| Training Stage | Posttraining |
| Params(Total / Activated) | 21B / 3B |
| Layers | 28 |
| Heads(Q/KV) | 20 / 4 |
| Text Experts(Total / Activated) | 64 / 6 |
| Vision Experts(Total / Activated) | 64 / 6 |
| Shared Experts | 2 |
| Context Length | 131072 |
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)Read the rest of the model card
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={}
}Sources: baidu/ERNIE-4.5-21B-A3B-PT on Hugging Face. Collected from public sources on 19 Nov 2026; the host serving it may run a different build or quantisation — the marketplace shows each host's own measurements.
Live now instead.
Similar text & chat models with hosts serving them right now.
- qwen2.5:0.5b — from £0.009 per 1M output tokens · 5 hosts
- functiongemma:latest — from £0.015 per 1M output tokens · 4 hosts
- glm-ocr:latest — from £0.06 per 1M output tokens · 3 hosts
- granite4.2:3b — from £0.06 per 1M output tokens · 3 hosts
- lfm3:latest — from £0.043 per 1M output tokens · 3 hosts
- llama-guard3:1b — from £0.018 per 1M output tokens · 3 hosts
Questions about ERNIE-4.5-21B-A3B-PT-Q4_K_M.
Can I use ERNIE-4.5-21B-A3B-PT-Q4_K_M through an API?
Yes. Inpherio serves ERNIE-4.5-21B-A3B-PT-Q4_K_M through one OpenAI-compatible API whenever a host on the grid is running it — the code on this page works unchanged. With no host right now, a call returns a "not available on any node" error and is never charged, and similar models are live on the marketplace.
How do I host ERNIE-4.5-21B-A3B-PT-Q4_K_M and get paid?
Install the Inpherio connector on the machine that runs your models, load ERNIE-4.5-21B-A3B-PT-Q4_K_M in a supported engine, and set a price. The platform benchmarks it on your hardware, then requests for it reach your machine. Set your own price — you keep 85% of what it earns, and new hosts start with 12 months fee-free (up to £250 of earnings). A payout fee of £2 + 1% per payout to a UK bank account, £2 + 2% to any other country applies when you're paid.
What hardware does ERNIE-4.5-21B-A3B-PT-Q4_K_M need?
Its weights are about 12 GB, so plan for a little more than that in free GPU or unified memory. Many gaming GPUs, Apple-silicon Macs and mini PCs qualify.
Why is ERNIE-4.5-21B-A3B-PT-Q4_K_M not being served right now?
Hosts on Inpherio are independent machines that come and go. It was last live on 22 Nov 2026. When a host loads it again, this page shows live prices and measured speeds.