vLLM/Recipes
Search
Ernie (Baidu)

baidu/ERNIE-5.5-Flash

Deploy ERNIE-5.5-Flash with vLLM: Baidu's 280B-total / 14B-active Mixture-of-Experts model with hybrid HCA + MLA-DSA attention and up to 1M context, served through the vLLM-ERNIE plugin. The Base model (FP8, BF16) with ECHO (MTP) speculative decoding, and the ERNIE-5.5-Flash-Preview chat model (FP4, FP8, BF16) with reasoning, tool calling and DSpark speculative decoding, on B300, GB300, B200, GB200 and H100, with KV cache offload and PD disaggregation.

280B / 14B-active MoE with hybrid HCA + MLA-DSA attention, up to 1M context, ECHO (MTP) and DSpark speculative decoding

moe280B / 14B1,048,576 ctxvLLM 0.32.0+Text
Default configuration: 4× GB200 NVL4 · Data + Expert Parallel · Preview · FP4
export VLLM_ENGINE_READY_TIMEOUT_S=3600
vllm serve baidu/ERNIE-5.5-Flash-Preview \
  --kv-cache-dtype fp8 \
  --max-model-len 131072 \
  --trust-remote-code \
  --reasoning-parser ernie5 \
  --tool-call-parser ernie5 \
  --enable-auto-tool-choice \
  --enable-expert-parallel \
  --port 8100 \
  --data-parallel-size 4 \
  --attention-config '{"indexer_kv_dtype":"mxfp4"}' \
  --speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"probabilistic"}'

The interactive builder loads with JavaScript. Append .md to this page's URL, query string included, for any configuration's command as Markdown — e.g. /baidu/ERNIE-5.5-Flash.md.

Deployment

Pick your hardware, checkpoint and strategy in the builder above to generate the launch command. The FP8 and BF16 recipes run on the recommended (smallest) GPU count through the default presets, and the FP4 recipe on one full node, all with vLLM's defaults and the 128K training context (--max-model-len 131072); size --max-num-seqs and --max-model-len to your own workload. Pick Baseline on the Preset row to use the whole node.

  • Speculative decoding is on by default: ECHO through vLLM's MTP path (2 draft steps) for ERNIE-5.5-Flash-Base, DSpark for ERNIE-5.5-Flash-Preview. It gives the fastest replies for a single user or light load. Turn Spec Decoding off for the most tokens per second across many concurrent requests.
  • PD Cluster. One prefill and one decode GB200 tray, KV over Mooncake RDMA (the default preset on GB200).
GPUFP4 (~155 GB weights)FP8 (~280 GB weights)BF16 (~560 GB weights)
B300 / GB300 (288 GB)1 GPU2 GPUs4 GPUs
B200 (192 GB)2 GPUs4 GPUs8 GPUs
GB200 (192 GB)2 GPUs4 GPUs2 trays × 4 GPUs
H100 (80 GB)4 GPUs8 GPUs2 nodes × 8 GPUs

The table lists the smallest GPU count that holds the weights. FP4 is ERNIE-5.5-Flash-Preview only. It was tested on full 4-GPU GB200 trays, and the builder offers it on Blackwell only. All recipes run attention data parallel and the MoE expert parallel (--data-parallel-size N --enable-expert-parallel).

1. Model introduction

ERNIE-5.5-Flash is an efficient sparse Mixture-of-Experts language model with 280B total and 14B activated parameters per token, pre-trained from scratch on 33.5T tokens with a training context of up to 128K. It comes as two models: ERNIE-5.5-Flash-Base (FP8 and BF16), taken at the end of pre-training before any mid- or post-training, a starting point for domain adaptation, instruction tuning and reinforcement-learning research, served through the completions endpoint; and ERNIE-5.5-Flash-Preview (FP4 / FP8 / BF16), the chat model, with reasoning, tool calling and a bundled DSpark draft.

Its 43 layers are 1 dense FFN layer plus 42 Multi-Router Latent MoE layers. Attention is hybrid: 37 layers use Heavily Compressed Attention (HCA, one cached entry per 128 tokens plus a 128-token sliding window, 512-dim heads) and one in seven, 6 layers, keep full-context access through MLA with DSA sparse attention (256-dim heads). Every attention layer adds a low-rank output gate, Virtual Head Attention (a low-rank post-mix across heads) and QK-norm. Each MoE layer has 512 routed experts (top-10) plus 1 shared expert in a 2048-d latent space, selected by several sigmoid routers. Manifold-constrained hyper-connections (expansion rate 4) replace the residual stream, a MultiMax head produces the logits, and ECHO reuses the final layer as a one-step speculative draft, which vLLM runs through its MTP path.

ModelWeightsUse
ERNIE-5.5-Flash-BaseFP8 / BF16Base model, completions, ECHO
ERNIE-5.5-Flash-PreviewFP4 / FP8 / BF16Chat, reasoning, tool calling, DSpark

All checkpoints share the architecture above: 280B total / 14B activated parameters.

Total parameters include the input embedding and the output head; activated parameters count the output head but not the embedding lookup. Both exclude the 0.36B ECHO parameters. The model was trained with a context of up to 128K tokens (131,072); fine-tuning and inference support up to 1M (1,048,576); pass --max-model-len 1048576 to use it (80 GB GPUs such as H100 reach 262,144).

The FP8 checkpoint uses 128x128 blocks with UE8M0 scales. It keeps the embedding, the output head, the MoE routers, the HCA compressor, the indexer, the VHA post-mix in BF16, and the mHC parameters in FP32; every other linear layer and the routed experts are FP8. The FP4 checkpoint (ERNIE-5.5-Flash-Preview) stores the routed experts in MXFP4 instead (W4A8), about 155 GB in total.

Sampling Defaults. temperature=1.0, top_p=0.95 (from the checkpoint's generation_config.json). vLLM applies them when a request leaves them out and ignores do_sample, so the Base model, whose config sets do_sample=false, also samples at temperature=1.0 by default; pass temperature=0 for greedy decoding.

License. The LICENSE file in each checkpoint; for ERNIE-5.5-Flash-Base, the ERNIE 5.5 Flash Base Model License Agreement v1.0.

vLLM serves the model through the out-of-tree vLLM-ERNIE plugin on the released vLLM 0.32.0 wheel, without modifying vLLM. Set VLLM_USE_MODELSCOPE=True to download from ModelScope; the repo names are the same on both hubs.

2. Configuration tips

  • Parallelism. Data + Expert Parallel holds the most KV cache and gives the highest throughput. Tensor + Expert Parallel (TP 2, 4 or 8) lowers latency at low concurrency but holds less KV cache, since the single KV head is replicated on every TP rank.
  • MoE Kernel. The FP8 recipes on Blackwell pass --moe-backend humming, which supports SiTU with FP8 weights; on Hopper they keep vLLM's default. The FP4 and BF16 recipes use vLLM's default MoE kernel.
  • Long Context. Every recipe passes --max-model-len 131072, the 128K training length. The checkpoint allows 1,048,576: on Blackwell pass --max-model-len 1048576, lower --max-num-seqs so each rank's KV cache holds whole 1M-token requests, and pass --gpu-memory-utilization 0.85, since a 1M-token prefill needs tens of GB of temporary memory on top. On 80 GB GPUs 1M does not fit and vLLM fails at startup; H100 reaches 262,144 at --gpu-memory-utilization 0.93.
  • MXFP4 Indexer. On Blackwell the ERNIE-5.5-Flash-Preview FP4 recipe passes --attention-config '{"indexer_kv_dtype":"mxfp4"}', which keeps the DSA indexer's query and key cache in MXFP4. It needs Blackwell data-center GPUs (sm_10x: B200, GB200, B300, GB300) and the default context parallel sizes; on other GPUs, or with prefill or decode context parallelism, drop it to keep the FP8 indexer. The FP8 and BF16 recipes keep the FP8 indexer.
  • KV Cache. Every recipe passes --kv-cache-dtype fp8, which stores the KV cache in FP8 and is what was tested; auto keeps it in BF16.
  • FlashIndexer. Off by default; pass --hf-overrides '{"enable_flashindexer": true}' to cut the DSA indexer's prefill cost at long context. See 3.6.

3. Advanced usage

3.1 Completions (Base)

As a base model, ERNIE-5.5-Flash-Base continues text: send prompts to /v1/completions. It has no chat, reasoning or tool-call training, so chat requests, --reasoning-parser and --tool-call-parser do not apply. For few-shot use, put the examples in the prompt and stop at the end of one answer.

curl http://localhost:8000/v1/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "baidu/ERNIE-5.5-Flash-Base",
    "prompt": "Question: What is 15% of 240?\nAnswer:",
    "max_tokens": 64,
    "temperature": 0,
    "stop": ["\n"]
  }'

The completion text in the response is 36.

3.2 Chat and reasoning (ERNIE-5.5-Flash-Preview)

ERNIE-5.5-Flash-Preview is the chat model: send messages to /v1/chat/completions. Its commands always pass --trust-remote-code and --reasoning-parser ernie5, so thinking lands in reasoning_content and the answer in content. Thinking is on by default; to turn it off for a request, pass enable_thinking: false through chat_template_kwargs (the chat template reads enable_thinking, not thinking).

# Thinking is on by default.
curl http://localhost:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "baidu/ERNIE-5.5-Flash-Preview",
    "messages": [{"role": "user", "content": "What is 15% of 240?"}],
    "max_tokens": 4096
  }'

# Turn it off for one request.
curl http://localhost:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "baidu/ERNIE-5.5-Flash-Preview",
    "messages": [{"role": "user", "content": "What is 15% of 240?"}],
    "max_tokens": 4096,
    "chat_template_kwargs": {"enable_thinking": false}
  }'

For the FP8 or BF16 checkpoint, set "model" to baidu/ERNIE-5.5-Flash-Preview-FP8 or baidu/ERNIE-5.5-Flash-Preview-BF16. With DSpark and the MXFP4 indexer, the FP4 checkpoint scored 0.9636 on chat GSM8K with thinking off, on GB200 at 1M context.

3.3 Tool calling (ERNIE-5.5-Flash-Preview)

The Preview commands also pass --tool-call-parser ernie5 --enable-auto-tool-choice. Tool calls are returned in message.tool_calls; "parallel_tool_calls": false limits a response to one tool call.

curl http://localhost:8000/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "baidu/ERNIE-5.5-Flash-Preview",
    "messages": [{"role": "user", "content": "What is the weather in Beijing?"}],
    "tools": [{"type": "function", "function": {"name": "get_weather", "description": "Get the current weather in a city", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}],
    "max_tokens": 4096
  }'

3.4 KV cache offload

Long shared prefixes (system prompts, agent histories) can stay outside GPU memory after they leave the GPU cache and be loaded back instead of recomputed. Pick one on the KV Offload row:

  • Simple. Host memory per DP rank (SimpleCPUOffloadConnector). cpu_bytes_to_use_per_rank is pinned per rank, so the rank count times this value must stay below the node's RAM. On a GB200 tray (4 ranks) the default 220 GiB per rank is too much; set it to 128 GiB ("cpu_bytes_to_use_per_rank": 137438953472).
  • CPU + Filesystem. A small CPU staging tier in front of files under root_dir. Point it at fast local NVMe with plenty of space: ERNIE 5.5's KV blocks took about 280 KB per token on disk in our runs.
  • Mooncake (Distributed). Each GPU contributes host memory to a Mooncake pool. Install mooncake-transfer-engine-cuda13 (vLLM 0.32.0 ships CUDA 13), and set MOONCAKE_DEVICE_NAME to the InfiniBand HCAs only, for example mlx5_0,mlx5_1,mlx5_4,mlx5_5 (ibdev2netdev lists them); with the empty default, Ethernet ports are picked too and transfers fail.

3.5 Speculative decoding

ECHO (MTP). The Base checkpoints carry one ECHO layer after the main stack: the backbone's own final layer, trained to predict future tokens, doubles as the draft. vLLM runs it through its MTP path: pick MTP, 1 / 2 / 3 steps under the Spec Decoding toggle, which sets --speculative-config '{"method":"mtp","num_speculative_tokens":N}'. The layer was trained for one future token and can draft several steps by running again; the recipe defaults to 2 steps. Measured on GSM8K at batch size 1 with greedy decoding, the mean accept length is 1.98 / 2.39 / 2.49 tokens per step for 1 / 2 / 3 draft steps, with unchanged accuracy; 2 steps take most of the gain.

DSpark (ERNIE-5.5-Flash-Preview). The Preview checkpoints bundle a 3-layer DSpark draft, conditioned on the target's last 3 layers, that proposes a block of 7 tokens per step; the Base checkpoints carry none. Picking a Preview checkpoint above turns on the DSpark mode: --speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"probabilistic"}'. vLLM's default draft_sample_method is greedy; the recipe uses probabilistic. The mean accept length was about 5.1 tokens per step on the FP4 checkpoint (GB200, PD, 1M context). Turn Spec Decoding off to serve without a draft.

3.6 FlashIndexer

FlashIndexer attaches a lightweight head router to the DSA indexer of the 6 MLA-DSA layers. For each token the router looks only at that token's own hidden state and selects 8 of the 64 indexer heads for sparse selection, which cuts sparse-indexing computation in prefill and keeps the routing cost independent of context length. The DSA interface and the downstream sparse attention are unchanged, and the MTP and DSpark drafts keep all heads. Add to any command:

--hf-overrides '{"enable_flashindexer": true}'

The router weights are read from the checkpoint's flashindexer/ subfolder; a checkpoint without it exits at startup, so drop the flag there to run all heads. FlashIndexer needs CUDA with vLLM's DeepGEMM indexer.

3.7 Prefill / decode disaggregation

Pick PD Cluster as the strategy; on GB200 the 1P1D Mooncake preset is the default. The tested setup is one prefill and one decode GB200 tray with MooncakeConnector over RDMA, each DP4 + EP4, with decode on vLLM's default CUDA graph mode. Install mooncake-transfer-engine-cuda13 on both trays, and set device_name in --kv-transfer-config to the InfiniBand HCAs only (ibdev2netdev lists them). Start prefill, then decode, then the router (tested with vllm-router==0.1.16), and send requests to the router. With speculative decoding, pass the same --speculative-config to the prefill and decode servers. For ERNIE-5.5-Flash-Preview, both servers also get --trust-remote-code and the parser flags; the builder adds them. The FP4 Preview checkpoint was also run as 2P2D GB200 trays at 1M context, where needle retrieval at 128K, 510K and 930K tokens found 9 of 9 needles.

References