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

@sqliteai/sqlite-ai

v0.7.58

Published

SQLite AI extension for Node.js - On-device inference, embedding generation, and model interaction directly into your database

Readme

@sqliteai/sqlite-ai

npm version License

SQLite AI extension packaged for Node.js

SQLite-AI is an extension for SQLite that brings artificial intelligence capabilities directly into the database. It enables developers to run, fine-tune, and serve AI models from within SQLite using simple SQL queries — ideal for on-device and edge applications where low-latency and offline inference are critical. The extension is actively developed by SQLite AI, some API and features are still evolving.

Features

  • LLaMA Integration - Run LLaMA models directly in SQLite
  • Whisper Speech Recognition - Transcribe audio with Whisper
  • Embedding Generation - Generate vector embeddings for semantic search
  • Cross-platform - Works on macOS, Linux (glibc/musl), and Windows
  • Zero configuration - Automatically detects and loads the correct binary for your platform
  • TypeScript native - Full type definitions included
  • Modern ESM + CJS - Works with both ES modules and CommonJS
  • Offline-ready - No external services required

Installation

npm install @sqliteai/sqlite-ai

The package automatically downloads the correct native extension for your platform during installation.

Supported Platforms

| Platform | Architecture | Package | |----------|-------------|---------| | macOS | ARM64 (Apple Silicon) | @sqliteai/sqlite-ai-darwin-arm64 | | macOS | x86_64 (Intel) | @sqliteai/sqlite-ai-darwin-x86_64 | | Linux | ARM64 (glibc) | @sqliteai/sqlite-ai-linux-arm64 | | Linux | ARM64 (musl/Alpine) | @sqliteai/sqlite-ai-linux-arm64-musl | | Linux | x86_64 (glibc) | @sqliteai/sqlite-ai-linux-x86_64 | | Linux | x86_64 (musl/Alpine) | @sqliteai/sqlite-ai-linux-x86_64-musl | | Windows | x86_64 | @sqliteai/sqlite-ai-win32-x86_64 |

sqlite-ai API

For detailed information on how to use the AI extension features, see the main documentation.

Usage

import { getExtensionPath } from '@sqliteai/sqlite-ai';
import Database from 'better-sqlite3';

const db = new Database(':memory:');
db.loadExtension(getExtensionPath());

// Ready to use
const version = db.prepare('SELECT ai_version()').pluck().get();
console.log('AI extension version:', version);

Examples

For complete, runnable examples, see the sqlite-extensions-guide.

These examples are generic and work with all SQLite extensions: sqlite-vector, sqlite-sync, sqlite-js, and sqlite-ai.

API Reference

getExtensionPath(): string

Returns the absolute path to the SQLite AI extension binary for the current platform.

Returns: string - Absolute path to the extension file (.so, .dylib, or .dll)

Throws: ExtensionNotFoundError - If the extension binary cannot be found for the current platform

Example:

import { getExtensionPath } from '@sqliteai/sqlite-ai';

const path = getExtensionPath();
// => '/path/to/node_modules/@sqliteai/sqlite-ai-darwin-arm64/ai.dylib'

getExtensionInfo(): ExtensionInfo

Returns detailed information about the extension for the current platform.

Returns: ExtensionInfo object with the following properties:

  • platform: Platform - Current platform identifier (e.g., 'darwin-arm64')
  • packageName: string - Name of the platform-specific npm package
  • binaryName: string - Filename of the binary (e.g., 'ai.dylib')
  • path: string - Full path to the extension binary

Throws: ExtensionNotFoundError - If the extension binary cannot be found

Example:

import { getExtensionInfo } from '@sqliteai/sqlite-ai';

const info = getExtensionInfo();
console.log(`Running on ${info.platform}`);
console.log(`Extension path: ${info.path}`);

getCurrentPlatform(): Platform

Returns the current platform identifier.

Returns: Platform - One of:

  • 'darwin-arm64' - macOS ARM64
  • 'darwin-x86_64' - macOS x86_64
  • 'linux-arm64' - Linux ARM64 (glibc)
  • 'linux-arm64-musl' - Linux ARM64 (musl)
  • 'linux-x86_64' - Linux x86_64 (glibc)
  • 'linux-x86_64-musl' - Linux x86_64 (musl)
  • 'win32-x86_64' - Windows x86_64

Throws: Error - If the platform is unsupported


isMusl(): boolean

Detects if the system uses musl libc (Alpine Linux, etc.).

Returns: boolean - true if musl is detected, false otherwise


class ExtensionNotFoundError extends Error

Error thrown when the SQLite AI extension cannot be found for the current platform.

Related Projects

License

This project is licensed under the Elastic License 2.0.

For production or managed service use, please contact SQLite Cloud, Inc for a commercial license.

Contributing

Contributions are welcome! Please see the main repository to open an issue.

Support