# withcatai/node-llama-cpp

Run AI models locally on your machine with node.js bindings for llama.cpp. Enforce a JSON schema on the model output on the generation level

Repository: https://github.com/withcatai/node-llama-cpp
Canonical: https://ross.abutalabs.com/products/node-llama-cpp
Homepage: https://node-llama-cpp.withcat.ai
Language: TypeScript
License: MIT
License Family: permissive
Topics: ai, bindings, catai, llama, llama-cpp, llm, nodejs, prebuilt-binaries, grammar, gguf, cuda, metal, json-schema, cmake, cmake-js, self-hosted, embedding, function-calling, gpu, vulkan
Last push: 2026-08-11T23:19:09+00:00

## Health v2 (maintenance only)
Score: 93/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 97, longevity 79
- inputs: {"age_days": 1117, "days_push": 22, "days_rel": 22, "gap_med": 11.0, "n_releases_24m": 45}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2162, forks 213 (observed 2026-08-28T04:06:21.020820+00:00)

## What it is
node-llama-cpp is a Node.js library providing bindings to llama.cpp for running LLMs locally, with pre-built binaries and automatic GPU support (Metal, CUDA, Vulkan). It includes a CLI for chatting with models, JSON schema-enforced generation, function calling, and embedding/reranking support.

## Use cases
- run llama.cpp models from node.js
- chat with local LLMs without writing code
- force model output to follow a JSON schema
- implement function calling with local models
- generate embeddings for semantic search
- run AI models offline on my own machine
- build an Electron app with local LLM inference

## When to choose
- you want local, private LLM inference in a Node.js, Bun, or Electron app
- you need structured output enforced via grammar or JSON schema
- you want zero-config GPU acceleration with prebuilt binaries
- you need embeddings or reranking alongside text generation

## When to avoid
- you need to serve many concurrent users at scale (use a dedicated inference server)
- your stack is Python and you prefer native llama-cpp-python bindings
- you rely on cloud-hosted LLM APIs rather than local models

## Facets
- artifact type: library
- maturity: active
- function: llm-inference, machine-learning, rag, cli, sdk, chatbot
- domain: large-language-models, artificial-intelligence, machine-learning, developer-tools, self-hosted
- platform: windows, bun, cli
- tags: llamacpp-bindings, gguf, -schema-grammar, function-calling, embeddings, reranking, local-llm, typescript, cuda, metal, vulkan, prebuilt-binaries, nodejs, macos, linux, electron, gpu

## Member repositories
- withcatai/node-llama-cpp (main) score 93

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:21.020820+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:50:14.803491+00:00, confidence not recorded.
  - readme: https://github.com/withcatai/node-llama-cpp (fetched 2026-08-28T04:06:21.020820+00:00, sha 4672af736861)
  - homepage: https://node-llama-cpp.withcat.ai (fetched 2026-08-29T10:30:18.207367+00:00, sha 398d98ca2aab)
  - site_page: https://node-llama-cpp.withcat.ai/guide/grammar (fetched 2026-08-29T10:30:18.210273+00:00, sha d3759e8eda9f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
