ThinkFacility Sign in

Error messages

llama_model_load: error loading model: error loading model vocabulary: unknown pre-tokenizer type: 'qwen4'

The message

llama_model_load: error loading model: error loading model vocabulary: unknown pre-tokenizer type: 'qwen4'
llama.cpp as of December 6, 2026 read QwenAPI errors

By

What it means

Your llama.cpp build predates Qwen4 support. The qwen4 pre-tokenizer was added in pull request 33626, merged on Dec 3, 2026, so an older binary can't read the vocabulary the file declares.

What to do

Update to llama.cpp build b12969 or later, or to a wrapper that ships one. Ollama 0.40.21 bundles b12973. A fork or app that pins an older llama.cpp needs its own update first.

A GGUF file names the tokenizer rules it was made with, and the Qwen4 files name one called qwen4. A llama.cpp binary from before December 3, 2026 has no entry under that name, so it stops while reading the vocabulary and never gets as far as the weights.

Pre-tokenizer
qwen4
Added by
llama.cpp pull request 33626, model: qwen4
Merged
Dec 3, 2026, as commit 74e7f44
First build
b12969
Ollama
v0.40.21, llama.cpp version bump b12973

Where the fix is

Support went into llama.cpp through pull request 33626, titled "model: qwen4", which ngxson merged into master on Dec 3, 2026. Release b12969 is the build that carries it. Anything older fails on every Qwen4 file, whatever the quantization.

The ggml-org copy of the model says the same thing from the other side.

Requires a llama.cpp build with qwen4_moe support

From ggml-org/Qwen4-35B-A3B-GGUF · Hugging Face

If you run the model through Ollama, the release to look for is 0.40.21. Its notes announce Qwen4-35B-A3B and list a llama.cpp bump to b12973.

What the failure looks like

It's quick. Here's one report, from someone loading unsloth's GGUF onto an RTX 5070 Ti, a quarter of a second after the program started.

llama_model_load: error loading model: error loading model vocabulary: unknown pre-tokenizer type: 'qwen4'

From unsloth/Qwen4-35B-A3B-GGUF · Why is it so big?

The next line, llama_model_load_from_file_impl reporting that it failed to load the model, is a consequence and not a second problem. Unsloth's Daniel Han-Chen answered in that thread: "Do update unsloth and llama.cpp now!"

Why a build that knows qwen4exp still fails

This catches people who already updated once for Qwen3.8-Flash-Next. That model's architecture name was qwen4exp, and a build can know it without knowing the qwen4 pre-tokenizer the released files declare. One project that pins llama.cpp to a November 14 commit hit exactly that, and reported that moving the pin to 74e7f4465 with no other changes made Qwen4-35B-A3B load.

So if your app bundles llama.cpp, the version of the app is what counts. Check which llama.cpp commit it ships before you download the model again. The file isn't broken.

Errors that look like it but aren't

A message that says unknown model architecture: 'qwen4exp' is the older problem, and we cover it on its own page. The same pre-tokenizer line with a different name in the quotes means the same kind of fix for a different model: your build is older than the model's support.