SSD Nodes Learn Hosting plans →
Guides Matt ConnorBy Matt Connor · Updated 2026-11-28

Fix llama.cpp 'unknown model architecture'

llama.cpp refuses a GGUF when your build has no code for its architecture. Read general.architecture and your build number, then pick the right fix.

What the unknown model architecture error means

llama.cpp prints unknown model architecture when a GGUF file names an architecture that your build has no code for. The file is usually fine. Your binary is too old, or support for that model has not been merged yet. A few minutes of checks tell you which case you have, and the fix follows from the answer.

On a current build the error is two lines:

llama_model_load: error loading model: unknown model architecture: 'inkling2_loop'
llama_model_load_from_file_impl: failed to load model

The name inside the single quotes is the architecture string from the file. Write it down, because every later step uses it. Older builds printed a longer first line, such as error loading model architecture: unknown model architecture: 'qwen35', which appeared in an Ollama log from February 2026. It means the same thing. Some front ends also wrap the error in a longer sentence that tells you to check the model card. The cause underneath is the same.

Why llama.cpp cannot load an architecture it does not know

Every GGUF file carries metadata as key and value pairs. The GGUF specification marks general.architecture as one of its required keys. Its value is a short name in lowercase ASCII, such as llama, gpt2, falcon or mamba. When the loader opens a file, it reads that key and looks the string up in a table compiled into the binary. If the string is not in the table, the lookup returns "unknown", and model creation stops with the error above.

That table is code, not data. The llama.cpp guide for contributors says that adding a model starts with a new llm_arch enum value in src/llama-arch.h and a new name in the LLM_ARCH_NAMES map. So a GGUF file cannot teach an old binary a new model. Changing the general.architecture value in the file does not add support either, because the missing piece is the code that runs the new design.

The error also tells you something about the file. The loader reads the architecture key only after the file header and the metadata have parsed. So the header is valid and the metadata is readable. That does not prove the tensor data is complete, but it rules out the most common bad downloads.

Is it this error, or a broken download?

Three other failures get confused with this one. Each prints different words, so read the log line before you change anything.

Start with the first four bytes of the file and its size:

head -c 4 model.gguf; echo
ls -l model.gguf

A real GGUF prints GGUF. The specification requires those four bytes (0x47 0x47 0x55 0x46) at the start of every file. Anything else means the file is not a GGUF. The usual cases are an HTML error page and a Git LFS pointer. llama.cpp then stops early, in its GGUF reader, with a line that ends like this:

invalid magic characters: '<!DO', expected 'GGUF'

The four characters it actually found sit inside the first pair of quotes. A line with failed to load model from and your path follows. The fix is to download the file again from the real file URL.

A download that stopped part way has a valid header, so it gets further. It fails while reading the tensors. The GGUF reader prints failed to read tensor info or failed to read tensor data. The model loader can also stop with corrupted model: <N> tensors expected but <M> found. Compare the size from ls -l with the size on the model page, then download again.

Running out of memory is a separate case. The model loaded and its architecture is known, but the buffers do not fit. You will see failed to allocate ... buffer of size ... or failed to allocate compute pp buffers. Pick a smaller quantization or a shorter context (-c), as covered in running Inkling 2 Mini on a CPU VPS with llama.cpp.

Only unknown model architecture: '<name>' means the build lacks the model. The rest of this guide is about that case.

Step 1: read general.architecture from the GGUF

The llama.cpp project publishes a Python package, gguf, with a gguf-dump command that prints a file's metadata. Install it in its own virtual environment so it stays out of the system Python:

sudo apt install -y python3-venv
python3 -m venv ~/gguf-tools
~/gguf-tools/bin/pip install gguf
~/gguf-tools/bin/gguf-dump --no-tensors model.gguf | grep general.architecture

--no-tensors skips the long tensor list. The output is one line that ends in general.architecture = 'inkling2_loop', or whatever name your file carries. It should match the name in the error. If it does not match, you are loading a different file from the one you think, so check the path in your command or service unit.

No Python on the box? The Hugging Face Hub has a GGUF viewer that shows metadata on model and file pages. Many GGUF model pages also show the architecture in the sidebar. The Unsloth Inkling 2 Mini GGUF page, for example, shows inkling2_loop there.

Step 2: find the llama.cpp build you are really running

People often upgrade one copy of llama.cpp and keep running another. List every copy on your PATH first, then ask the first one for its version:

type -a llama-server llama-cli
llama-server --version

--version shows version and build info. On a current build the first line has the form version: ... (build <number>, commit <hash>). Older builds print a shorter line. The number you need is the build number. It matches the release tag, so build 12611 is tag b12611.

If llama.cpp runs as a systemd service, the binary on your PATH may not be the one the service starts. Read the unit, find its ExecStart= line, and run that exact path with --version:

systemctl cat llama-server

Use your own unit name in place of llama-server. Running llama-server on a VPS shows a full service setup. The llama.cpp README now also documents a single llama command (llama serve, llama cli) with its own install script. That is a separate file from llama-server, so check which one your service actually starts.

Step 3: find the release that added the architecture

Now you have two facts: the architecture name in the file, and the build number of your binary. The third fact is the first build that knows the name. A full source checkout answers it, because the names live in src/llama-arch.cpp. Do not use --depth 1 here, because the search needs the whole history and the tags.

sudo apt install -y git
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
grep -n '"inkling2_loop"' src/llama-arch.cpp
COMMIT=$(git log --reverse --format=%h -S'"inkling2_loop"' -- src/llama-arch.cpp | head -n 1)
echo "$COMMIT"
git tag --contains "$COMMIT" --sort=v:refname | head -n 1

grep tells you whether current master knows the name at all. git log -S finds the commit that first added the string, and git tag --contains prints the oldest build tag that includes that commit. If your build number is lower than that tag, upgrading fixes the load error.

If grep finds nothing, support is not in master yet. Search the open pull requests on the llama.cpp GitHub page for the architecture name or the model name. The GGUF page usually links the PR it depends on.

Then read the model card for a minimum build, because the first build that knows a name is not always good enough. Inkling 2 Mini shows why. Unsloth's Mainline_Support README for its GGUF files says: "any mainline build from b12611 on works." It also says older builds "give wrong output (perplexity about 130 instead of 7.65)". The reason it gives: they lose the per-expert NVFP4 scales on the second and third passes through the looped layers. Those older builds do not print the architecture error, so nothing warns you. The fix, PR #32704, is listed in the release notes of b12611, published on 21 November 2026. When the card names a build, that build is your floor.

Step 4: pick the fix that matches what you found

What you found in steps 1 to 3 decides the fix:

  1. Support is merged, and your build is older: upgrade to a pinned release tag at or above the one you found.
  2. The model card names a different runtime, and llama.cpp is not on its list: use that runtime.
  3. Support is an open PR, and you need the model now: build the PR branch in a separate directory.
  4. Support is an open PR, and you can wait: watch the PR, then upgrade to the first build tag whose release notes list it.

Upgrade to a pinned release tag

llama.cpp publishes build tags, bNNNN, with prebuilt binaries attached. The example below pins b12728, released on 25 November 2026. Download the Ubuntu x64 archive for the tag you chose:

TAG=b12728
mkdir -p ~/llama-$TAG && cd ~/llama-$TAG
curl -fLO https://github.com/ggml-org/llama.cpp/releases/download/$TAG/llama-$TAG-bin-ubuntu-x64.tar.gz
tar xzf llama-$TAG-bin-ubuntu-x64.tar.gz
find . -name llama-server -type f

Run the path that find prints with --version, and confirm the build number before you point your service at it. To build the same tag from source instead:

sudo apt install -y build-essential cmake git libssl-dev
git clone https://github.com/ggml-org/llama.cpp
cd llama.cpp
git checkout b12728
cmake -B build
cmake --build build --config Release -j
./build/bin/llama-server --version

libssl-dev is optional. The build docs say that without it llama.cpp builds and runs with no HTTPS support.

Watch the labels on the releases page. The bNNNN builds are marked Pre-release. A separate v1.1.0 release, published on 26 November 2026, carries the Latest label. From v1.0.0 on, the project marks API and ABI breaks with major version bumps. "Latest" here does not mean newest build. v1.0.0 was released on 13 November 2026, eight days before b12611, so it is not the right pick for Inkling 2 Mini. v1.1.0 includes Inkling 2 Mini support and the loop scale fix. For a model added this month, choose by build number. Pin that exact tag, and do not track master on a server that other people use. Pinning llama.cpp releases on a server walks through keeping one tag in place on purpose.

Use the runtime the model card names

A third party can publish a GGUF before llama.cpp supports the model. The model card from the original publisher tells you what runs it. The Inkling 2 Mini card lists llama.cpp "for quantized GGUF versions", next to Hugging Face, SGLang, vLLM and others. It also warns that support for looped models in local runtimes is new. The Hy4 Flash card from Tencent names other runtimes, among them vLLM and SGLang, and not llama.cpp. If llama.cpp is not on the card, treat any GGUF of that model as early, and check the GGUF page for the build or PR it needs.

Build an open PR branch, carefully

You can build a PR before it merges. GitHub exposes every PR as a ref, so this fetches the earlier Hy4 Flash PR into a local branch. That PR is now closed; mainline support landed through PR #32960, so use a release containing that change for Hy4 Flash.

cd ~/llama.cpp
git fetch origin pull/32517/head:hy4-flash
git checkout hy4-flash
cmake -B build-hy4
cmake --build build-hy4 --config Release -j

Keep the result in its own build directory, and do not replace the binary your service uses. An open PR can still change before it merges. A GGUF made against the branch may then stop loading on the merged version. Before you spend time on a build, check that the name gguf-dump prints matches the name the PR adds.

Ollama: the same failure as a 500 error

Ollama runs a bundled copy of llama.cpp, pinned to one build. When that build lacks an architecture, the client shows only this:

Error: 500 Internal Server Error: unable to load model

The real reason is in the server log. On Linux with systemd, Ollama's troubleshooting docs give journalctl -u ollama --no-pager --follow --pager-end. To find this error quickly:

journalctl -u ollama --no-pager | grep -i 'unknown model architecture'
ollama --version

In February 2026 this hit Qwen 3.5 models on Ollama 0.17.0 (issue #14419). The log said unknown model architecture: 'qwen35', and the maintainer closed the issue with: "the initial problem of loading qwen35 is resolved by using 0.17.1+." In November 2026 the Inkling 2 Mini import issue (#19817) logged unknown model architecture: 'inkling2_loop' for one GGUF and 'inkling2' for another. The cause was Ollama's bundled llama.cpp, which was pinned at b12257 from 10 November. Ollama v0.40.18, released on 24 November 2026, moved the bundled copy to b12651, which is later than b12611. Those release notes do not say that Inkling GGUF import now works, so test it yourself after you update.

Upgrading your own llama.cpp does not change the copy inside Ollama. Update Ollama, or run llama.cpp directly for that model. Ollama vs llama.cpp compares the two, and importing a GGUF into Ollama covers the Modelfile route once the bundled build is new enough.

Vision models add a second file, the projector, with its own type string. An old build rejects it with a separate line, such as unknown projector type: inkling2v from the same Ollama issue. The cause and the fixes are the same.

This month's cases, as of 27 November 2026

Inkling 2 Mini: inkling2_loop

Inkling 2 Mini uses inkling2_loop, a separate architecture from inkling2. Current master has both names in its table. Unsloth's Mainline_Support README says any mainline build from b12611 on works. Its files use a .gguf_file extension, so rename each one to .gguf after downloading. PR #32695, which some replies still cite, is a draft and was not the PR that landed. Use a release tag instead.

Inkling 2 Small: inkling2

The Unsloth GGUF page for Inkling 2 Small says it "uses a new inkling2 architecture", and that builds that only support the original Inkling will not load it. Some quantizations (UD-Q3_K_XL, UD-Q4_K_XL, Q8_0 and UD-Q8_K_XL) also need per-expert scale support from PR #32657. Without it llama.cpp stops with wrong number of tensors. That is a different error from this one, with a related cause. Can you run Inkling 2 Small covers the hardware side.

Kolibri 1.1: a known name that still fails

Master already has kolibri1 in its table, and the Kolibri 1.1 GGUF page shows that name in its sidebar. The model card still says: "llama.cpp can't load Kolibri 1.1 until [ggml-org/llama.cpp#32891] merges; until then, build llama.cpp from that PR." The PR was open when we checked, and it adds a new GGML operation. So a known architecture name is not proof of support. We have not tested which error 1.1 gives on a current build, so read your own log line. The main Kolibri 1.1 card names a vLLM plugin as its primary route.

Hy4 Flash: hy_v4_flash, now merged

Support landed through PR #32960 and is included in b12755 and v1.1.0. PR #32517 is now closed. Master has hy_v3, hy_v4 and hy_v4_flash. The AngelSlim GGUF page still tells you to check out the older PR branch. Its sidebar shows the architecture as hy_v4_next_dfly, which is not the name the PR adds. This is exactly the case where gguf-dump saves you a wasted build.

FAQ

Why does llama.cpp say "unknown model architecture" for a GGUF I just downloaded?

The file's general.architecture key names a model design that your llama.cpp binary has no code for. Support is compiled into the binary, so an older build cannot load a newer architecture. Read the name with gguf-dump --no-tensors model.gguf, check your build with llama-server --version, and upgrade to a release tag that includes the architecture. If master does not have it yet, support is still an open pull request.

Which llama.cpp version do I need for my model?

Check the model card first, because some name a minimum build. Unsloth's Inkling 2 Mini files say any mainline build from b12611 works, and older builds load the file but give wrong output. If the card is silent, run git log --reverse -S'"<name>"' -- src/llama-arch.cpp in a full llama.cpp checkout to find the commit that added the name. Then git tag --contains <commit> lists the build tags that include it.

Why does Ollama only say "500 Internal Server Error: unable to load model"?

Ollama hides the llama.cpp error behind a generic 500. On a Linux systemd install, run journalctl -u ollama --no-pager | grep -i 'unknown model architecture' to see the real line. If it is there, Ollama's bundled llama.cpp is too old for the model. Updating your own llama.cpp does not help. Update Ollama, or run the model with llama.cpp directly.

Is my GGUF file corrupted?

Probably not, if the error names an architecture. The loader reads that key only after the header and metadata parse. A file that is not a GGUF fails earlier with invalid magic characters: '....', expected 'GGUF'. A truncated file fails on the tensors with failed to read tensor data or corrupted model: <N> tensors expected but <M> found. Run head -c 4 model.gguf to confirm it starts with GGUF, and compare its size with the model page.

Was this article useful?