Seems like a good match for WebLLM, as it was practicaly designed to run in the browser. From this reddit thread: https://www.reddit.com/r/LocalLLaMA/comments/1d2o445/comment/l63cvxk/