Run LLMs entirely in the browser with a simple headless React hook, useLLM().

Run LLMs entirely in the browser with a simple headless React hook, useLLM().

Live demo: http://chat.matt-rickard.com
GitHub: https://github.com/r2d4/react-llm

react-llm/headless lets you customize everything from the system prompt to the user/assistant role names. It manages a WebGPU-powered background worker.

react-llm sets everything up for you — an off-the-main-thread worker that fetches the model from a CDN (HuggingFace), cross-compiles the WebAssembly components (like the tokenizer and model bindings), and manages the model state (attention kv cache, and more).

Everything runs clientside — the model is cached and inferenced in the browser. Conversations are stored in session storage.

Under the hood, it’s powered by Apache TVM Unity and MLC.

 

© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容