Skip to content

Commit 5d22db3

Browse files
authored
Merge pull request #1371 from Klivess/patch-1
docs: add FAQ entry for "unknown model architecture" error
2 parents b5fc51c + 865b846 commit 5d22db3

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

docs/FAQ.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,20 @@ In this inequality, `len(response)` refers to the expected tokens for LLM to gen
6262
## Choose models weight depending on your task
6363

6464
The differences between modes may lead to much different behaviours under the same task. For example, if you're building a chat bot with non-English, a fine-tuned model specially for the language you want to use will have huge effect on the performance.
65+
66+
## Why am I getting "error loading model architecture: unknown model architecture: 'X'"?
67+
68+
This error means the model's architecture is not supported by the version of
69+
llama.cpp that the current LLamaSharp backend is built against.
70+
71+
The most common cause is using a model that was released after your installed version of LLamaSharp. Newer model families require a backend built against a newer llama.cpp commit.
72+
73+
**Solutions, in order of preference:**
74+
75+
1. **Update LLamaSharp** to the latest version and reinstall the matching backend package. Check the version table at the bottom of the README to confirm which model families are verified for each release.
76+
77+
2. **Check the model's publishing date** on Hugging Face. If it was published after your LLamaSharp version, the architecture may not yet be supported - open an issue on the repository to request support.
78+
79+
3. **Compile the compatible llama.cpp build yourself**, then point LLamaSharp to it with NativeLibraryConfig.All.WithLibrary()
80+
81+
> **Caution:** Using a self-compiled library that does not match the LLamaSharp version's expected commit is unsupported and may cause crashes or unexpected behaviour. Only do this as a last resort.

0 commit comments

Comments
 (0)