web-llm icon indicating copy to clipboard operation
web-llm copied to clipboard

I downloaded the model on huggingface locally, can I load the local model?

Open menghan465 opened this issue 8 months ago • 7 comments

I downloaded the model on huggingface locally, can I load the local model?

menghan465 avatar Apr 03 '25 11:04 menghan465

Yes with extra work im doing that now.

atom2-source avatar Apr 11 '25 05:04 atom2-source

https://webllm.mlc.ai/docs/user/basic_usage.html#creating-an-mlcengine

robertgro avatar Apr 30 '25 17:04 robertgro

This example should help: https://github.com/mlc-ai/web-llm/tree/main/examples/simple-chat-upload

CharlieFRuan avatar May 05 '25 06:05 CharlieFRuan

@CharlieFRuan Is there anyway to read .bin directly without first save in either indexdb or caches?

cometta avatar May 06 '25 06:05 cometta

@cometta Hmm is there a specific reason for this? We do have APIs to delete the model weights from cache

CharlieFRuan avatar May 06 '25 21:05 CharlieFRuan

If the model binary files already exist locally, the HTTP server should be configured to read them directly from the local filesystem https://localhost/file.bin, rather than downloading them from a URL and saving them to the cache again

cometta avatar May 07 '25 08:05 cometta

This example should help: https://github.com/mlc-ai/web-llm/tree/main/examples/simple-chat-upload

How it should work exactly?

For instance I've downloaded gemma-2-9b-it-q4f32_1-MLC and started simple-chat-upload.

Is it expected that I'll select all files which I've downloaded or only .bin files?

mchaliadzinau avatar Jul 12 '25 00:07 mchaliadzinau