Lurker News
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

Comments (139) 42 threads

Earlier comments
joshstrange2 replies#
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.

brianzelip1 reply#
Nice personal hosted image service!
joshstrange1 reply#
I’m just using CleanShotX [0] which is an awesome image annotation tool for macOS. It’s way better than the built-in tool that macOS comes with. You can also record as a gif for video which is nice, I use it often to make guides for my day job and my business.

[0] https://cleanshot.com

bbkane#
I'm using flameshot ( https://flameshot.org/ ), which sounds pretty similar, but FOSS and cross platform.
abi#
Thanks for the bug report. Yeah, it’s a bug with not resetting the state properly when new chat is clicked. Will fix tomorrow.

Chat history shouldn’t be hard to add with local storage and Indexed DB.

manlobster3 replies#
It's truly amazing how quickly my browser loads 0.6GB of data. I remember when downloading a 1MB file involved phoning up a sysop in advance and leaving the modem on all night. We've come so far.
doctorpangloss3 replies#
97MB for the Worms 3 demo felt like an eternity.

So what games are in this LLM? Can it do solitaire yet?

westurner1 reply#
It generates things that you get to look up citations for. It doesn't care if its output converges, it does what it wants differently every time.
TeMPOraL#
> It generates things that you get to look up citations for.

Why would you use it for that? Use a search engine.
LLMs are substitute for talking to people. Use them for things you would ask someone else about, and then not follow up with searching for references.

exe34#
It can probably role-play.
roywiggins#
GPT-3.5 is pretty good at fabricating text adventures, I haven't tried any of the smaller models with that yet.
swores#
When I think about numbers like that it just seems (to me, and wrongly) like general progress that's not so crazy - the thought that really makes the speed of progress stand out to me is remembering when loading a single image - photo sized but not crazily high resolution - over dial-up was slow enough that you'd gradually see the image loading from top to bottom, and could see it gradually getting taller as more lines of pixels were downloaded and shown below the already loaded part. Contrasting that memory against the ability to now watch videos with much higher resolution per frame than those images were 30 years ago is what really makes me go "wow".

For anyone not old enough to remember, here's an example on YouTube (and a faster loading time than I remember often being the case!): https://youtube.com/watch?v=ra0EG9lbP7Y

zozbot234#
You could more or less fit the full model on a single CD (or a DVD for the larger model sizes) but of course forget about trying to do inference for it on period hardware, it would be unusably slow.
threatofrain1 reply#
IMO eventually users should be able to advertise what embedding models they have so we don't redundantly redownload.
KeplerBoy4 replies#
That's not possible with current web tech, is it?

Different webapps can't share common dependencies stored in localstorage afaik.

dannyw3 replies#
This need wasn’t super prevalent in the pre LLM days. It’s rare to have a multi-GB blob that should be commonly used across sites.
abi#
Well, it should be possible to just drag and drop a file/folder
KeplerBoy#
Who knows. Maybe the browser would be a more prevalent gaming platform if it could be assumed that loading a multi gigabyte game engine is no big deal, because everyone had one already cached.

A lot of unity games could easily be web games, but aren't because of many roadblocks. I believe this is one of them.

TeMPOraL2 replies#
It was a real need given how almost all sites use large JavaScript deps. However, any hopes of sharing those were destroyed by adtech people timing resource downloads to track people.

Continue this thread — 2 replies

JimDabell#
It can probably be done with a browser extension. It can definitely be done by the browsers themselves. Eventually it will probably be done by the operating system, which the browsers will then expose.
yokto#
It is, but only within the same origin, which already enables users to not re-download jquery.js or Google Fonts if they previously visited another website that downloaded the same file from the same (usually cross-) origin.
blurpesec1 reply#
Not default web tech. It can be done with IPFS via IPFS Companion browser extension - https://chromewebstore.google.com/detail/ipfs-companion/nibj... or browsers with native IPFS client support like Brave or Opera.

Fetching these models over IPFS would locally cache them and dedupe calls for them by IPFS content ids - https://docs.ipfs.tech/concepts/content-addressing/#:~:text=... which functions similar to a file hash (not an exact parallel, since CIDs represent files that are broken up into chunks).
This would help with object DL deduplication if everyone is using the same models & would also help to decrease centralized data egress costs since with sufficient usage you would be DLing these models from other peers that are running IPFS nodes and holding onto the models.

hpeter#
Last time I tried IPFS it was really slow, if you have to run a node to serve files then direct downloads are much better.

A simple extension would do, that manages models and exposes an interface to window so webapps can call it.
Like window.llm.generate({model,prompt})

knowaveragejoe2 replies#
Is this downloading a ~5gb model to my machine and storing it locally for subsequent use?
abi2 replies#
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.

simonw2 replies#
I see you have Phi1.5-q4f16_1-1k - any chance you could add Phi-3?
abi#
Would love to. It uses MLC AIs webllm so just need to convert it to that format.
kamikazeturtles1 reply#
I thought browser tabs only had access to ~400mb

How do you have access to 5gb?

Continue this thread — 1 reply

Load more comments