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

@feltdb/webllm

v0.6.9

Published

Private, in-browser LLM inference for FeltDB applications

Readme

@feltdb/webllm

Run a small language model entirely in the browser and use it as a FeltDB AI provider. Prompts and inference stay on the user's device; no frontier-model account or hosted inference API is required.

Install

npm install @feltdb/webllm

The package requires a browser with WebGPU. On first use, WebLLM downloads the selected model's artifacts and caches them in the browser.

Generate locally

import { WebLLMProvider } from '@feltdb/webllm';

const llm = new WebLLMProvider({
  onProgress: ({ progress, text }) => {
    console.log(`${Math.round(progress * 100)}%`, text);
  },
});

const answer = await llm.generate([
  { role: 'system', content: 'Return concise JSON.' },
  { role: 'user', content: 'Design a FeltDB task tracker.' },
], {
  responseFormat: { type: 'json_object' },
});

Initialization is lazy: the model loads on the first call to generate() or stream(). Call initialize() earlier to show loading progress sooner.

Choose a model

The default is SmolLM2-360M-Instruct-q4f32_1-MLC, a deliberately small model that needs roughly 580 MB of VRAM. Model selection is configurable:

import { RECOMMENDED_MODELS, WebLLMProvider } from '@feltdb/webllm';

const llm = new WebLLMProvider({
  model: RECOMMENDED_MODELS.balanced,
});
  • smallest: the default 360M model
  • balanced: SmolLM2 1.7B for stronger generation on capable devices
  • lowMemoryWithShaderF16: a smaller 360M quantization for devices supporting the WebGPU shader-f16 feature

Pass any model ID from WebLLM's prebuilt catalog, or call getAvailableModels() to inspect the installed catalog.

FeltDB application generation

WebLLMProvider implements FeltDB's message-generation provider contract:

import { ApplicationFactory } from '@feltdb/ai';
import { WebLLMProvider } from '@feltdb/webllm';

const factory = new ApplicationFactory({
  provider: new WebLLMProvider(),
});

const application = await factory.generateApplication(
  'A collaborative, offline-first field inspection app',
);

@feltdb/ai is currently an experimental repository workspace. This package is independently usable through its generate() and stream() APIs.

Workers and lifecycle

Inference runs in the bundled Web Worker by default so execution does not block the UI. Set useWorker: false for main-thread execution, or pass an application-owned worker for custom hosting or CSP behavior.

Call interrupt() to stop generation and shutdown() to unload the model and terminate a package-owned worker.

Privacy and deployment

The model executes locally. Hosting and analytics code can still transmit data, and model files must be fetched before they are cached, so review your app's network and content-security policies. This package does not send prompts to FeltDB or an inference provider.

MIT licensed.