# fastembed

> NodeJS implementation of @Qdrant/fastembed

Latest version **3.0.0** (published 2026-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install fastembed
pnpm add fastembed
yarn add fastembed
bun add fastembed
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-09-24 |
| First published | 2023-09-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 109.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1 |
| Author | Anush008 |
| Maintainers | anush008 |
| Keywords | embeddings, fastembed, onnxruntime, semantic, search |

## Links

- npm: https://www.npmjs.com/package/fastembed
- Repository: https://github.com/qdrant-labs/fastembed-js
- Homepage: https://github.com/qdrant-labs/fastembed-js#readme
- Issues: https://github.com/qdrant-labs/fastembed-js/issues
- npm.io page: https://npm.io/package/fastembed

## Dependencies (4)

- [progress](https://npm.io/package/progress.md) ^2.0.3
- [@huggingface/hub](https://npm.io/package/@huggingface/hub.md) ^2.7.1
- [onnxruntime-node](https://npm.io/package/onnxruntime-node.md) 1.21.0
- [@anush008/tokenizers](https://npm.io/package/@anush008/tokenizers.md) ^0.0.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2026-09-24
- 1.14.5 (v1-hf) — 2026-09-30
- 2.1.1 (v2-hf) — 2026-09-30
- 1.12.2-beta.2 (beta) — 2023-10-10
- 2.1.0 — 2025-12-15
- 2.0.0 — 2025-09-16
- 1.14.4 — 2025-04-09
- 1.14.3 — 2025-04-04
- 1.14.2 — 2025-04-03
- 1.14.1 — 2024-02-03
- 1.14.0 — 2023-10-18
- 1.13.0 — 2023-10-10
- 1.12.2-beta.1 — 2023-10-09
- 1.12.1 — 2023-10-09
- 1.12.0 — 2023-10-08
- … 16 more at https://npm.io/package/fastembed/versions

## README

<div align="center">
  <h1><a href="https://www.npmjs.com/package/fastembed">FastEmbed-js ⚡️</a></h1>
  <h3>Typescript/NodeJS implementation of <a href="https://github.com/qdrant/fastembed" target="_blank">@Qdrant/fastembed</a></h3>
  <a href="https://www.npmjs.com/package/fastembed"><img src="https://img.shields.io/npm/v/fastembed.svg" alt="Crates.io"></a>
  <a href="https://github.com/qdrant-labs/fastembed-js/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-mit-blue.svg" alt="MIT Licensed"></a>
  <a href="https://github.com/qdrant-labs/fastembed-js/actions/workflows/release.yml"><img src="https://github.com/qdrant-labs/fastembed-js/actions/workflows/release.yml/badge.svg?branch=main" alt="Semantic release"></a>
</div>

## 🍕 Features
* Supports CommonJS and ESM.
* Uses [@anush008/tokenizers](https://github.com/Anush008/tokenizers) multi-arch native bindings for [@huggingface/tokenizers](https://github.com/huggingface/tokenizers).
* Supports batch embedddings with generators.

The default model is Flag Embedding, which is top of the [MTEB](https://huggingface.co/spaces/mteb/leaderboard) leaderboard.

## 🔍 Not looking for Javascript?

- Python 🐍: [fastembed](https://github.com/qdrant/fastembed)
- Rust 🦀: [fastembed-rs](https://github.com/Anush008/fastembed-rs)
- Go 🐳: [fastembed-go](https://github.com/Anush008/fastembed-go)

## 🤖 Models

- [**BAAI/bge-base-en**](https://huggingface.co/BAAI/bge-base-en)
- [**BAAI/bge-base-en-v1.5**](https://huggingface.co/BAAI/bge-base-en-v1.5)
- [**BAAI/bge-small-en**](https://huggingface.co/BAAI/bge-small-en)
- [**BAAI/bge-small-en-v1.5**](https://huggingface.co/BAAI/bge-small-en-v1.5) - Default
- [**BAAI/bge-base-zh-v1.5**](https://huggingface.co/BAAI/bge-base-zh-v1.5)
- [**sentence-transformers/all-MiniLM-L6-v2**](https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2)
- [**intfloat/multilingual-e5-large**](https://huggingface.co/intfloat/multilingual-e5-large)


## 🚀 Installation

To install the FastEmbed library, npm works: 

```bash
npm install fastembed
```

## 📖 Usage

```js
import { EmbeddingModel, FlagEmbedding } from "fastembed";
// For CommonJS
// const { EmbeddingModel, FlagEmbedding } = require("fastembed)

const embeddingModel = await FlagEmbedding.init({
    model: EmbeddingModel.BGEBaseEN
});

let documents = [
    "passage: Hello, World!",
    "query: Hello, World!",
    "passage: This is an example passage.",
    // You can leave out the prefix but it's recommended
    "fastembed-js is licensed under MIT" 
];

const embeddings = embeddingModel.embed(documents, 2); //Optional batch size. Defaults to 256

for await (const batch of embeddings) {
    // batch is list of Float32 embeddings(number[][]) with length 2
    console.log(batch);
}

```

#### Supports passage and query embeddings for more accurate results
```ts
const embeddings = embeddingModel.passageEmbed(listOfLongTexts, 10); //Optional batch size. Defaults to 256

for await (const batch of embeddings) {
    // batch is list of Float32 passage embeddings(number[][]) with length 10
    console.log(batch);
}

const queryEmbeddings: number[] = await embeddingModel.queryEmbed(userQuery);
console.log(queryEmbeddings)

```

## 🚒 Under the hood

### Why fast?

It's important we justify the "fast" in FastEmbed. FastEmbed is fast because:

1. Quantized model weights
2. ONNX Runtime which allows for inference on CPU, GPU, and other dedicated runtimes

### Why light?
1. No hidden dependencies via Huggingface Transformers

### Why accurate?
1. Better than OpenAI Ada-002
2. Top of the Embedding leaderboards e.g. [MTEB](https://huggingface.co/spaces/mteb/leaderboard)

## © LICENSE

MIT © [2026](https://github.com/qdrant-labs/fastembed-js/blob/main/LICENSE)

---
_Source: https://npm.io/package/fastembed · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
