Live data from Hacker News

Show HN: I built a free in-browser Llama 3 chatbot powered by WebGPU

github.com

1–10 of 150 posts

Show HN: I built a free in-browser Llama 3 chatbot powered by WebGPU

#1
I spent the last few days building out a nicer ChatGPT-like interface to use Mistral 7B and Llama 3 fully within a browser (no deps and installs).

I’ve used the WebLLM project by MLC AI for a while to interact with LLMs in the browser when handling sensitive data but I found their UI quite lacking for serious use so I built a much better interface around WebLLM.

I’ve been using it as a therapist and coach. And it’s wonderful knowing that my personal information never leaves my local computer.

Should work on Desktop with Chrome or Edge. Other browsers are adding WebGPU support as well - see the Github for details on how you can get it to work on other browsers.

Note: after you send the first message, the model will be downloaded to your browser cache. That can take a while depending on the model and your internet connection. But on subsequent page loads, the model should be loaded from the IndexedDB cache so it should be much faster.

The project is open source (Apache 2.0) on Github. If you like it, I’d love contributions, particularly around making the first load faster.

Github: https://github.com/abi/secret-llama Demo: https://secretllama.com

Show HN: I built a free in-browser Llama 3 chatbot powered by WebGPU
github.com

Re: Show HN: I built a free in-browser Llama 3 chatbot powered by WebGPU

#5

Is this downloading a ~5gb model to my machine and storing it locally for subsequent use?

Yes, it only starts the download after you send the first message so visiting the site won’t use up any space.

Approx sizes are listed in the GitHub README.

Models are stored in indexeddb and will be managed by the browser. Might get evicted.

Re: Show HN: I built a free in-browser Llama 3 chatbot powered by WebGPU

#6
Nice demo! I briefly tried it out and the demo felt much better than the original WebLLM one!

On a side note, i've been trying to do something similar too for similar reasons (privacy).

Based on my recent experience, i find that running LLM directly in the browser with decent UX (e.g. sub 1-2 second response time, no lag, no crashes) is still somewhat impossible given the current state of things. Plus, i think that relying on users' own GPU hardware for UX improvement via WebGPU is not exactly very practical on a large scale (but it is still something!) since not everyone may have access to GPU hardware

But yeah, if there's anything to look forward to in this space, i personally hope to see improved feasibility of running LLMs in browsers

Re: Show HN: I built a free in-browser Llama 3 chatbot powered by WebGPU

#7
Very cool! I wish there was chat history.

Also if you click the "New Chat" button while an answer is generating I think some of the output gets fed back into the model, it causes some weird output [0] but was kind of cool/fun. Here is a video of it as well [1], I almost think this should be some kind of special mode you can run. I'd be interested to know what the bug causes, is it just the existing output sent as input or a subset of it? It might be fun to watch a chat bot just randomly hallucinate, especially on a local model.

[0] https://cs.joshstrange.com/07kPLPPW

[1] https://cs.joshstrange.com/4sxvt1Mc

EDIT: Looks like calling `engine.resetChat()` while it's generating will do it, but I'm not sure why it errors after a while (maybe runs out of tokens for output? Not sure) but it would be cool to have this run until you stop it, automatically changing every 10-30 seconds or so.

Re: Show HN: I built a free in-browser Llama 3 chatbot powered by WebGPU

#9
post #5

Is this downloading a ~5gb model to my machine and storing it locally for subsequent use?

Yes, it only starts the download after you send the first message so visiting the site won’t use up any space. Approx sizes are listed in the GitHub README. Models are stored in indexeddb and will be managed by the browser. Might get evicted.

I see you have Phi1.5-q4f16_1-1k - any chance you could add Phi-3?

Re: Show HN: I built a free in-browser Llama 3 chatbot powered by WebGPU

#10
post #5

Is this downloading a ~5gb model to my machine and storing it locally for subsequent use?

Yes, it only starts the download after you send the first message so visiting the site won’t use up any space. Approx sizes are listed in the GitHub README. Models are stored in indexeddb and will be managed by the browser. Might get evicted.

I thought browser tabs only had access to ~400mb

How do you have access to 5gb?

Post reply on HN