Editorial

ERNIE 5.5 Flash VRAM: 1M Context in 4 GiB of KV

ERNIE 5.5 Flash Preview caches about 4 KiB per token, so 1M tokens of context fit in 4 GiB. The GGUF size picks your hardware.

JJyoti Ranjan SwainUpdated
ERNIE 5.5 Flash Preview: 1M-token KV cache in 4.04 GiB, smallest GGUF 67.96 GiB

Baidu put ERNIE 5.5 Flash Preview on Hugging Face on 23 November 2026 under Apache 2.0. It's a 280B mixture-of-experts model with 14B parameters active per token and a 1,048,576-token context window, tuned for coding agents and office work. Within four days the community had GGUF, MLX and EXL3 builds up, and the Xylolabs GGUF repo alone passed 4,000 downloads.

For a model this size, the usual VRAM question flips. The KV cache is tiny: by my count from config.json, a full 1M-token context costs about 4 GiB in FP8. The weights are the problem. Even the smallest GGUF is 67.96 GiB, so whether you can run it comes down to which file fits your card, and context barely enters into it.

Below is where the memory goes, which file fits which hardware, and the catches that the launch material mentions only in passing.

Table of contents

What Baidu shipped

There are three official repos of the same post-trained checkpoint, plus the base model from October:

RepoPrecisionDownload sizeRuns on
baidu/ERNIE-5.5-Flash-PreviewFP8 blocks, routed experts in MXFP4165.9 GBBlackwell (SM100) only
baidu/ERNIE-5.5-Flash-Preview-FP8FP8 blocks301.9 GBHopper and Blackwell
baidu/ERNIE-5.5-Flash-Preview-BF16BF16599.6 GBanything, and the start point for fine-tuning
baidu/ERNIE-5.5-Flash-BaseFP8 / BF16288.5 GB (FP8)base model, completions only

All three Preview repos bundle a DSpark draft head for speculative decoding. The card calls the Preview "an intermediate checkpoint from post-training" and says the official ERNIE 5.5 Flash release will follow, so expect the weights to change.

The architecture has 43 layers: one dense layer and 42 MoE layers, each with 512 routed experts (10 picked per token) plus one shared expert. The vocabulary is 201,216 tokens. Thinking is on by default.

Why the KV cache is so small

Only 6 of the 43 layers keep a cache entry for every token. Those are layers 7, 14, 21, 28, 35 and 42 in config.json's compress_ratios list, marked -2. They use multi-head latent attention with sparse attention (MLA-DSA), so each token stores one 576-value latent (a 512-value compressed KV plus 64 rotary values), not full keys and values per head.

The other 37 layers use what Baidu calls Heavily Compressed Attention (HCA). The card says HCA "caches one entry per 128 tokens of history". Each layer also keeps a 128-token sliding window. With one KV head of 512 dimensions, a compressed entry holds 1,024 values, so HCA adds 37 x 1,024 / 128 = 296 values per token of history.

ERNIE 5.5 Flash Preview layer stack: 37 HCA layers cache one entry per 128 tokens, 6 MLA-DSA layers cache every token

Add the sparse-attention indexer (6 layers x 128 dimensions, stored in FP4) and the total in the default FP8 cache comes to:

  • MLA latents: 6 x 576 = 3,456 bytes
  • HCA compressed entries: 296 bytes
  • Indexer keys: 768 values at half a byte = 384 bytes
  • Total: 4,136 bytes per token, about 4.04 KiB

The sliding windows add a fixed 4.6 MiB no matter how long the context is. With an FP16 cache, which is llama.cpp's default, the same layout is about 7,888 bytes per token (7.7 KiB). These are my numbers from the config, not Baidu's. Neither the card nor SGLang's cookbook gives a per-token figure.

KV cache by context length

ContextFP8 cache (SGLang default)FP16 cache (llama.cpp default)
32,7680.13 GiB0.24 GiB
131,0720.50 GiB0.96 GiB
262,1441.01 GiB1.93 GiB
1,048,5764.04 GiB7.70 GiB

For scale, Qwen3.8-27B, a model one tenth the size, needs 64 KiB per token in FP16. At 262K tokens that's 16 GiB of cache, and at 1M it would be 64 GiB. ERNIE's FP16 cache is 8.3 times smaller per token. Ling-3.2-air, the other big MoE from last week, sits close at 9 KiB per token, as our Ling-3.2-air VRAM guide worked out.

KV cache at 1M tokens: Qwen3.8-27B 64 GiB, Ling-3.2-air 9 GiB, ERNIE 5.5 Flash 7.7 GiB in FP16 and 4.04 GiB in FP8

The AI VRAM Calculator now has an ERNIE 5.5 Flash preset that reproduces the FP8 line. Its weight options are generic precisions, so put the GGUF size from the next table in yourself.

GGUF files and what they cost in accuracy

Xylolabs converted the MXFP4 release to GGUF without the DSpark head. Their card measures each quant against the original weights. The chat column below is top-1 agreement on chat text, which is the closest of their three test sets to agent use.

FileSizeGiBChat top-1 agreementChat KL
MXFP4-BF16 (original weights)162.20 GB151.06referencereference
Q3_K_M138.51 GB129.0093.82%0.034455
IQ3_XXS127.23 GB118.4992.61%0.050677
Q2_K108.21 GB100.7888.94%0.099800
IQ2_XXS82.84 GB77.1584.04%0.251677
IQ1_M72.97 GB67.9679.51%0.404082

Read the top-1 column as "how often the quant picks the same next token as the full model". Q3_K_M disagrees about once every 16 tokens. IQ1_M disagrees about once every 5. For an agent writing tool calls, a wrong token inside a JSON argument breaks the call, so I wouldn't go below Q2_K for tool use without testing it on your own tasks first.

Which file fits which hardware

I took each card's memory, kept 10% free for compute buffers, and subtracted the file size. What's left goes to the FP16 KV cache. Because the cache is 7.7 KiB per token, every row that fits at all reaches the full 1M-token window.

HardwareLargest file that fitsLeft for KV after 10% headroomContext
96 GB (RTX PRO 6000 Blackwell)IQ2_XXS9.25 GiBfull 1M
128 GB unified (DGX Spark, 128 GB Mac)Q2_K14.42 GiBfull 1M
141 GB (H200)IQ3_XXS8.41 GiBfull 1M
180 GB (B200)MXFP4-BF1610.94 GiBfull 1M

Largest ERNIE 5.5 Flash GGUF per card: IQ2_XXS on 96 GB, Q2_K on 128 GB, IQ3_XXS on H200, original MXFP4 on B200

Two things don't fit where you might expect. IQ3_XXS misses a 128 GB machine by 3.29 GiB, and Q3_K_M misses an H200 by 2.1 GiB. Xylolabs' own table is more cautious than mine: it lists 32K of context for the RTX PRO 6000 and 256K for the 128 GB machines. Treat my numbers as a ceiling and theirs as a safe start. Long prefill also needs activation memory on top; SGLang's cookbook warns that a 1M-token prefill needs "tens of GB".

On a consumer GPU the plan is different. --n-cpu-moe 43 keeps every layer's experts in system RAM, which for Q2_K is 97.9 GB by Xylolabs' estimate. That leaves about 10.3 GB of attention, shared expert and embedding weights on the GPU, plus the cache. So a 24 GB card with 128 GB of system RAM can load Q2_K. Expect it to be slow: each token pulls 10 experts per layer across the PCIe bus.

On Apple silicon, Inferencer's MLX build reports about 28 tokens per second on an M3 Ultra at 22,000 tokens of context, using about 168 GiB. With DSpark on, it measured about 45 tokens per second on coding and 35 on writing, at about 179 GiB.

Serving it for an agent

The GGUF route needs an unmerged llama.cpp branch. Build the commit Xylolabs names:

bash
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
git fetch origin pull/31925/head:ernie5_5
git checkout 7d9d5c35117dc67a70fb0ec6e0fb9e104633c158
cmake -B build -DGGML_CUDA=ON && cmake --build build -j --target llama-server

# 128 GB unified memory: Q2_K, 256K context, one request slot
./build/bin/llama-server \
  -m ERNIE-5.5-Flash-Preview-Q2_K-00001-of-00005.gguf \
  --jinja --chat-template-file chat_template.jinja \
  -ngl 99 -c 262144 -np 1

On datacenter GPUs, use SGLang or vLLM with the official weights. SGLang's cookbook lists the smallest GPU counts per precision:

GPUFP4 (~155 GB)FP8 (~280 GB)BF16 (~560 GB)
B300 / GB300 (288 GB)224
B200 (192 GB)448
H100 (80 GB)not supported82 nodes x 8

Start the server with --reasoning-parser ernie55 --tool-call-parser ernie55 in SGLang (ernie5 in vLLM with the vLLM-ERNIE plugin). Without the tool parser, tool calls come back as <ernie:tool_call> text inside content and your agent won't see them as calls. Both servers expose an OpenAI-compatible API, so Hermes Agent, OpenCode or any client that takes a custom base URL can point at http://localhost:30000/v1. If you're writing tool schemas by hand, the JSON formatter catches the missing comma before the model does.

The card recommends DSpark draft blocks of up to 7 tokens at low concurrency and 2 to 3 at high concurrency. SGLang reports 1,074 tokens per second at an acceptance length of 5.5 with the HALOps kernels, and 1,310 at 7.2.

Benchmarks from the model card

All ERNIE scores are Baidu's own runs. Scores marked with an asterisk in the card are Baidu's runs of the other models too; where the card gives two numbers, I've used the first, the officially reported one.

BenchmarkERNIE 5.5 Flash PreviewHy4DeepSeek-V4.1-FlashGLM-5.3-FlashClaude Opus 5.5
Terminal-Bench 4.046.544.442.335.866.4
DeepSWE v1.171.274.977.063.474.2
MCP-Atlas84.683.077.878.884.2
Toolathlon-Verified75.073.171.278.580.1
SpreadsheetBench V236.434.534.731.535.1
BrowseComp87.491.880.374.690.8
HLE (no tools)46.446.744.039.961.4

It leads its open-weight peers on Terminal-Bench, MCP-Atlas and the spreadsheet test, and it trails Hy4 and DeepSeek-V4.1-Flash on DeepSWE. Against Opus 5.5 it's close on MCP tool use and far behind on Terminal-Bench. The HLE figures for ERNIE, Hy4 and DeepSeek are on the text-only subset. Nobody outside Baidu has reproduced these yet.

Catches before you download 160 GB

  • The default repo needs Blackwell. The 165.9 GB repo keeps routed experts in MXFP4, which SGLang runs only on SM100. On H100 or H200, download the 301.9 GB FP8 repo. GGUF sidesteps this, because llama.cpp dequantizes MXFP4 itself.
  • The GGUF has no draft head. Xylolabs dropped DSpark, so the llama.cpp route gives up the speculative speedup the card advertises.
  • llama.cpp support is a pull request. Release builds of llama.cpp, Ollama and LM Studio won't load it until PR #31925 is merged. Check the PR before you assume your app supports it.
  • The card disagrees with itself about thinking. Its table says enable_thinking: false turns thinking off, while its request section says "The model always thinks before it answers." SGLang's cookbook confirms the switch works if you pass it through chat_template_kwargs. With thinking on, budget for reasoning tokens in max_tokens.
  • The licences differ. The Preview weights are Apache 2.0. The Base model sits under Baidu's own ERNIE 5.5 Flash Base Model License Agreement v1.0, so fine-tunes from Base don't inherit Apache terms.

FAQ

Can ERNIE 5.5 Flash Preview run on a 24 GB GPU?

Only with the experts in system RAM. With --n-cpu-moe 43 and Q2_K, about 10.3 GB of weights stay on the GPU and roughly 98 GB of experts sit in RAM, so you need about 128 GB of system memory. It loads, but every token streams 10 experts per layer from RAM, so it's far slower than a fully GPU-resident setup.

Is ERNIE 5.5 Flash Preview free for commercial use?

The Preview weights are Apache 2.0, which allows commercial use. The Base model has a separate Baidu licence, so check it if you fine-tune from Base.

How much memory does the 1M context need?

About 4.04 GiB for the KV cache in FP8 or 7.7 GiB in FP16, by my count from config.json. Prefill activations at that length add more; SGLang's cookbook says to cut concurrent requests to single digits on 2 x B300 when you run at 1M.

Sources

  • Hugging Face, baidu/ERNIE-5.5-Flash-Preview model card and config.json (23 November 2026): parameter counts, layer layout, compress_ratios, head dimensions, kv_lora_rank, indexer size, precision, DSpark settings, deployment commands, thinking switch, benchmark table, Apache 2.0 licence.
  • Hugging Face API file lists for baidu/ERNIE-5.5-Flash-Preview, -FP8, -BF16 and baidu/ERNIE-5.5-Flash-Base: download sizes and release dates.
  • Hugging Face, baidu/ERNIE-5.5-Flash-Base model card: HCA and MLA design, Base licence.
  • SGLang cookbook, ERNIE-5.5-Flash (docs.sglang.io): GPU counts per precision, FP4 SM100 requirement, FP8 KV default, parsers, long-context and HALOps notes.
  • Hugging Face, Xylolabs/ERNIE-5.5-Flash-Preview-GGUF model card and file list: GGUF sizes, llama.cpp PR #31925 and commit, accuracy tables, hardware suggestions, expert-offload estimate.
  • Hugging Face, inferencerlabs/ERNIE-5.5-Flash-Preview-MLX model card: M3 Ultra speed and memory figures.
  • KV cache per token, GiB conversions and the hardware-fit table are calculated by ToolMintX from those sources, with 10% of each card held back. Real limits depend on runtime and settings.

Tools In This Article

Browser-based, no sign-up. Try them while the topic is fresh.

More From ToolMintX

Other Blog Posts