CompatibilityOnly available in web environments.
Setup
You’ll need to install the WebLLM SDK module to communicate with your local model.npm
Usage
Note that the first time a model is called, WebLLM will download the full weights for that model. This can be multiple gigabytes, and may not be possible for all end-users of your application depending on their internet connection and computer specs. While the browser will cache future invocations of that model, we recommend using the smallest possible model you can. We also recommend using a separate web worker when invoking and loading your models to not block execution.Example
For a full end-to-end example, check out this project.Related
- Chat model conceptual guide
- Chat model how-to guides