
Security News
Risky Biz Podcast: AI Agents Are Raising the Stakes for Software Supply Chain Security
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.
@mastra/fastembed
Advanced tools
Affected versions:
Local embedding model integration for Mastra, powered by ONNX Runtime.
Local embedding model integration for Mastra, powered by ONNX Runtime.
This package is a maintained fork of fastembed-js (now archived). The upstream source has been vendored directly into this package so that @mastra/fastembed no longer depends on the unmaintained fastembed npm package.
pnpm add @mastra/fastembed
import { Memory } from '@mastra/memory';
import { fastembed } from '@mastra/fastembed';
const memory = new Memory({
// ... other memory options
embedder: fastembed,
});
import { fastembed } from '@mastra/fastembed';
// Default export (bge-small-en-v1.5 with v3 spec)
const embedder = fastembed;
// Named exports for v3 models
const small = fastembed.small; // bge-small-en-v1.5
const base = fastembed.base; // bge-base-en-v1.5
// V2 models (for AI SDK v5 compatibility)
const smallV2 = fastembed.smallV2;
const baseV2 = fastembed.baseV2;
// Legacy v1 models (for backwards compatibility)
const smallLegacy = fastembed.smallLegacy; // bge-small-en-v1.5 (v1 spec)
const baseLegacy = fastembed.baseLegacy; // bge-base-en-v1.5 (v1 spec)
import { embed } from 'ai';
import { fastembed } from '@mastra/fastembed';
const result = await embed({
model: fastembed,
value: 'Text to embed',
});
console.log(result.embedding); // number[]
| Model | Dimensions | Description |
|---|---|---|
bge-small-en-v1.5 | 384 | Fast, default English model |
bge-base-en-v1.5 | 768 | Base English model |
bge-small-en | 384 | Fast English model |
bge-base-en | 768 | Base English model |
bge-small-zh-v1.5 | 512 | Fast Chinese model |
all-MiniLM-L6-v2 | 384 | Sentence Transformer model |
multilingual-e5-large | 1024 | Multilingual model |
The core embedding engine is forked from fastembed-js by Anush008, licensed under MIT. See LICENSE-fastembed for the original license.
FAQs
Unknown package
The npm package @mastra/fastembed receives a total of 6,393 weekly downloads. As such, @mastra/fastembed popularity was classified as popular.
We found that @mastra/fastembed demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.