TellWorldAI World Archive

Home›Practice›Practice

Practice

Deploying the open ERNIE 5.5 Flash Preview weights with SGLang and vLLM

ERNIE 5.5 Flash Preview is Baidu's open-weight MoE text model. This guide covers serving it with SGLang or vLLM and sending a first request.

Who this is for and what you will get

This guide is for developers who have a multi-GPU server and want to host a large model themselves. After reading it you will have ERNIE 5.5 Flash Preview serving requests through SGLang or vLLM, a first test request that works, and an understanding of the main serving parameters.

What ERNIE 5.5 Flash Preview is

ERNIE 5.5 Flash Preview is a text model from Baidu that takes text in and produces text out. It is the first post-trained model built on ERNIE 5.5 Flash Base, and it shares that model's architecture and tokenizer[1]. It is a Mixture-of-Experts model with 280B total parameters, of which 14B are active for each token, and a context window of 1,048,576 tokens[1].

Mid-training extended the training context from 128K to 1M tokens[1]. The model has 43 layers, one dense and 42 MoE. Its hidden size is 4096, and it has 512 routed experts with top-10 routing plus one shared expert. The vocabulary has 201,216 entries[1].

Choosing a weight repository

The Preview comes in three repositories. The default repository, baidu/ERNIE-5.5-Flash-Preview, contains the FP4 expert weights and the DSpark draft head. The -FP8 repository holds blockwise FP8 weights, and the -BF16 repository holds BF16 weights[1]. On hardware without FP4 kernels, use the FP8 or BF16 repository. For fine-tuning, start from the BF16 repository[1].

The Preview ships with the DSpark draft head only, included in the weights. Later releases will offer both DSpark and ECHO MTP[1]. The Apache License 2.0 covers only the Preview weights. ERNIE 5.5 Flash Base remains under its own license[1].

Option 1: serve with SGLang

Start a container from the official prebuilt image and open a shell inside it[1]:

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

Inside the container, start the server with DSpark enabled. The command below uses four-way tensor parallelism and a 131072-token context[1]:

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

For longer inputs, raise --context-length. Both SGLang and vLLM accept up to 1,048,576 tokens[1].

Option 2: serve with vLLM

Create a Python 3.12 environment with uv, install vLLM 0.32.0, and install the ERNIE 5.5 plugin from the vLLM-ERNIE repository[1]:

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

Set VLLM_ENGINE_READY_TIMEOUT_S to 3600, then start the server with data parallel size 4, expert parallelism, an FP8 KV cache and DSpark speculative decoding with 7 tokens[1]:

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"}'

The --max-model-len 131072 setting matches the SGLang default. Raise it for longer inputs[1].

Sending a first request

Once the server is running, send a test request with curl to the chat completions endpoint on port 30000[1]:

curl http://localhost:30000/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "baidu/ERNIE-5.5-Flash-Preview",
    "messages": [{"role": "user", "content": "Explain speculative decoding in two sentences."}],
    "max_tokens": 1024
  }'

The model always thinks before it answers. The reasoning is returned in message.reasoning_content, and the answer is in message.content[1]. If you only want the answer, read message.content and ignore the reasoning field.

Speculative decoding: choosing the draft block size

In speculative decoding, a draft model proposes the next few tokens and the main model verifies them in one forward pass. The DSpark draft head proposes a whole block of tokens in parallel[1]. The model card recommends larger draft blocks, up to 7 tokens, at low concurrency, and blocks of 2 to 3 tokens at high concurrency[1].

Common problems

  • Requests fail beyond 131072 tokens: the command sets a 131072 context. Raise --context-length in SGLang or --max-model-len in vLLM. Both support up to 1,048,576 tokens[1].
  • The GPU has no FP4 kernels: use the FP8 or BF16 repository and change the model path in the launch command to match[1].
  • Fine-tuning: the model card points to the ERNIE 5.5 example in NVIDIA Megatron-Bridge and recommends starting from the BF16 repository[1].

Next step

For fuller deployment instructions, see the SGLang cookbook and the vLLM-ERNIE repository[1].

Adapted from the ERNIE 5.5 Flash Preview model card on Hugging Face[1], released under the Apache-2.0 License.

Sources

  1. 1

Cite this page: Deploying the open ERNIE 5.5 Flash Preview weights with SGLang and vLLM. TellWorld, https://www.tellworld.net/practice/practice-ernie-5-5-flash-preview-deploy. Updated 2026-11-24

Related news

View all