npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

smoltalk-webllm

v0.1.0

Published

WebLLM (WebGPU) browser provider for smoltalk

Readme

smoltalk-webllm

WebGPU-accelerated browser provider for smoltalk. Runs LLMs locally in the user's browser via @mlc-ai/web-llm.

Install

pnpm add smoltalk smoltalk-webllm

Usage

Register the provider before your first call, then use smoltalk normally:

import { registerProvider, text, userMessage } from "smoltalk";
import { WebLLMClient, loadModel } from "smoltalk-webllm";

registerProvider("webllm", WebLLMClient);

await loadModel("Llama-3.2-3B-Instruct-q4f32_1-MLC", {
  onProgress: (p) => console.log(p.text, p.loaded, p.total),
});

const result = await text({
  model: "Llama-3.2-3B-Instruct-q4f32_1-MLC",
  provider: "webllm",
  messages: [userMessage("Hello")],
});

Run the example

A single-file copy/paste-and-go example lives at examples/index.html. It loads smoltalk and smoltalk-webllm from a CDN, downloads Llama-3.2-1B-Instruct-q4f32_1-MLC (~700MB, cached after first run), and streams a chat completion to the page.

To try it locally:

# from the smoltalk repo root
npx serve packages/smoltalk-webllm/examples
# then open http://localhost:3000 in a WebGPU-capable browser

Available models

The model id must match a record in WebLLM's prebuiltAppConfig.model_list. To see all available models:

import { listModels } from "smoltalk-webllm";
console.log(await listModels()); // ["Llama-3.2-1B-Instruct-q4f32_1-MLC", ...]

Custom models

Pass a CustomModel object to loadModel to load a model not in the prebuilt list:

import { loadModel } from "smoltalk-webllm";

await loadModel({
  id: "MyLlama-3b",
  modelUrl: "https://huggingface.co/.../resolve/main/",
  modelLibUrl: "https://.../mymodel.wasm",
  contextWindow: 4096,
});

Limitations

  • WebGPU required: throws SmolError at loadModel() time if navigator.gpu is undefined.
  • AbortSignal: passing a signal to loadModel will reject the returned promise on abort, but the underlying download/compile may continue in the background. The engine will be unloaded if it eventually arrives so GPU memory is released.