Skip to content
LlamaIndex 文档版本 跟随上游 源快照 d118fd73 更新于 2026-10-18

LlamaIndex 支持使用 FastEmbed 生成嵌入。

如果你在 Colab 中打开这个 Notebook,可能需要先安装 LlamaIndex 🦙。

%pip install llama-index-embeddings-fastembed
%pip install llama-index

要使用该提供商,需要安装 fastembed 包。

%pip install fastembed

支持的模型列表可在此处找到。

from llama_index.embeddings.fastembed import FastEmbedEmbedding

embed_model = FastEmbedEmbedding(model_name="BAAI/bge-small-en-v1.5")
100%|██████████| 76.7M/76.7M [00:18<00:00, 4.23MiB/s]
embeddings = embed_model.get_text_embedding("Some text to embed.")
print(len(embeddings))
print(embeddings[:5])
384
[-0.04166769981384277, 0.0018720313673838973, 0.02632238157093525, -0.036030545830726624, -0.014812108129262924]

BytesRouter 是社区翻译站点,所有译文仅供参考,一切以官方英文原文为准。