---
title: How to Run ERNIE 5.5 Flash Preview Locally (vLLM, SGLang)
url: "https://goremy.ai/blog/articles/ernie-5-5-flash-preview-run-locally-vllm-sglang"
author: Luis Chavez-Mattos
editor: Luis Chavez-Mattos
editor_title: Director, Product
published: "2026-11-25T02:40:28.675Z"
updated: "2026-11-25T02:40:28.675Z"
topic: Local AI
description: ERNIE 5.5 Flash Preview is a 280B MoE with 14B active and 1M context. Which weights to download, what hardware, and vLLM and SGLang commands.
---

# How to Run ERNIE 5.5 Flash Preview Locally (vLLM, SGLang)

> ERNIE 5.5 Flash Preview is a 280B MoE with 14B active and 1M context. Which weights to download, what hardware, and vLLM and SGLang commands.

Edited by Luis Chavez-Mattos, Director, Product · Published 2026-11-25

## How do you run ERNIE 5.5 Flash Preview locally?

You download one of three weight sets from Hugging Face (FP4+FP8, FP8 or BF16), then serve it with vLLM or SGLang on a multi-GPU machine. The model has 280 billion total parameters, with 14 billion active per token, and it supports a 1M-token context window. The model card's example commands both assume four GPUs. The default download uses 4-bit expert weights, so you need hardware with FP4 support. Otherwise, pick the FP8 or BF16 repository. The license is Apache 2.0.

"Locally" here means your own servers, not your laptop. This is a data-center-sized model.

## TL;DR

- ERNIE 5.5 Flash Preview is a **280B-parameter Mixture-of-Experts model with 14B active per token**, so each step costs far less compute than the total size suggests, though all the weights still have to fit in memory.
- There are **three weight variants**: the default repository (FP8 plus FP4 experts), an FP8 repository and a BF16 repository. All three include the DSpark draft head and support 1M context.
- **Use the default repository if your GPUs have FP4 kernels.** Otherwise use FP8 or BF16, and start from BF16 if you plan to fine-tune.
- The published **vLLM and SGLang commands both use four-way parallelism and a 131,072-token context**. Raise the context setting to reach the full 1,048,576 tokens.
- **DSpark speculative decoding** speeds up generation. Baidu recommends draft blocks of up to 7 tokens at low traffic and 2 to 3 at high traffic.
- It is **Apache 2.0 licensed**, but it is also an intermediate checkpoint, so expect rough edges.

## What is ERNIE 5.5 Flash Preview?

It is an open-weight language model from Baidu. It is the first post-trained model built on ERNIE 5.5 Flash Base, and it takes text in and gives text out. Baidu describes it as an intermediate checkpoint from post-training, which means training is not finished and some capabilities may fall short of the eventual official release.

The architecture is a Mixture-of-Experts (MoE) design. Think of a large team of specialists where only a few work on each word. This model has 512 routed experts plus one shared expert, and 10 routed experts handle each token. That is how a 280B model only uses 14B parameters per token.

Other specs from the model card:

| Spec | Value |
| --- | --- |
| Layers | 43 (1 dense + 42 MoE) |
| Hidden size | 4096 |
| Vocabulary | 201,216 |
| Context length | 1,048,576 tokens |
| Thinking | On by default. Turn off with `enable_thinking: false`. When on, `reasoning_effort` can be low, medium or high (default high). |
| Precision | Blockwise FP8, routed experts in MXFP4 (W4A8), FP8 KV cache, FP4 indexer |

Baidu says it is trained for coding, 3D modeling, knowledge work (spreadsheets, documents, slide decks) and video creation. On its own benchmark table it trails Claude Opus 5.5 on several agentic coding tests (Terminal-Bench 4.0: 46.5 versus 66.4 reported), and it is close or ahead on others (MCP-Atlas: 84.6 versus 84.2). All ERNIE scores come from Baidu's own evaluations, so treat them as a starting point and test on your own tasks.

## Which weights should you download?

There are three repositories, and all include the DSpark draft head and a 1M context.

| Repository | Weights | When to use it |
| --- | --- | --- |
| `baidu/ERNIE-5.5-Flash-Preview` | FP8 (blockwise) + FP4 experts | Default. Smallest, needs FP4 kernels. |
| `baidu/ERNIE-5.5-Flash-Preview-FP8` | FP8 (blockwise) | Hardware without FP4 kernels. |
| `baidu/ERNIE-5.5-Flash-Preview-BF16` | BF16 | No FP4 or FP8 support, or fine-tuning. |

The model card says the default repository contains the FP4 expert weights, and that you should switch to FP8 or BF16 on hardware without FP4 kernels. For fine-tuning, start from BF16. The same weights are on ModelScope.

The FP4 version is not a lossy shrink applied after the fact. Baidu trained the model with W4A8 quantization-aware training (4-bit weights, 8-bit activations), using the same rounding and scaling rules as inference. The card says the released weights deploy directly with no extra conversion or calibration.

## How much hardware does it need?

The model card does not publish a minimum VRAM figure, so I can only give you rough arithmetic and what the examples assume.

Weight size is parameters times bytes per parameter. At 280B parameters, BF16 (2 bytes each) is roughly 560 GB of weights. FP8 (1 byte each) is roughly 280 GB. The default FP4-expert version is smaller than FP8, since the experts hold most of the parameters. These are my estimates, not official numbers, and they exclude the KV cache (the memory the model uses to remember the conversation so far) and the draft head.

What the card does tell you:

- Both example commands split the model across **four GPUs**.
- The SGLang cookbook has a hardware selector, and its sample link is set to B300 GPUs with FP8, the low-latency strategy and a single node.
- Memory use grows with context length, so start at 131,072 tokens and raise it only when you need to.

In practice, plan for a multi-GPU server, and check the SGLang Cookbook and the vLLM-ERNIE repository for your exact hardware before ordering anything.

## How do you serve it with SGLang?

Start a container from the official image, mounting your Hugging Face cache so the weights download once and persist:

```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 bash
```

Then, inside the container, launch the server with DSpark on:

```bash
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
```

What the flags do:

- `--tp 4` and `--attn-dp-size 4` spread the model across four GPUs.
- `--context-length 131072` sets the context window. Raise it up to 1,048,576 for longer inputs.
- `--speculative-algorithm DSPARK` turns on the draft head (more on this below).
- `--reasoning-parser ernie55` and `--tool-call-parser ernie55` split the model's reasoning from its answer and handle tool calls.

The card's copy of this command has a stray space after one line-continuation backslash. That breaks the command in a shell, so make sure nothing follows the backslashes.

## How do you serve it with vLLM?

vLLM needs a plugin for this model. Create a Python 3.12 environment and install both:

```bash
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
```

Then start the server:

```bash
export VLLM_ENGINE_READY_TIMEOUT_S=3600
vllm serve baidu/ERNIE-5.5-Flash-Preview \
    --trust-remote-code \
    --host 0.0.0.0 \
    --port 30000 \
    --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 \
    --attention-config '{"indexer_kv_dtype":"mxfp4"}' \
    --speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"probabilistic"}'
```

Two details are easy to miss. The parser name is `ernie5` in vLLM but `ernie55` in SGLang. And the one-hour engine timeout exists because the first start, which loads a very large model, can take a long time.

`--enable-expert-parallel` places different experts on different GPUs, which suits an MoE model. `--kv-cache-dtype fp8` matches the model's FP8 KV cache.

## How do you test that the server works?

Both servers listen on port 30000 in these examples and speak the common OpenAI-style chat format. This request is a standard pattern, not from the model card:

```bash
curl http://localhost:30000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "baidu/ERNIE-5.5-Flash-Preview",
    "messages": [{"role": "user", "content": "Summarize what a Mixture-of-Experts model is in two sentences."}]
  }'
```

Because thinking is on by default, expect the model's reasoning to come back separately from the final answer (the card says it appears in `reasoning_content`). For quick, simple tasks you can switch thinking off with `enable_thinking: false`, or lower `reasoning_effort`.

## How do you use the full 1M-token context?

Both commands cap context at 131,072 tokens. The card says both servers accept up to 1,048,576, and you change one flag: `--context-length` in SGLang or `--max-model-len` in vLLM.

The architecture is built to make this less painful than usual. Of the 43 layers, 37 use Heavily Compressed Attention, which stores one cache entry per 128 tokens of history. The other six use sparse attention and look at only the 2,048 highest-scoring positions. At 1M tokens, Baidu says its indexer optimization gives a 40% speedup. Even so, a million tokens is a lot of memory, so raise the limit in steps and watch GPU usage.

## What is DSpark and how should you tune it?

Speculative decoding is a speed trick. A small draft component guesses the next several tokens, and the main model checks all of them in one pass. When the guesses are right, you get several tokens for the price of one step.

DSpark is the Preview's draft head. It proposes a whole block of tokens in parallel, and it is bundled in the weights. The card says the Preview ships with DSpark only, and that later releases will offer both DSpark and ECHO multi-token prediction.

The tuning advice is about traffic:

- **Low concurrency** (a few users or one agent): use larger draft blocks, up to 7 tokens. That is what the vLLM command sets.
- **High concurrency** (many simultaneous requests): use smaller blocks of 2 to 3 tokens. In vLLM, change `num_speculative_tokens` to 2 or 3.

## What does this mean for you?

**If you are a developer or run infrastructure:** this is a serious open-weight option for self-hosting, with commercial-friendly Apache 2.0 licensing, but it needs a multi-GPU server. Start with the FP8 or default repository, serve at 131,072 context, and test on your own tasks before trusting any benchmark table, especially since it is a Preview.

**If you are a manager or analyst:** the main reason to self-host is control, meaning your documents never leave your environment. The cost is hardware and someone to operate it. Ask your IT team whether you already have suitable GPUs before the conversation goes further. Baidu also lists a hosted API (Qianfan), which is a cheaper way to evaluate the model first.

**If you only want a chatbot:** you do not need any of this. Use a hosted product.

## Can you build an internal tool around a self-hosted model?

Yes, and the model server is only half the job. Someone still has to build the request form, the document-intake page or the dashboard that people use. [Remy](https://goremy.ai) builds full-stack business apps from a plain-English description, and it supports registering custom or self-hosted models, or reaching local models over a secure tunnel. A team running a model like this could describe, say, a contract-review queue or an internal research tracker, and have a deployed app with login and a database behind it, instead of passing results around in spreadsheets.

## Frequently Asked Questions

### Can I run ERNIE 5.5 Flash Preview on a single consumer GPU?

The model card gives no such configuration. Its examples use four GPUs, and 280B parameters is far beyond typical consumer memory even at 4 bits for the experts. Plan for a multi-GPU server.

### Is ERNIE 5.5 Flash Preview free for commercial use?

The model card lists the license as Apache 2.0, which generally permits commercial use. Read the LICENSE file in the repository and have your legal team confirm for your case.

### What is the difference between the FP4, FP8 and BF16 versions?

They store the weights at different precision. The default repository uses FP8 for most weights and FP4 for the routed experts, so it is the smallest. FP8 is for hardware without FP4 kernels, and BF16 is the largest and the starting point for fine-tuning.

### Why does the Preview need a plugin for vLLM?

The model uses its own attention and expert designs. The vLLM-ERNIE plugin adds support for them on top of vLLM 0.32.0, and Baidu's SGLang route works through the prebuilt Docker image.

### Is the Preview ready for production?

Baidu says it can be served in production with SGLang or vLLM, but also calls it an intermediate checkpoint with unfinished training. Pilot it on real workloads and plan to upgrade when the official release arrives.
