Registry / database / sqlite-vec-darwin-arm64

sqlite-vec-darwin-arm64

JSON →
library0.1.9jsnpmunverified

Platform-specific binary for sqlite-vec on macOS ARM64 (Apple Silicon). The sqlite-vec extension provides vector search capabilities directly inside SQLite, enabling efficient k-NN queries on embeddings with minimal overhead. This package is one of several platform-specific distributions (along with sqlite-vec-linux-x86_64, sqlite-vec-darwin-x64, etc.) that are automatically selected as optional dependencies by the main `sqlite-vec` package. As of v0.1.9, the extension is under active development and supports approximate nearest neighbor search via IVF (Inverted File Index) and exact brute-force search. It is not intended to be installed directly; instead, use `sqlite-vec` which will pull the correct binary for your platform.

npm install sqlite-vec-darwin-arm64
INSTALL
IMPORT
SIG · SQLITE-VEC-DARWIN-
S
sqlite-vec-darwin-arm64
databasejavascriptv0.1.9
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sqlite-vec extension (native addon)
import sqliteVec from 'sqlite-vec'
import sqliteVec from 'sqlite-vec-darwin-arm64'
Use the main 'sqlite-vec' package. It automatically loads the platform-specific binary.
better-sqlite3 database
import Database from 'better-sqlite3'; const db = new Database(':memory:'); db.loadExtension(sqliteVec.getLoadablePath())
const db = new Database(':memory:'); db.loadExtension('sqlite-vec-darwin-arm64');
You must call sqliteVec.getLoadablePath() to get the correct binary path, then pass it to loadExtension().
loadablePath helper
import sqliteVec from 'sqlite-vec'; const path = sqliteVec.getLoadablePath()
const path = require('sqlite-vec-darwin-arm64');
getLoadablePath() returns the absolute path to the .dylib (or .so/.dll) file. Only available on the main package.

Shows how to load the sqlite-vec extension into better-sqlite3, create a vector virtual table, insert vectors as Float32Array, and perform a k-NN search using MATCH.

// Install: npm install sqlite-vec better-sqlite3 import Database from 'better-sqlite3'; import sqliteVec from 'sqlite-vec'; const db = new Database(':memory:'); db.loadExtension(sqliteVec.getLoadablePath()); // Create a vector table and insert some data db.exec(`CREATE VIRTUAL TABLE vec_items USING vec0( item_id INTEGER PRIMARY KEY, embedding FLOAT[3] )`); const insertStmt = db.prepare('INSERT INTO vec_items(item_id, embedding) VALUES (?, ?)'); insertStmt.run(1, new Float32Array([0.1, 0.2, 0.3])); insertStmt.run(2, new Float32Array([0.4, 0.5, 0.6])); // Query: find 5 nearest neighbors to [0.1, 0.2, 0.3] const rows = db.prepare(` SELECT item_id, distance FROM vec_items WHERE embedding MATCH ? AND k = 5 `).all(new Float32Array([0.1, 0.2, 0.3])); console.log(rows); // Output: [ { item_id: 1, distance: 0 }, { item_id: 2, distance: 0.27 } ]
Debug
Known issues
gotchaDo NOT install platform-specific packages directly. Only install the main 'sqlite-vec' package.
fix
Run: npm install sqlite-vec (not sqlite-vec-darwin-arm64). The main package will automatically pick the correct binary for your platform.
affects: >=0.1.0
breakingVector dimensions must be declared as FLOAT[N] in the CREATE TABLE statement. Mismatch causes runtime errors.
fix
Always define the table with explicit dimension, e.g., embedding FLOAT[512]. Inserted arrays must match.
affects: >=0.1.0
gotchaVectors must be passed as Float32Array, not regular arrays or Float64Array. Queries also require Float32Array.
fix
Convert arrays: new Float32Array([0.1, 0.2, 0.3]).
affects: >=0.1.0
breakingOn Node.js, you must call db.loadExtension() with the full path from sqliteVec.getLoadablePath(). Using a relative path will fail on some systems.
fix
Use: db.loadExtension(sqliteVec.getLoadablePath())
affects: >=0.1.0
gotchaThe extension is ESM-only from v0.1.0. Using require() will throw.
fix
Use import syntax or dynamic import().
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'sqlite-vec-darwin-arm64'
Directly requiring the platform package instead of the main 'sqlite-vec'.
fix
npm install sqlite-vec and import from 'sqlite-vec'
Error: SQLITE_ERROR: wrong number of dims for 'embedding': expected 3, got 2
Inserted vector dimension does not match the virtual table declaration.
fix
Ensure the Float32Array length matches the FLOAT[N] in CREATE TABLE.
TypeError: db.loadExtension is not a function
Using a database instance that doesn't support loadExtension (e.g., sql.js or node:sqlite).
fix
Use better-sqlite3 or node-sqlite3 which support native extensions.
Upgrade
Version history
0.1.9latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
10
Meta
2
OpenAI (training)
1
Resources
sqlite-vec-darwin-arm64 — npm install sqlite-vec-darwin-arm64 · libregistry