Back to models
ERNIE-4.5-21B-A3B
Baidu's lightweight open-weight Mixture-of-Experts language model with 21B total and 3B active parameters, delivering high-throughput, low-latency inference across a 128K context window for bilingual tasks.
What you can do
- High-concurrency customer service chat
- Long-document information extraction
- Lightweight private RAG deployment
Input & output
- Input
- Chinese or English chat messages, structured extraction prompts, or documents up to 128K tokens.
- Output
- Fast, low-latency text completions, summaries, structured JSON, or code snippets.
Try a prompt like this
请从以下采购合同条款中提取甲乙双方违约责任、付款账期节点与争议管辖法院,并严格输出为包含字段校验说明的 JSON 格式。
Things to know
Apache-2.0 licensed; requires ~44GB VRAM in BF16 (1×48GB or 2×24GB GPUs), and fits comfortably on a single 24GB GPU when quantized to FP8 or INT4 via vLLM or FastDeploy.
All listed models publish open weights for self-hosted deployment; check each repository's license before commercial use.
Call it through the API
The platform exposes an OpenAI-compatible API. Use an official SDK or any HTTP client, then set the gateway URL, API key, and model ID.
- Endpoint
POST/v1/chat/completions- Model repo ID
PaddlePaddle/ERNIE-4.5-21B-A3B-PT
import os
from openai import OpenAI
client = OpenAI(
base_url=os.environ["API_BASE_URL"],
api_key=os.environ["API_KEY"],
)
response = client.chat.completions.create(
model="PaddlePaddle/ERNIE-4.5-21B-A3B-PT",
messages=[{"role": "user", "content": "请从以下采购合同条款中提取甲乙双方违约责任、付款账期节点与争议管辖法院,并严格输出为包含字段校验说明的 JSON 格式。"}],
)
print(response.choices[0].message.content)Before running a sample, set the API_BASE_URL (gateway URL) and API_KEY environment variables.
Read the full API guide