Back to directory

turboquant-js

A zero-dependency TypeScript implementation of Google's TurboQuant vector quantization algorithm that runs in both Node.js and browsers, for compressing embeddings used in search, retrieval-augmented generation and LLM key-value caches.

turboquant-js

turboquant-js implements the TurboQuant algorithm for near-optimal, data-oblivious vector quantization, achieving distortion within about 2.7x of information-theoretic lower bounds with no training or fine-tuning step. A two-stage quantization scheme gives unbiased dot-product estimates, which the library exposes through two application APIs: VectorIndex for nearest-neighbor search and KVCacheCompressor for compressing LLM attention keys and values.

Because it has no runtime dependencies and a small bundle size, it is intended for client-side use cases such as semantic search over bookmarks or notes inside a browser extension, offline-capable retrieval-augmented generation with a local model, in-browser document search, and deployment on edge runtimes such as Cloudflare Workers or Vercel Edge Functions where WebAssembly is not an option. It also supports deterministic, seeded vector search for reproducible tests without a running vector database.

It installs from npm and runs the same way in Node.js and in browsers.

More in RAG

See all 540
  • ai·rete·rag

    ai-rete-rag.com

    A platform that pairs a Rete rule engine with retrieval-augmented generation, so deterministic rules decide an outcome and grounded retrieval explains the decision in plain language.

  • Xtriever

    github.com

    A hybrid retrieval engine for retrieval-augmented generation, written in Rust to run on-device on a phone or a laptop, combining lexical BM25 search, dense embedding search, reciprocal-rank fusion and cross-encoder re-ranking with no server.

  • FileFlux

    github.com

    A .NET library that turns PDF, DOCX, HWP and other documents into optimized chunks for RAG systems, through a five-stage pipeline built on high-performance Rust FFI readers.