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

localsage-ai

v1.0.1

Published

LocalSage — a local, offline AI assistant with PDF & document knowledge. Powered by Qwen via Transformers.js. Pure Node.js, no Python.

Readme

🧙 LocalSage

Your local, offline AI assistant that knows your documents.

LocalSage runs a Qwen language model entirely on your machine (via Transformers.js) and answers questions using your own PDF, TXT, and Markdown files. Pure Node.js — no Python, no API keys, no data leaving your computer.

Features

  • 🤖 Runs AI locally via Transformers.js (ONNX) — no cloud, no API costs
  • 📚 Chat with your PDF, TXT, and MD files
  • 🔒 100% private — everything stays on your machine
  • 💾 Conversation history saved automatically
  • 🔧 Customizable model, knowledge folder, and generation settings
  • 📦 Pure Node.js — no Python required

Installation

npm install -g localsage-ai

Quick Start

  1. Create a knowledge folder in your working directory and add documents:
mkdir knowledge
cp your-document.pdf knowledge/
  1. Start LocalSage:
localsage

The first run downloads the model (~500 MB) to your Hugging Face cache. After that, it works fully offline.

  1. Ask questions about your documents!

Commands

  • exit — save history and quit
  • clear — clear conversation history
  • history — show number of stored messages

Options

localsage [options]

  -m, --model <model>      Model to use (default: "onnx-community/Qwen2.5-0.5B-Instruct")
  -k, --knowledge <path>   Knowledge folder path (default: "./knowledge")
  --no-pdf                 Disable PDF support
  --max-tokens <number>    Max tokens for response (default: 200)
  --temperature <number>   Temperature for generation (default: 0.7)
  -h, --help               Show help
  -V, --version            Show version

Important: the model must be a repo that ships ONNX weights, e.g. the onnx-community/... mirrors. Plain Qwen/Qwen2.5-* repos will NOT load in Transformers.js.

Examples

# Use a bigger model
localsage --model onnx-community/Qwen2.5-1.5B-Instruct

# Custom knowledge folder
localsage --knowledge ./my_docs

# Adjust generation
localsage --max-tokens 300 --temperature 0.8

Programmatic Usage

const LocalSage = require('localsage-ai');

async function main() {
  const assistant = new LocalSage({
    model: 'onnx-community/Qwen2.5-0.5B-Instruct',
    knowledgePath: './knowledge',
    maxTokens: 200,
    temperature: 0.7,
  });

  await assistant.initialize();
  const response = await assistant.chat('What is the capital of France?');
  console.log(response);
}

main();

How It Works

  1. Knowledge loading — reads all TXT, MD, and PDF files from the knowledge folder (plus an optional knowledge.txt in the working directory)
  2. AI processing — runs the Qwen model locally with @huggingface/transformers
  3. History — saves the conversation to history.json in the working directory

Requirements

  • Node.js 18+
  • 4 GB+ RAM recommended
  • ~1–2 GB free disk space for model files

Model Storage

Models are cached by Transformers.js on first run. Override the cache location with the LOCALSAGE_MODEL_DIR environment variable.

💼 Open to Work

Built by a developer available for freelance and full-time opportunities. Got a project? Let's talk — 📧 [email protected]

License

MIT