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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ailoy-node

v0.2.2

Published

Node.js binding for Ailoy API

Readme

ailoy-node

Ailoy is a lightweight library for building AI applications — such as agent systems or RAG pipelines — with ease. It is designed to enable AI features effortlessly, one can just import and use.

See our documentation for more details.

Install

# npm
npm install ailoy-node
# yarn
yarn add ailoy-node

Quickstart

import * as ai from "ailoy-node";

async function main() {
  // Create Qwen3-0.6B LocalLanguageModel
  const model = await ai.LangModel.newLocal("Qwen/Qwen3-0.6B");

  // Create an agent using this model
  const agent = new ai.Agent(model);

  // Ask a prompt and iterate over agent's responses
  for await (const resp of agent.run("What is your name?")) {
    console.log(resp);
  }
}

await main();

Building from source

Prerequisites

  • Rust >= 1.88
  • Node.js >= LTS version
  • C/C++ compiler (recommended versions are below)
    • GCC >= 13
    • LLVM Clang >= 17
    • Apple Clang >= 15
    • MSVC >= 19.29
  • CMake >= 3.28.0
  • Git
  • OpenMP (required to build Faiss)
  • BLAS (required to build Faiss)
  • LAPACK (required to build Faiss)
  • Vulkan SDK (on Windows and Linux)

Setup development environment

[!WARNING] To build binding, you must change the crate type to cdylib in Cargo.toml.

[lib]
crate-type = ["dylib"] # <- Change this to ["cdylib"]
# Install dev dependencies
npm install

# This generates `ailoy_core.<platform>.node` under `src/`
npm run build:napi

# This builds the bundled index.js and index.d.ts under `dist/`
npm run build:ts

# To build napi module and typescript at once
npm run build

Tests

Some test cases require specific environment variables to be set before running the test (e.g. OPENAI_API_KEY). Please fill .env.template and rename to .env in order to run every tests.

# Run all test cases
npm run test

# Run test cases with filtering
npm run test -- -t "Agent.*Local"

Generate npm package

npm pack