mem0ai/mem0 · error · Error
Unsupported FastEmbed model "${config.model}". Supported mod
Error message
Unsupported FastEmbed model "${config.model}". Supported models: ${SUPPORTED_MODELS.join(", ")}. What it means
Thrown by the FastEmbedEmbedder constructor when config.model is a non-empty string that is not in the SDK's fixed allowlist. FastEmbed ships only a fixed set of ONNX models, mirrored here as literals so an invalid name is rejected synchronously with a clear list instead of failing later inside FlagEmbedding.init() with a download error. Supported: fast-all-MiniLM-L6-v2, fast-bge-base-en, fast-bge-base-en-v1.5, fast-bge-small-en, fast-bge-small-en-v1.5, fast-bge-small-zh-v1.5, fast-multilingual-e5-large. Omitting model entirely is fine (defaults to fast-bge-small-en-v1.5).
Source
Thrown at mem0-ts/src/oss/src/embeddings/fastembed.ts:31
"fast-all-MiniLM-L6-v2",
"fast-bge-base-en",
"fast-bge-base-en-v1.5",
"fast-bge-small-en",
"fast-bge-small-en-v1.5",
"fast-bge-small-zh-v1.5",
"fast-multilingual-e5-large",
] as const;
type FastEmbedModel = (typeof SUPPORTED_MODELS)[number];
const DEFAULT_MODEL: FastEmbedModel = "fast-bge-small-en-v1.5";
export class FastEmbedEmbedder implements Embedder {
private readonly modelName: FastEmbedModel;
private embeddingModel?: Promise<FlagEmbedding>;
constructor(config: EmbeddingConfig) {
if (typeof config.model === "string" && config.model.length > 0) {
if (!SUPPORTED_MODELS.includes(config.model as FastEmbedModel)) {
throw new Error(
`Unsupported FastEmbed model "${config.model}". ` +
`Supported models: ${SUPPORTED_MODELS.join(", ")}.`,
);
}
this.modelName = config.model as FastEmbedModel;
} else {
this.modelName = DEFAULT_MODEL;
}
}
private getEmbeddingModel(): Promise<FlagEmbedding> {
if (!this.embeddingModel) {
this.embeddingModel = this.initEmbeddingModel().catch((error) => {
this.embeddingModel = undefined;
throw error;
});
}
View on GitHub (pinned to 001c235229)
Solutions
- Use one of the exact names from the error message, e.g. 'fast-bge-small-en-v1.5' or 'fast-multilingual-e5-large'
- If you need a model outside the list, switch provider to openai/huggingface (TEI) which accepts arbitrary model IDs
- Omit config.model to accept the default fast-bge-small-en-v1.5
Example fix
// before
embedder: { provider: 'fastembed', config: { model: 'BAAI/bge-small-en-v1.5' } }
// after
embedder: { provider: 'fastembed', config: { model: 'fast-bge-small-en-v1.5' } } Defensive patterns
Strategy: type-guard
Validate before calling
const SUPPORTED = ['fast-all-MiniLM-L6-v2','fast-bge-base-en','fast-bge-base-en-v1.5','fast-bge-small-en','fast-bge-small-en-v1.5','fast-bge-small-zh-v1.5','fast-multilingual-e5-large'];
if (model && !SUPPORTED.includes(model)) {
throw new Error(`Model ${model} not in FastEmbed allowlist; pick from ${SUPPORTED.join(', ')}`);
} Type guard
const isFastEmbedModel = (m: unknown): m is 'fast-all-MiniLM-L6-v2' | 'fast-bge-base-en' | 'fast-bge-base-en-v1.5' | 'fast-bge-small-en' | 'fast-bge-small-en-v1.5' | 'fast-bge-small-zh-v1.5' | 'fast-multilingual-e5-large' =>
typeof m === 'string' && [
'fast-all-MiniLM-L6-v2','fast-bge-base-en','fast-bge-base-en-v1.5','fast-bge-small-en','fast-bge-small-en-v1.5','fast-bge-small-zh-v1.5','fast-multilingual-e5-large',
].includes(m); Prevention
- Use the exact 'fast-' prefixed names from the error message, not HuggingFace hub IDs
- Centralize the model choice in one constant so switching models is a one-line, compiler-checked change
- If you need an unlisted model, switch to the openai or huggingface (TEI) provider instead of fighting the allowlist
When it happens
Trigger: Passing a HuggingFace-style model ID (e.g. 'BAAI/bge-small-en-v1.5' or 'sentence-transformers/all-MiniLM-L6-v2') instead of the 'fast-' prefixed FastEmbed name; passing 'nomic-embed-text' or other models added in newer fastembed versions but not yet mirrored in this SDK; trailing whitespace/casing differences.
Common situations: Copying a model name from the HuggingFace hub or the Python sentence-transformers docs; upgrading the fastembed package and expecting new models to work before the SDK allowlist catches up.
Related errors
- Unknown embedder provider: ${providerId}
- Azure OpenAI requires both API key and endpoint
- FastEmbed embed() returned no embeddings
- HuggingFace embedder requires an inference endpoint. Set `hu
- Langchain embedder provider requires an initialized Langchai
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/4b13d89b6b3a670b.
Report an issue: GitHub.