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

ggml-node

v0.2.0

Published

An LLM inside your Node process. No daemon, no API key, no port.

Readme

GGML Node

Frontal Banner

An AI model SDK inside your Node process. No daemon, no API key, no port.

ggml-node runs a small quantized language model in-process with node-llama-cpp. It has a typed API, an AI SDK provider, and structured output constrained by a grammar, so the result always matches your schema.

What SLM means

SLM stands for small language model: a language model with a few hundred million to a few billion parameters, small enough to run on a laptop instead of a data centre. The default model, qwen2.5-0.5b, has 0.5 billion parameters and is 491 MB on disk. ggml-node runs these models inside your own Node.js process, on ggml, the C library behind llama.cpp.

import { createGgmlNode } from "ggml-node";
import { z } from "zod";

const ai = createGgmlNode({ model: "qwen2.5-0.5b" });

const { text } = await ai.generate({ prompt: "In one sentence, what is a river?", maxTokens: 64 });

const { object } = await ai.object({
  schema: z.object({ sentiment: z.enum(["positive", "negative", "neutral"]) }),
  prompt: "Classify: 'The package arrived broken.'",
});

await ai.unload();

Install

npm install ggml-node
npx ggml-node pull qwen2.5-0.5b   # 491 MB, verified by SHA-256

Requires Node.js 20 or later. macOS (Metal), Linux and Windows are supported, and a GPU is optional.

Use it with the AI SDK

import { generateText } from "ai";
import { ggmlNode } from "ggml-node/ai";

const { text } = await generateText({ model: ggmlNode("qwen2.5-0.5b"), prompt: "Hello" });

Test without a model

import { createMockGgmlNode } from "ggml-node/testing";

const ai = createMockGgmlNode({ respond: "a fixed answer" });

Models

| Id | Size | Context | License | | --- | --- | --- | --- | | qwen2.5-0.5b (default) | 491 MB | 32768 | Apache-2.0 | | qwen2.5-1.5b | 1.12 GB | 32768 | Apache-2.0 | | smollm2-360m | 386 MB | 8192 | Apache-2.0 |

Any other GGUF file works through createGgmlNode({ model: { path } }).

Embeddings

An embedding model turns text into vectors for search and similarity. bge-small-en-v1.5 is in the registry (384 dimensions, MIT). Call embed on it:

const embedder = createGgmlNode({ model: "bge-small-en-v1.5" });
const { embeddings, dimensions } = await embedder.embed({
  input: ["a cat on a mat", "a kitten on a rug"],
});

Any other embedding GGUF works through { path }. Each handle holds one model: generate needs a generation model, and embed needs an embedding model. With the AI SDK, use ggmlEmbedding("bge-small-en-v1.5"). See models and the AI SDK provider.

Command line

npx ggml-node list                              # models and cache state
npx ggml-node run "What is a river?"            # generate
npx ggml-node run "Extract: Alex, 34" --json-schema person.json
npx ggml-node bench qwen2.5-0.5b --tokens 128   # load, first token, tokens/s, memory
npx ggml-node doctor                            # checks the machine and the backend

Documentation

Examples live in examples/, and agent skills in skills/.

When not to use it

  • You need the strongest model available. Hosted models are far more capable.
  • You need reasoning, long documents, tool calling or world knowledge. Small models are weak at them.
  • You cannot spare about 1 GB of memory for the model and its cache.
  • You run on zip-based serverless functions. The model and the native binary do not fit. Use a container image.

Status

Version 0.1.0 is published to npm as ggml-node. The release process is described in Development.

License

Apache-2.0. See LICENSE.md.