Node.js Library for Local AI Inference
2.0k 2026-04-18

withcatai/node-llama-cpp

A Node.js library providing bindings for llama.cpp, enabling local AI model inference with advanced features like JSON schema enforcement and function calling.

Core Features

Run LLMs locally on your machine with GPU acceleration (Metal, CUDA, Vulkan).
Pre-built binaries for easy installation, adapting automatically to your hardware.
Enforce JSON schema on model output and support function calling for structured interactions.
CLI for quick interaction with models without writing any code, and full TypeScript support.

Quick Start

npm install node-llama-cpp

Detailed Introduction

node-llama-cpp offers Node.js developers a robust and easy-to-use solution for running large language models (LLMs) directly on their local machines. By leveraging llama.cpp and providing pre-built binaries, it significantly simplifies the complex setup typically associated with local AI inference. Its core strengths include hardware adaptation, GPU acceleration, and advanced features like enforcing JSON output schemas and enabling function calls, making it ideal for building intelligent applications that require privacy, low latency, or offline capabilities, without relying on external cloud APIs.

OSS Alternative

Explore the best open source alternatives to commercial software.

© 2026 OSS Alternative. hotgithub.com - All rights reserved.