Architecture
~9 min readUpdated: November 2026

ERNIE 5.5 Flash Preview: 280B-A14B Hybrid MoE, 1M Context & DSpark Agent Serving

ERNIE 5.5 Flash Preview 280B-A14B hybrid MoE banner showing HCA and MLA-DSA attention pipelines, 512 routed experts, and 7-token DSpark speculative decoding

ERNIE 5.5 Flash Preview is Baidu's Apache-2.0 sparse Mixture-of-Experts model with 280B total parameters, 14B active per token, and a 1,048,576-token context window. Combining 37 Heavily Compressed Attention layers, 6 MLA-DSA sparse layers, W4A8 MXFP4 routed experts, FlashIndexer routing, and a 7-token DSpark draft head, it connects to Smoke Monkey Harness over OpenAI-compatible vLLM and SGLang endpoints.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

ERNIE 5.5 Flash Preview: 280B-A14B Hybrid MoE, 1M Context & DSpark Agent Serving: ERNIE 5.5 Flash Preview is Baidu's Apache-2.0 sparse Mixture-of-Experts model with 280B total parameters, 14B active per token, and a 1,048,576-token context window. Combining 37 Heavily Compressed Attention layers, 6 MLA-DSA sparse layers, W4A8 MXFP4 routed experts, FlashIndexer routing, and a 7-token DSpark draft head, it connects to Smoke Monkey Harness over OpenAI-compatible vLLM and SGLang endpoints. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.

Key Architectural Takeaways
Quick Implementation Exampleernie-5-5-flash-preview-agent.ts
ernie-5-5-flash-preview-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Connect Smoke Monkey Harness to a vLLM-ERNIE or SGLang server serving ERNIE 5.5 Flash Preview
const agent = createAgent({
provider: 'openai',
baseUrl: process.env.ERNIE_BASE_URL ?? 'http://127.0.0.1:30000/v1',
apiKey: process.env.ERNIE_API_KEY ?? 'local-ernie55',
model: process.env.ERNIE_MODEL ?? 'baidu/ERNIE-5.5-Flash-Preview',
agentId: 'build',
workspacePath: process.cwd(),
tools: ['filesystem', 'terminal', 'search', 'git', 'agent'],
permission: 'ask-default',
mcp: [
{
id: 'github',
name: 'GitHub MCP',
description: 'Inspect repository pull requests, CI workflows, and open issues',
command: 'npx',
args: ['-y', '@modelcontextprotocol/server-github'],
enabled: true,
},
],
});
// Auto-approve read-only inspection and test verification while gating mutating terminal actions
agent.on('permission.required', (event) => {
const readOnlyAndTestTools = ['read_file', 'grep', 'glob', 'git_diff', 'git_status', 'run_test'];
const decision = readOnlyAndTestTools.includes(event.data.toolName) ? 'allow' : 'deny';
agent.resolvePermission(event.data.toolCallId, decision);
});
agent.on('phase.changed', (event) => {
console.log(`[ERNIE-5.5-Flash-Preview] Phase -> ${event.data.phase}`);
});
async function main() {
const result = await agent.run(
'Trace memory allocation spikes in src/runtime/scheduler.ts, patch the buffer pool, and verify with npm test.'
);
console.log('Status:', result.status, 'Session:', result.sessionId);
}
main().catch(console.error);
Video Guides

Watch: Related Video Guides

What Can Our Open-Weight Foundation Model Build? | ERNIE 5.5 Flash Preview

Baidu Just Released ERNIE 5.5 Flash – FREE API + Coding Tests!

What Is ERNIE 5.5 Flash Preview? Hybrid HCA and MLA-DSA Architecture

ERNIE 5.5 Flash Preview is an Apache-2.0 sparse Mixture-of-Experts language model built on ERNIE 5.5 Flash Base (33.5T pre-training tokens) with 280B total parameters, 14B active per token, and a 1,048,576-token context window. Across 43 layers, it pairs 37 Heavily Compressed Attention layers with 6 MLA-DSA sparse layers.

Instead of paying dense quadratic attention or storing uncompacted KV tensors across every layer at 128K–1M context, ERNIE 5.5 Flash Preview (Ernie5_5_MoeForCausalLM) interleaves six blocks of seven layers each (compress_ratios: 128 for six consecutive layers followed by -2 for the seventh MLA-DSA layer, preceded by dense layer 0).

Core Architectural Modules

  • 37 Heavily Compressed Attention (HCA) Layers: Compresses keys and values at a 128:1 ratio (compress_ratios: 128) alongside a 128-token sliding window (head_dim: 512, qk_nope_head_dim: 448, qk_rope_head_dim: 64, YaRN scaling), cutting per-layer KV footprint by two orders of magnitude.
  • 6 MLA-DSA Sparse Attention Layers: Retains token-level access every seventh layer via Multi-Head Latent Attention (hybrid_mla_attention: mqa_dsa, kv_lora_rank: 512, q_lora_rank: 1024, v_head_dim: 256) paired with a 64-head FP4 DeepSeek-style Sparse Indexer (index_head_dim: 128, index_topk: 2048).
  • Gated Attention & Virtual Head Attention (VHA): Every attention block applies a low-rank sigmoid output gate (gated_attn_use_q_lora: true), per_head QK-norm, and cross-head VHA post-mixing (use_vha_attention: true).
  • Multi-Router Latent MoE & 4-Stream mHC: Layer 0 uses a dense 14,336-dim FFN; layers 1–42 dispatch tokens in a 2,048-dim latent space (moe_latent_size: 2048) to top-10 of 512 routed experts plus 1 shared expert (SiTU-GLU activation, noaux_tc sigmoid routing, routed_scaling_factor: 3.0) over 4-stream manifold-constrained hyper-connections (hc_mult: 4, 20 Sinkhorn iterations).
Architectural ParameterERNIE 5.5 Flash Preview (config.json)
Architecture & LicenseErnie5_5_MoeForCausalLM (ernie5_5_moe), Apache-2.0
Total / Activated Parameters280B (299.56B tensor params w/ DSpark & head) / 14B active
Decoder Layers43 total (1 dense layer 0 + 42 Latent MoE layers)
Attention Layout37 × HCA (head_dim 512, 128:1 ratio) + 6 × MLA-DSA (head_dim 256, top-2048)
Attention Heads & LoRA Ranks64 Q heads, 1 KV head (HCA) / 64 (MLA); Q rank 1,024, KV rank 512, O rank 1,024
MoE Routing & Activation512 routed (top-10) + 1 shared, 2,048 latent/expert width, SiTU-GLU
Residual & Output HeadmHC (hc_mult: 4), untied MultiMax head (201,216 vocab)
Native Context Window1,048,576 tokens (rope_theta: 8,000,000, YaRN factor 16 from 65,536)

ERNIE 5.5 Flash Preview Benchmarks: Agentic Coding, MCP-Atlas & Knowledge Work

Evaluated at maximum reasoning effort across 20 public benchmarks, ERNIE 5.5 Flash Preview scores 84.6 on MCP-Atlas, 61.9 on AutomationBench, 73.5 on SkillsBench 1.1, and 36.4 on SpreadsheetBench V2—outperforming Claude Opus 5.5, GPT-6.1 Sol, and DeepSeek-V4.1-Flash-1017 on key tool and workflow suites.

Post-training targeted long-horizon execution across software engineering (Unreal Engine 5.8, Unity, Godot), procedural 3D scripting (Blender and CAD), and 300,000 simulated finance/legal workspaces containing 10 million reference files across 40+ formats. Notice how strong the 14B-active model stays on multi-turn tool synthesis (Toolathlon-Verified 75.0, BrowseComp 87.4) and calibrated factuality (AA-Omniscience-Public 25.2, more than double DeepSeek-V4.1-Flash-1017's 11.5*).

20-Benchmark Cross-Model Comparison

Benchmark SuiteERNIE 5.5 Flash PreviewHy4DeepSeek-V4.1-Flash-1017GLM-5.3-FlashGLM-5.3GPT-6.1 SolClaude Opus 5.5
Terminal-Bench 4.046.544.4 / 42.4*42.3 / 40.9*35.8 / 37.9*41.8 / 38.8*56.166.4 / 63.6*
DeepSWE v1.171.274.977.063.466.975.274.2
ProgramBench (Almost Solved)29.530.0 / 28.5*29.1 / 27.5*15.0*19.0 / 19.0*–65.0
NL2Repo-Bench64.865.8*68.1 / 62.7*56.3 / 57.5*58.0 / 58.8*––
Terminal-Bench-Science 0.121.019.8 / 17.1*15.7 / 14.3*5.7*8.157.063.3
CookieBench88.288.8*87.9*76.9*80.4*89.7*91.5*
BlenderWorld (text-only)79.076.8*79.2*71.4*69.7*85.3*86.1*
AutomationBench61.956.2 / 55.2*60.5 / 57.2*48.8 / 48.7*48.2 / 50.7*49.3*58.0*
APEX-Agents 1.164.277.6 / 75.0*69.8 / 43.9*52.8 / 52.9*56.6 / 59.2*60.0 / 59.2*73.5 / 72.9*
DRACO84.990.7*83.6*78.4*82.3*79.4*87.4 / 87.9*
SpreadsheetBench V236.434.5*34.7*31.5*32.7*32.0*35.1*
OfficeQA Pro V267.963.8*63.4*64.4*59.3*70.0*62.2
Agents' Last Exam (CLI)29.032.4*35.2*28.6*22.9*29.5*34.3 / 32.4*
SkillsBench 1.1 (text-only)73.577.4*67.5*65.4*62.0*72.6*71.8*
Toolathlon-Verified75.073.1*71.2*78.5 / 76.8*73.0 / 72.2*67.8*80.1*
MCP-Atlas84.683.0*77.8*78.8*82.4*81.0*84.2*
BrowseComp87.491.8*80.3*74.6*77.8*87.5*90.8
HLE (w/o tools, text-only†)46.4†46.7*†44.0†39.942.0†52.961.4
AA-Omniscience-Public25.220.2*11.5*16.0*21.0*52.8*62.0*
AA-LCR v1.179.080.0*82.7 / 80.7*77.3*79.7 / 78.0*83.0 / 78.0*84.7 / 81.7*

W4A8 MXFP4 Quantization, DSpark Speculative Decoding & Kernel Fusion

ERNIE 5.5 Flash Preview eliminates post-training quantization drift by applying W4A8 quantization-aware training directly to its 512 routed experts in MXFP4 (ue8m0 microscaling), keeping remaining weights and KV cache in FP8, and accelerating generation with a 3-layer DSpark draft head and FlashIndexer.

Checkpoint Footprints & Minimum GPU Topology

Because routed experts hold 289.91B of the checkpoint's 299.56B stored tensor parameters (128 safetensors shards), storing them in MXFP4 shrinks disk and VRAM weight footprint to 165.93 GB (~155 GB runtime weight allocation) versus 301.90 GB for FP8 and 599.61 GB for BF16:

Hugging Face RepoWeight FormatRepo Size (Runtime Weights)288 GB GPU192 GB GPU80 GB GPU
baidu/ERNIE-5.5-Flash-PreviewMXFP4 experts (W4A8) + FP8 + DSpark165.93 GB (~155 GB)1 GPU2 GPUs4 GPUs
baidu/ERNIE-5.5-Flash-Preview-FP8Blockwise FP8 ([128,128]) + DSpark301.90 GB (~280 GB)2 GPUs4 GPUs8 GPUs (≤262K)
baidu/ERNIE-5.5-Flash-Preview-BF16BF16 + DSpark (fine-tuning source)599.61 GB (~560 GB)4 GPUs8 GPUs2 × 8 GPUs

DSpark, FlashIndexer & Fused Mega Kernels

  • DSpark Parallel Draft Head: A 3-layer MoE draft head conditioned on target layers [40, 41, 42] (dspark_block_size: 7, dspark_markov_rank: 256) trained via multi-stage D-Pace and on-policy distillation (E2E-TV). It achieves > 4.0 mean acceptance length on real-world coding and agent trajectories (use 7 draft tokens at low concurrency and 2–3 at high concurrency).
  • FlashIndexer (1.4× / 40% 1M-Context Speedup): Attached via flashindexer/flashindexer.safetensors, a per-token router selects 8 of 64 indexer heads and applies threshold pre-filtering before top-2048 selection, keeping indexing cost flat as sequence length reaches 1M tokens.
  • Custom Fused Mega Kernels: Pre-folding VHA cross-head mixing with register-level FP8 quantization runs 1.56×–1.73× faster; merged Multi-Router Latent MoE GEMMs + routing run 3.54×–6.10× faster; single-pass MultiMax activation over 201,216 logits runs 4.33×–6.53× faster; and fused gated attention prefill runs 1.55×–1.75× faster, with HCA compression offloaded to a side stream and PDL hiding launch gaps.

Production Serving Commands: vLLM-ERNIE, SGLang & Thinking Controls

Serve ERNIE 5.5 Flash Preview on day-one production hardware using either the official lmsysorg/sglang:latest container or unmodified vllm==0.32.0 paired with Baidu's vLLM-ERNIE plugin. Both engines expose OpenAI-compatible reasoning and tool-calling endpoints supporting up to 1,048,576 tokens.

1. vLLM 0.32.0 + vLLM-ERNIE Plugin (FP4 / FP8 & FlashIndexer)

bash
# Install official vLLM 0.32.0 and the standalone vLLM-ERNIE entrypoint plugin
uv venv --python 3.12 ernie5-venv && source ernie5-venv/bin/activate
uv pip install vllm==0.32.0
uv pip install git+https://github.com/baidu/vLLM-ERNIE.git

# Serve default W4A8 MXFP4 checkpoint on 4 GPUs with DP attention + Expert Parallelism + DSpark + FlashIndexer
export VLLM_ENGINE_READY_TIMEOUT_S=3600
vllm serve baidu/ERNIE-5.5-Flash-Preview \
  --trust-remote-code \
  --host 0.0.0.0 --port 8000 \
  --data-parallel-size 4 \
  --enable-expert-parallel \
  --kv-cache-dtype fp8 \
  --max-model-len 131072 \
  --reasoning-parser ernie5 \
  --tool-call-parser ernie5 \
  --enable-auto-tool-choice \
  --hf-overrides '{"enable_flashindexer": true}' \
  --attention-config '{"indexer_kv_dtype":"mxfp4"}' \
  --speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"probabilistic"}'

For baidu/ERNIE-5.5-Flash-Preview-FP8 on Blackwell GPUs, swap the model ID, drop --attention-config, and add --moe-backend humming. To raise context up to full 1M, set --max-model-len 1048576 (requires sufficient node VRAM; on 8× 80 GB GPUs serving FP8, --data-parallel-size 8 --gpu-memory-utilization 0.93 fits up to 262144).

2. SGLang Container Deployment (DP Attention + DSpark)

bash
docker run -d -it --name ernie55 \
  --gpus all --network host --ipc host \
  -v ~/.cache/huggingface:/root/.cache/huggingface \
  lmsysorg/sglang:latest

docker exec -it ernie55 sglang serve \
  --model-path baidu/ERNIE-5.5-Flash-Preview \
  --host 0.0.0.0 --port 30000 \
  --tp 4 --attn-dp-size 4 \
  --context-length 131072 \
  --max-running-requests 128 \
  --speculative-algorithm DSPARK \
  --reasoning-parser ernie55 \
  --tool-call-parser ernie55 \
  --enable-dp-lm-head \
  --trust-remote-code

Thinking & Reasoning Effort Request Controls

Thinking is enabled by default (temperature: 1.0, top_p: 0.95 in generation_config.json), returning internal traces in message.reasoning_content, final text in message.content, and structured invocations in message.tool_calls. Set reasoning_effort (low, medium, or high) to budget trace depth, pass "chat_template_kwargs": {"enable_thinking": false} to disable reasoning on fast classification calls, or set "parallel_tool_calls": false to enforce single-step sequential tool calls.

Blackwell vs. Hopper Kernel Flags

The MXFP4 DSA indexer flag (--attention-config '{"indexer_kv_dtype":"mxfp4"}') requires Blackwell datacenter GPUs and default context-parallel layouts; omit it on Hopper (H100/H200) to keep the FP8 indexer. For FP8 weights on Blackwell, add --moe-backend humming, while Hopper keeps the default vLLM MoE kernel.

Orchestrating ERNIE 5.5 Flash Preview in Smoke Monkey Harness & Canvas

Smoke Monkey Harness binds directly to vLLM-ERNIE (:8000/v1) or SGLang (:30000/v1), routing ERNIE 5.5 Flash Preview's reasoning_content and tool_calls outputs through a deterministic 6-phase engineering loop (Explore -> Plan -> Edit -> Verify -> Recover -> Complete) with local MCP sandboxing.

Production Agent Workflow Patterns

  1. Repository-Scale 1M Context Auditing: Feed full monorepo dependency graphs, build logs, and git diff histories into a single @smoke-monkey/harness session without fragmenting architectural invariants across brittle RAG chunks, relying on HCA 128:1 KV compression and FlashIndexer to keep prefill responsive.
  2. Permission-Gated Shell & AST Execution: Set permission: 'ask-default' in createAgent so read-only inspections (read_file, grep, glob, git_status) execute autonomously while mutating terminal writes pause at permission.required.
  3. Multi-Agent Canvas Topology: Start Smoke Monkey Canvas (npx @smoke-monkey/canvas start) to wire a high-effort build agent backed by ERNIE-5.5-Flash-Preview alongside specialized MCP toolkits (GitHub, Postgres, Blender, Playwright) and fast non-thinking (enable_thinking: false) triage subagents.
Google Search Questions & Answers

Frequently Asked Questions

Q:How many GPUs are required to run ERNIE 5.5 Flash Preview in FP4, FP8, and BF16?

According to Baidu's vLLM-ERNIE deployment matrix, the default W4A8 MXFP4 checkpoint (~155 GB runtime weights, 165.93 GB repo) fits on 1x 288 GB GPU, 2x 192 GB GPUs, or 4x 80 GB GPUs. The FP8 checkpoint (~280 GB weights, 301.90 GB repo) requires 2x 288 GB, 4x 192 GB, or 8x 80 GB GPUs (up to 262K context). BF16 (~560 GB weights, 599.61 GB repo) requires 4x 288 GB, 8x 192 GB, or two 8x 80 GB nodes.

Q:How does ERNIE 5.5 Flash Preview handle 1M context without exploding KV cache memory?

Of its 43 decoder layers, 37 use Heavily Compressed Attention (HCA) with a 128:1 compression ratio plus a 128-token sliding window, caching one entry per 128 tokens. Only 6 layers retain token-level MLA access using a top-2048 DeepSeek-style Sparse Indexer (DSA) in FP8/MXFP4.

Q:What is DSpark speculative decoding in ERNIE 5.5 Flash Preview?

DSpark is a bundled 3-layer MoE draft head conditioned on target layers 40, 41, and 42 that proposes blocks of up to 7 tokens in parallel (Markov rank 256). Trained via multi-stage D-Pace and on-policy distillation, it achieves a mean acceptance length above 4.0 on coding and agent workloads.

Q:What is FlashIndexer and how do I enable it in vLLM?

FlashIndexer is a plug-and-play head router shipped in the checkpoint's flashindexer/ directory that selects 8 of 64 DSA indexer heads per token and pre-filters candidates before top-2048 selection, delivering a 40% (1.4x) speedup at 1M context. Enable it in vLLM with --hf-overrides '{"enable_flashindexer": true}'.

Q:How do I disable thinking or adjust reasoning_effort on ERNIE 5.5 Flash Preview?

Thinking is enabled by default and returned in message.reasoning_content. Pass reasoning_effort set to low, medium, or high (default high) to scale thinking depth, or pass "chat_template_kwargs": {"enable_thinking": false} per request to disable thinking entirely.

Q:Does ERNIE 5.5 Flash Preview require a custom vLLM fork?

No. You install the unmodified official vllm==0.32.0 wheel from PyPI alongside the standalone vLLM-ERNIE plugin package (pip install git+https://github.com/baidu/vLLM-ERNIE.git), which auto-registers Ernie5_5_MoeForCausalLM, DSpark, and the ernie5 reasoning and tool-call parsers via vllm.general_plugins.

Related Alternatives & Comparisons

Related Architecture Guides

View all guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness