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

@kanzo-tech/llm

v0.46.0

Published

The two doors to a model's answer, without React — `stream` and `generate`, each asking once, over the AI SDK, which it does not re-export — `localModel` on `/local`, a model in the page resolved through one provider registry, and on `/testing` the one mo

Readme

@kanzo-tech/llm

The two doors to a model's answer, without React.

npm install @kanzo-tech/llm ai
npm install @browser-ai/web-llm @mlc-ai/web-llm   # for localModel, a model in the page

ai is a required peer, not an optional one: there is nothing here without it, and a host installs it once so that its own agent and @kanzo-tech/ai's components share one UIMessage and one transport. None of it is re-exported: import ToolLoopAgent, tool, Output and the message types from ai by name, as every package here does.

What it holds

import { generate, stream, LlmError } from "@kanzo-tech/llm";
import { localModel, localProvider, setLocalProvider, serveLocalModel } from "@kanzo-tech/llm/local";
import { scriptedModel } from "@kanzo-tech/llm/testing";
  • stream({ model, system, prompt, output }) — an answer as it is written: streamText, never retried, read as text, elements (Output.array) or partial (Output.object), each of which throws what stopped the model once it ends. The SDK alone reports a failed stream to onError and ends it as if it had finished.
  • generate({ …, providerOptions }) — the same, read whole: generateText, asked once. Every model call the library makes goes through one of the two.
  • LlmError — llm/unavailable, data.reason "webgpu" (the page cannot run a model) or "unserved" (nothing serves it).
  • localModel(id?), from @kanzo-tech/llm/local — the model, in the page, resolved by id through one provider registry: a host sets its provider once, setLocalProvider(localProvider({ baseURL: "/models", worker })), and every model listed in /models/app-config.json (WebLLM's AppConfig) is served; without an id, the first. WebLLM on WebGPU through @browser-ai/web-llm: both optional peers that only this subpath reaches. One engine per model per page; without WebGPU a call fails as LlmError, before anything is downloaded. A call may pass providerOptions.kanzo.grammar, an EBNF the engine holds every token to. loadLocalModel(id?) downloads and loads it before the first call, and localModelLoad(id?) / watchLocalModel(id, listener) say where that stands. serveLocalModel() is the worker's whole script.
  • scriptedModel(script), from @kanzo-tech/llm/testing — the one model double: the AI SDK's MockLanguageModelV4 answering from a script of turns. A unit test passes it where a model goes; an end-to-end test registers the script with @kanzo-tech/testing's playwright(page, { models }), which registers it as that id's provider in the same registry.

Why it is not part of @kanzo-tech/ai

Reaching a model is not a user-interface concern, and not every caller draws one: a host's agent, a server route or a test needs the model and none of the components. @kanzo-tech/ai depends on this package and not the other way round.