{"record":{"id":"4b13d89b6b3a670b","repo":"mem0ai/mem0","slug":"unsupported-fastembed-model-config-model-sup","errorCode":null,"errorMessage":"Unsupported FastEmbed model \"${config.model}\". Supported models: ${SUPPORTED_MODELS.join(\", \")}.","messagePattern":"Unsupported FastEmbed model \"(.+?)\"\\. Supported models: (.+?)\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/embeddings/fastembed.ts","lineNumber":31,"sourceCode":"  \"fast-all-MiniLM-L6-v2\",\n  \"fast-bge-base-en\",\n  \"fast-bge-base-en-v1.5\",\n  \"fast-bge-small-en\",\n  \"fast-bge-small-en-v1.5\",\n  \"fast-bge-small-zh-v1.5\",\n  \"fast-multilingual-e5-large\",\n] as const;\ntype FastEmbedModel = (typeof SUPPORTED_MODELS)[number];\nconst DEFAULT_MODEL: FastEmbedModel = \"fast-bge-small-en-v1.5\";\n\nexport class FastEmbedEmbedder implements Embedder {\n  private readonly modelName: FastEmbedModel;\n  private embeddingModel?: Promise<FlagEmbedding>;\n\n  constructor(config: EmbeddingConfig) {\n    if (typeof config.model === \"string\" && config.model.length > 0) {\n      if (!SUPPORTED_MODELS.includes(config.model as FastEmbedModel)) {\n        throw new Error(\n          `Unsupported FastEmbed model \"${config.model}\". ` +\n            `Supported models: ${SUPPORTED_MODELS.join(\", \")}.`,\n        );\n      }\n      this.modelName = config.model as FastEmbedModel;\n    } else {\n      this.modelName = DEFAULT_MODEL;\n    }\n  }\n\n  private getEmbeddingModel(): Promise<FlagEmbedding> {\n    if (!this.embeddingModel) {\n      this.embeddingModel = this.initEmbeddingModel().catch((error) => {\n        this.embeddingModel = undefined;\n        throw error;\n      });\n    }\n","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/embeddings/fastembed.ts#L13-L49","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nembedder: { provider: 'fastembed', config: { model: 'BAAI/bge-small-en-v1.5' } }\n\n// after\nembedder: { provider: 'fastembed', config: { model: 'fast-bge-small-en-v1.5' } }","handlingStrategy":"type-guard","validationCode":"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'];\nif (model && !SUPPORTED.includes(model)) {\n  throw new Error(`Model ${model} not in FastEmbed allowlist; pick from ${SUPPORTED.join(', ')}`);\n}","typeGuard":"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' =>\n  typeof m === 'string' && [\n    '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',\n  ].includes(m);","tryCatchPattern":null,"preventionTips":["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"],"tags":["fastembed","embeddings","validation","config","onnx"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}