[GH-ISSUE #3031] [BUG]: Failed to load model because protobuf parsing failed. #1941

Closed
opened 2026-02-22 18:27:20 -05:00 by yindo · 12 comments
Owner

Originally created by @JasonkayZK on GitHub (Jan 26, 2025).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3031

How are you running AnythingLLM?

Docker (local)

What happened?

After i downloaded all the model here:

$ tree all-MiniLM-L6-v2/
all-MiniLM-L6-v2/
├── config.json
├── onnx
│   ├── model_fp16.onnx
│   ├── model_int8.onnx
│   ├── model.onnx
│   └── model_quantized.onnx
├── README.md
├── special_tokens_map.json
├── tokenizer_config.json
├── tokenizer.json
└── vocab.txt

$ pwd
/root/workspace/anythingllm/models/Xenova

Here is the log:

[backend] info: [RecursiveSplitter] Will split with {"chunkSize":1000,"chunkOverlap":20}
[backend] info: Chunks created from document: 3
Error: Failed to load model because protobuf parsing failed.
    at new OnnxruntimeSessionHandler (/app/server/node_modules/onnxruntime-node/dist/backend.js:27:92)
    at /app/server/node_modules/onnxruntime-node/dist/backend.js:64:29
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. 

[backend] info: [NativeEmbedder] Failed to download model from primary URL. Using fallback https://cdn.useanything.com/support/models/
Error: Failed to load model because protobuf parsing failed.
    at new OnnxruntimeSessionHandler (/app/server/node_modules/onnxruntime-node/dist/backend.js:27:92)
    at /app/server/node_modules/onnxruntime-node/dist/backend.js:64:29
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. 

Any solutions here?

Are there known steps to reproduce?

No response

Originally created by @JasonkayZK on GitHub (Jan 26, 2025). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/3031 ### How are you running AnythingLLM? Docker (local) ### What happened? After i downloaded all the model here: ```bash $ tree all-MiniLM-L6-v2/ all-MiniLM-L6-v2/ ├── config.json ├── onnx │ ├── model_fp16.onnx │ ├── model_int8.onnx │ ├── model.onnx │ └── model_quantized.onnx ├── README.md ├── special_tokens_map.json ├── tokenizer_config.json ├── tokenizer.json └── vocab.txt $ pwd /root/workspace/anythingllm/models/Xenova ``` Here is the log: ``` [backend] info: [RecursiveSplitter] Will split with {"chunkSize":1000,"chunkOverlap":20} [backend] info: Chunks created from document: 3 Error: Failed to load model because protobuf parsing failed. at new OnnxruntimeSessionHandler (/app/server/node_modules/onnxruntime-node/dist/backend.js:27:92) at /app/server/node_modules/onnxruntime-node/dist/backend.js:64:29 at process.processTicksAndRejections (node:internal/process/task_queues:77:11) Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. [backend] info: [NativeEmbedder] Failed to download model from primary URL. Using fallback https://cdn.useanything.com/support/models/ Error: Failed to load model because protobuf parsing failed. at new OnnxruntimeSessionHandler (/app/server/node_modules/onnxruntime-node/dist/backend.js:27:92) at /app/server/node_modules/onnxruntime-node/dist/backend.js:64:29 at process.processTicksAndRejections (node:internal/process/task_queues:77:11) Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. ``` Any solutions here? ### Are there known steps to reproduce? _No response_
yindo added the possible bug label 2026-02-22 18:27:20 -05:00
yindo closed this issue 2026-02-22 18:27:20 -05:00
Author
Owner

@JasonkayZK commented on GitHub (Jan 26, 2025):

Seemed like the same issue here:

https://github.com/Mintplex-Labs/anything-llm/issues/2421

@JasonkayZK commented on GitHub (Jan 26, 2025): Seemed like the same issue here: https://github.com/Mintplex-Labs/anything-llm/issues/2421
Author
Owner

@timothycarambat commented on GitHub (Jan 27, 2025):

It is indeed the same issue, a failed or incomplete file is required to run. It seems it is probably trying to run the fp16 file via WASM - resulting in the crash. It needs to run the model_quantized file.

Image

After i downloaded all the model here:

Does the container have permissions to these files? That would also block loading if you pulled them manually. The Native embedder should only ever run the model_quantized and not pull the entire repo

@timothycarambat commented on GitHub (Jan 27, 2025): It is indeed the same issue, a failed or incomplete file is required to run. It seems it is probably trying to run the fp16 file via WASM - resulting in the crash. It needs to run the model_quantized file. <img width="262" alt="Image" src="https://github.com/user-attachments/assets/b108c080-23cf-409b-bc44-419d817c8b1e" /> > After i downloaded all the model here: Does the container have permissions to these files? That would also block loading if you pulled them manually. The Native embedder should only ever run the `model_quantized` and not pull the entire repo
Author
Owner

@JasonkayZK commented on GitHub (Jan 28, 2025):

Problem sovled, thanks! ❤

@JasonkayZK commented on GitHub (Jan 28, 2025): Problem sovled, thanks! ❤
Author
Owner

@ysun commented on GitHub (Feb 11, 2025):

Hi @JasonkayZK , I met the same issue, the same error log as your mentioned.
May I know how did you sovle the problem?

Image

I pulled the repo manually, and I'm sure the container has permission to all these files.

@ysun commented on GitHub (Feb 11, 2025): Hi @JasonkayZK , I met the same issue, the same error log as your mentioned. May I know how did you sovle the problem? ![Image](https://github.com/user-attachments/assets/daf81e54-a4ba-42fb-8cf1-3ee99ffb9e95) I pulled the repo manually, and I'm sure the container has permission to all these files.
Author
Owner

@ysun commented on GitHub (Feb 11, 2025):

loop @timothycarambat .

And I tried removing other models only keep model_quantized.onnx:
But no helpful.

Image
my error log:

[backend] info: [NativeEmbedder] Initialized                                                                                          
[backend] info: [RecursiveSplitter] Will split with {"chunkSize":1000,"chunkOverlap":20}                                              
[backend] info: Chunks created from document: 769                                                                                     
Error: Failed to load model because protobuf parsing failed.                                                                          
    at new OnnxruntimeSessionHandler (/app/server/node_modules/onnxruntime-node/dist/backend.js:27:92)                                
    at /app/server/node_modules/onnxruntime-node/dist/backend.js:64:29                                                                
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)                                                    
Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback.                         
[backend] info: [NativeEmbedder] Failed to download model from primary URL. Using fallback https://cdn.anythingllm.com/support/models/
Error: Failed to load model because protobuf parsing failed.                                                                          
    at new OnnxruntimeSessionHandler (/app/server/node_modules/onnxruntime-node/dist/backend.js:27:92)                                
    at /app/server/node_modules/onnxruntime-node/dist/backend.js:64:29                                                                
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)                                                    
Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback.                         
@ysun commented on GitHub (Feb 11, 2025): loop @timothycarambat . And I tried removing other models only keep model_quantized.onnx: But no helpful. ![Image](https://github.com/user-attachments/assets/e0c340ee-34f4-4cca-8569-8d0c55f6ec41) my error log: ``` [backend] info: [NativeEmbedder] Initialized [backend] info: [RecursiveSplitter] Will split with {"chunkSize":1000,"chunkOverlap":20} [backend] info: Chunks created from document: 769 Error: Failed to load model because protobuf parsing failed. at new OnnxruntimeSessionHandler (/app/server/node_modules/onnxruntime-node/dist/backend.js:27:92) at /app/server/node_modules/onnxruntime-node/dist/backend.js:64:29 at process.processTicksAndRejections (node:internal/process/task_queues:77:11) Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. [backend] info: [NativeEmbedder] Failed to download model from primary URL. Using fallback https://cdn.anythingllm.com/support/models/ Error: Failed to load model because protobuf parsing failed. at new OnnxruntimeSessionHandler (/app/server/node_modules/onnxruntime-node/dist/backend.js:27:92) at /app/server/node_modules/onnxruntime-node/dist/backend.js:64:29 at process.processTicksAndRejections (node:internal/process/task_queues:77:11) Something went wrong during model construction (most likely a missing operation). Using `wasm` as a fallback. ```
Author
Owner

@timothycarambat commented on GitHub (Feb 11, 2025):

You are still missing config.json

config.json contents:

{
  "_name_or_path": "sentence-transformers/all-MiniLM-L6-v2",
  "architectures": [
    "BertModel"
  ],
  "attention_probs_dropout_prob": 0.1,
  "classifier_dropout": null,
  "gradient_checkpointing": false,
  "hidden_act": "gelu",
  "hidden_dropout_prob": 0.1,
  "hidden_size": 384,
  "initializer_range": 0.02,
  "intermediate_size": 1536,
  "layer_norm_eps": 1e-12,
  "max_position_embeddings": 512,
  "model_type": "bert",
  "num_attention_heads": 12,
  "num_hidden_layers": 6,
  "pad_token_id": 0,
  "position_embedding_type": "absolute",
  "transformers_version": "4.29.2",
  "type_vocab_size": 2,
  "use_cache": true,
  "vocab_size": 30522
}

tokenizer_config.json

{
  "clean_up_tokenization_spaces": true,
  "cls_token": "[CLS]",
  "do_basic_tokenize": true,
  "do_lower_case": true,
  "mask_token": "[MASK]",
  "model_max_length": 512,
  "never_split": null,
  "pad_token": "[PAD]",
  "sep_token": "[SEP]",
  "strip_accents": null,
  "tokenize_chinese_chars": true,
  "tokenizer_class": "BertTokenizer",
  "unk_token": "[UNK]"
}

tokenizer.json is from the model - this wouldn't change.

You can delete the other files that are not present in this screenshot https://github.com/Mintplex-Labs/anything-llm/issues/3031#issuecomment-2616367379

@timothycarambat commented on GitHub (Feb 11, 2025): You are still missing `config.json` `config.json` contents: ```json { "_name_or_path": "sentence-transformers/all-MiniLM-L6-v2", "architectures": [ "BertModel" ], "attention_probs_dropout_prob": 0.1, "classifier_dropout": null, "gradient_checkpointing": false, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 384, "initializer_range": 0.02, "intermediate_size": 1536, "layer_norm_eps": 1e-12, "max_position_embeddings": 512, "model_type": "bert", "num_attention_heads": 12, "num_hidden_layers": 6, "pad_token_id": 0, "position_embedding_type": "absolute", "transformers_version": "4.29.2", "type_vocab_size": 2, "use_cache": true, "vocab_size": 30522 } ``` `tokenizer_config.json` ```json { "clean_up_tokenization_spaces": true, "cls_token": "[CLS]", "do_basic_tokenize": true, "do_lower_case": true, "mask_token": "[MASK]", "model_max_length": 512, "never_split": null, "pad_token": "[PAD]", "sep_token": "[SEP]", "strip_accents": null, "tokenize_chinese_chars": true, "tokenizer_class": "BertTokenizer", "unk_token": "[UNK]" } ``` `tokenizer.json` is from the model - this wouldn't change. You can delete the other files that are not present in this screenshot https://github.com/Mintplex-Labs/anything-llm/issues/3031#issuecomment-2616367379
Author
Owner

@ysun commented on GitHub (Feb 11, 2025):

Appreciate @timothycarambat 's reply. I do have the two configure file and have exactly the same contents as your comments:

Image

And I tried deleting all usless files, only keep the ones mentioned in https://github.com/Mintplex-Labs/anything-llm/issues/3031#issuecomment-2616367379

But no luck, the issue is still there.

BTW, another related question do you know how to configure the network proxy for anythingllm ?
The issue i met I guess can be related to the network env. But I didn't find a configure in .env.example to setup one.

@ysun commented on GitHub (Feb 11, 2025): Appreciate @timothycarambat 's reply. I do have the two configure file and have exactly the same contents as your comments: ![Image](https://github.com/user-attachments/assets/8446fcb7-fd03-4d95-93d4-3c6c10aa01f6) And I tried deleting all usless files, only keep the ones mentioned in https://github.com/Mintplex-Labs/anything-llm/issues/3031#issuecomment-2616367379 But no luck, the issue is still there. BTW, another related question do you know how to configure the network proxy for anythingllm ? The issue i met I guess can be related to the network env. But I didn't find a configure in .env.example to setup one.
Author
Owner

@ysun commented on GitHub (Feb 12, 2025):

Image
Does it mean that I need download some other model manually ? @timothycarambat

@ysun commented on GitHub (Feb 12, 2025): ![Image](https://github.com/user-attachments/assets/6de82488-1610-402c-9b52-881a739db85c) Does it mean that I need download some other model manually ? @timothycarambat
Author
Owner

@JasonkayZK commented on GitHub (Feb 12, 2025):

Hi @JasonkayZK , I met the same issue, the same error log as your mentioned. May I know how did you sovle the problem?

Image

I pulled the repo manually, and I'm sure the container has permission to all these files.

Download this zip file: all-MiniLM-L6-v2.zip

And unzip under models/Xenova/ can solve this issue:

reference:

@JasonkayZK commented on GitHub (Feb 12, 2025): > Hi [@JasonkayZK](https://github.com/JasonkayZK) , I met the same issue, the same error log as your mentioned. May I know how did you sovle the problem? > > ![Image](https://github.com/user-attachments/assets/daf81e54-a4ba-42fb-8cf1-3ee99ffb9e95) > > I pulled the repo manually, and I'm sure the container has permission to all these files. Download this zip file: [all-MiniLM-L6-v2.zip](https://github.com/user-attachments/files/18596293/all-MiniLM-L6-v2.zip) And unzip under `models/Xenova/` can solve this issue: reference: - https://github.com/JasonkayZK/docker-repo/issues/4
Author
Owner

@fishel-feng commented on GitHub (Feb 12, 2025):

Thank you very much @JasonkayZK ! After using the zip package you provided, my problem was solved. However, I’m still confused about why manually downloading these files from Hugging Face didn’t work. Is there anything special about your version? I’ve confirmed that there are no differences in their permissions.

@ysun You can try use JasonkayZK's zip file, you might be experiencing the same issue as I did.

@fishel-feng commented on GitHub (Feb 12, 2025): Thank you very much @JasonkayZK ! After using the zip package you provided, my problem was solved. However, I’m still confused about why manually downloading these files from Hugging Face didn’t work. Is there anything special about your version? I’ve confirmed that there are no differences in their permissions. @ysun You can try use JasonkayZK's zip file, you might be experiencing the same issue as I did.
Author
Owner

@ysun commented on GitHub (Feb 12, 2025):

Awesome! @JasonkayZK's package works well. Thanks @fishel-feng reminding!
It is really confused as fishel-feng mentioned. I checked the code change between the repo and the package JasonkayZK provided, no code change. The only diffence is the permissions of the files, my files having 777 permission while the Jasonkay's package having 755. That doesn't make sense for me. Anyway, the embedded is working now.
Please explain a little bit if anyone knows the real reason.
Appreciate all your quick response! @timothycarambat @fishel-feng @JasonkayZK

@ysun commented on GitHub (Feb 12, 2025): Awesome! @JasonkayZK's package works well. Thanks @fishel-feng reminding! It is really confused as fishel-feng mentioned. I checked the code change between the repo and the package JasonkayZK provided, no code change. The only diffence is the permissions of the files, my files having 777 permission while the Jasonkay's package having 755. That doesn't make sense for me. Anyway, the embedded is working now. Please explain a little bit if anyone knows the real reason. Appreciate all your quick response! @timothycarambat @fishel-feng @JasonkayZK
Author
Owner

@JasonkayZK commented on GitHub (Feb 12, 2025):

Actually i got the same question here.

I found this solution by deploying the desktop version and downloading the model on my Mac.

Then, copy the model onto my server which solved the problem.

But the files seemed the same which also confused me a lot. 😭

Any conclusions here?

@JasonkayZK commented on GitHub (Feb 12, 2025): Actually i got the same question here. I found this solution by deploying the desktop version and downloading the model on my Mac. Then, copy the model onto my server which solved the problem. But the files seemed the same which also confused me a lot. 😭 Any conclusions here?
yindo changed title from [BUG]: Failed to load model because protobuf parsing failed. to [GH-ISSUE #3031] [BUG]: Failed to load model because protobuf parsing failed. 2026-06-05 14:43:33 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1941