嵌入向量模型决定了你的检索系统能检索到什么。它把每个输入转换为一个向量,并将相关的输入彼此靠近放置,这样你的应用就能按语义而非精确措辞来检索。
最佳选择取决于你需要检索的材料。英文知识库、多语言支持档案库、源代码仓库,以及文本加图像的集合,各自有着不同的需求。向量维度、上下文长度、公开权重和价格也会改变这一决策。
我们为英文 RAG、多语言检索、代码搜索、文本加图像检索以及低成本索引分别筛选了候选模型,然后通过我们的 embeddings 端点向每一个模型发送了实时请求。
最后验证时间: 2026 年 9 月 11 日。我们的嵌入向量模型目录在该日期返回了 37 个条目,其中包括部分模型的批量和预览变体。
提供商可能会增加或移除路由,提示词价格也可能变化。在开始大规模索引或重新索引任务之前,请查看当前的模型页面。如果模型页面与本指南不一致,请以模型页面为准。
简而言之
- 英文 RAG 从
openai/text-embedding-3-small开始。 - 当你的输入超过 8,192 tokens,或者你想在 Voyage 4 各档之间切换而无需重建索引时,可以测试
voyageai/voyage-4-large。如果你想要一个开放权重替代方案,qwen/qwen3-embedding-8b拥有更长的上下文窗口,且提示词价格更低。 - 使用
qwen/qwen3-embedding-8b进行多语言检索,采用公开权重;使用voyageai/voyage-code-4进行代码搜索;使用google/gemini-embedding-2或voyageai/voyage-multimodal-3.5进行文本与图像检索。 perplexity/pplx-embed-v1-0.6b在我们候选名单中的付费文本模型里拥有最低的提示词价格。nvidia/nemotron-3-embed-1b:free是一个免费的文本嵌入向量路由,具有 32,768-token 的上下文窗口。- 我们的 API 检查确认的是请求和响应行为,而非检索质量。在构建或重建完整索引之前,请至少用你应用中的标注查询和文档对比两个候选方案。
按使用场景划分的最佳嵌入向量模型
| 使用场景 | 推荐模型 | 入选候选名单的原因 |
|---|---|---|
| 默认英文 RAG | openai/text-embedding-3-small | 低提示词价格、8,192-token 上下文,以及可调整的输出维度 |
| 输入超过 8,192 tokens | voyageai/voyage-4-large | 32,000-token 上下文、四种可选维度,以及与其他 Voyage 4 层级兼容的嵌入向量 |
| 使用公开权重进行多语言检索 | qwen/qwen3-embedding-8b | 支持超过 100 种语言、32,768 token 的上下文窗口,以及公开权重 |
| 代码搜索 | voyageai/voyage-code-4 | 专为检索代码及相关技术内容而构建 |
| 文本与图像检索 | google/gemini-embedding-2 | 将文本和图像置于同一嵌入向量空间。voyageai/voyage-multimodal-3.5 是我们验证的第二个选项 |
| 价格最低的付费文本选项 | perplexity/pplx-embed-v1-0.6b | 提示词价格为每百万输入 token $0.004,上下文窗口为 32,000 token |
| 免费文本嵌入向量 | nvidia/nemotron-3-embed-1b:free | 一条免费路由,具有 32,768 token 的上下文窗口和多语言模型卡 |
按输入类型选择模型
从你需要检索的素材入手。这张图表先按输入类型排序,再按你是否需要公开权重排序,最后按你的主要限制条件排序。

这张图表为你提供一个起点。在构建或重建大型索引之前,至少用你应用中的查询和文档对比两个候选模型,并跟踪每个模型检索到相关文本块的频率。
我们如何选择这些模型
我们使用实时目录来确认可用性、上下文窗口、输入类型和提示词价格。我们查阅了模型提供商的文档以了解其能力和基准测试结果,然后通过我们的嵌入向量端点发送实时请求,以确认请求和响应行为。
我们向 19 个模型发送了双字符串批量请求,共运行了 28 项检查,涵盖批量输入、可配置维度、图像输入、文本加图像输入以及错误处理。16 个付费模型每个输入返回一个向量。响应确认了下表中的默认维度,并表明 dimensions 参数适用于 OpenAI Text Embedding 3 Small、Gemini Embedding 2 和 Voyage 4 Large。对不存在的模型发起请求会返回 400 错误,并附带消息 Model openai/does-not-exist does not exist。
这三条免费路由从我们的测试账户返回了 404 错误,因为该账户的隐私设置不允许路由到可能使用免费模型提示词进行训练的提供商。我们将在下文的免费选项部分描述该设置。我们为这些模型列出的默认维度来自它们的模型卡,而非来自我们的响应。
这些请求确认了 API 兼容性。它们并未衡量检索质量。我们排除了响应时间,因为每个模型都是在不同的服务条件下接收一个较小的请求。我们将每个用例与一项有文档记录的能力进行匹配,然后使用语言覆盖范围、上下文长度、输出维度、公开权重和提示词价格来缩小候选范围。已发布的评测,包括 MTEB 和 CoIR,帮助我们确定了要测试的模型。你标注的检索结果应当决定你部署哪一个。
比较入围的嵌入向量模型
以下价格是 2026 年 9 月 11 日我们目录中列出的提示词价格,而 Gemini Embedding 2 的图像价格是 2026 年 9 月 18 日的目录值。默认维度来自我们的实时响应,唯一的例外是免费的 NVIDIA 模型,其默认值来自其模型卡。
| 模型 | 输入 | 上下文 | 默认维度 | 每百万 token 的提示词价格 | 权重 |
|---|---|---|---|---|---|
openai/text-embedding-3-small | 文本 | 8,192 | 1,536 | $0.02 | 已关闭 |
openai/text-embedding-3-large | 文本 | 8,192 | 3,072 | $0.13 | 已关闭 |
voyageai/voyage-4-lite | 文本 | 32,000 | 1,024 | $0.02 | 已关闭 |
voyageai/voyage-4 | 文本 | 32,000 | 1,024 | $0.06 | 已关闭 |
voyageai/voyage-4-large | 文本 | 32,000 | 1,024 | $0.12 | 已关闭 |
voyageai/voyage-code-4 | 文本,针对代码优化 | 32,000 | 1,024 | $0.12 | 已关闭 |
voyageai/voyage-multimodal-3.5 | 文本和图像 | 32,000 | 1,024 | $0.12 | 已关闭 |
qwen/qwen3-embedding-8b | 文本 | 32,768 | 4,096 | $0.01 | 开放 |
qwen/qwen3-embedding-4b | 文本 | 32,768 | 2,560 | $0.02 | 开放 |
perplexity/pplx-embed-v1-0.6b | 文本 | 32,000 | 1,024 | $0.004 | 开放 |
perplexity/pplx-embed-v1-4b | 文本 | 32,000 | 2,560 | $0.03 | 开放 |
google/gemini-embedding-2 | 文本和图像 | 8,192 | 3,072 | 文本 $0.20,图像 token $0.45 | 闭源 |
nvidia/nemotron-3-embed-1b:free | 文本 | 32,768 | 2,048 | 免费 | 开放 |
维度列会影响原始索引大小。公式和示例见下文“计算向量存储”。
我们的目录中包含的模型比表中展示的更多。baai/bge-m3 增加了另一个开放的多语言选项,mistralai/mistral-embed-2312 提供了通用文本替代方案,而 mistralai/codestral-embed-2505 则面向代码检索。这三者在我们文本请求检查中都返回了向量。目录还列出了来自 BAAI、E5、GTE 和 Sentence Transformers 的一组 512-token 开放模型,价格为每百万 token $0.005 至 $0.01,我们未在本指南中对其进行测试。
英文 RAG 的最佳默认选择
当你需要一个用于英文知识库的托管模型时,从 openai/text-embedding-3-small 开始。它的默认向量有 1,536 个值,是 openai/text-embedding-3-large 默认值的一半。在相同的数值格式下,Small 使用的原始向量存储只有一半。首次评估时保留 1,536 个值的默认设置,只有当默认设置满足检索目标但存储或搜索成本仍是制约因素时,才考虑缩减。
你可以用 dimensions 参数缩短它的向量。我们使用 "dimensions": 256 的请求返回了一个包含 256 个值的向量。更小的向量占用更少的数据库存储,并减少相似度搜索所需的工作量,但它们也可能降低检索质量。在更改现有索引之前,先测试更小的尺寸。
OpenAI 将 text-embedding-3-large 描述为其在英文和非英文任务上能力最强的嵌入模型。当 Small 遗漏相关结果时,尤其是当用户跨语言搜索时,测试它。迁移到 Large 会改变向量大小和提示词价格,因此在重新嵌入语料库之前,先在留出问题上比较两个模型。
如果你的输入超过 Small 的 8,192-token 限制,测试 Voyage 4 Large。对于较短的输入,使用相同的分块、查询和相关性标签来比较两个模型。
Voyage 4 系列,适用于更长的输入
当你需要一个托管的 32,000-token 模型,且要求维度可调、并兼容 Voyage 4 各档位时,可以测试 voyageai/voyage-4-large。它最多接受 32,000 tokens,并支持 256、512、1,024 和 2,048 维。在我们的 API 检查中,将 dimensions 设为 512 返回了一个包含 512 个值的向量。
该系列包括 voyageai/voyage-4 和 voyageai/voyage-4-lite,它们使用相同的上下文窗口。Voyage 表示,使用 4 系列创建的所有嵌入向量彼此兼容。这让你可以针对现有索引测试另一个 Voyage 4 档位。在部署前,请在具有代表性的样本上验证档位变更。兼容的向量空间免除了重建索引的要求,但并不能保证检索结果完全一致。
用 Large 和至少一个更低的 Voyage 4 档位在同一评估集上运行。如果它们在相同截断点检索到相同的相关段落,那么更低的档位可能满足你的需求。
Voyage 模型是托管服务。如果你需要公开权重以便自托管或控制部署,Qwen3 Embedding 8B 是本短名单中的开放权重替代方案。
最适合多语言检索的开放权重模型
qwen/qwen3-embedding-8b 是我们开放权重的多语言选择。它支持 100 多种语言,你可以从 Hugging Face 下载权重,或通过我们的 API 调用托管模型。我们的默认 API 请求返回了 4,096 个值。在相同的数值格式下,一个 4,096 值的向量占用的原始存储空间是一个 1,024 值向量的四倍。在估算索引大小时要把这一差异考虑进去。我们的 API 检查并不能确定 Qwen3 Embedding 8B 是否比 nvidia/nemotron-3-embed-1b:free 检索效果更好。当路由成本和向量大小会影响决策时,在最终确定之前,请在同一份标注数据集上对两者都进行测试。
Qwen 模型卡显示,截至 2025 年 6 月 5 日,其在 Massive Text Embedding Benchmark(MTEB)上的多语言得分为 70.58。这是厂商报告的公开基准测试结果。用它来把 Qwen 列入候选名单,然后测试你的应用所支持的每一种语言和领域,因为你的语料库可能得出不同的排名。
模型页面列出了 32,768 token 的上下文窗口,但该限制是按端点设置的。2026 年 9 月 11 日,Qwen3 Embedding 8B 的 DeepInfra 和 SiliconFlow 端点列出的是 32,768 token,而 Nebius 端点列出的是 32,000。如果你发送的输入超过 32,000 token,请查看 端点列表,并固定选择一个限制更大的提供商,或将输入保持在 32,000 token 及以下。
4B 版本使用相同的模型级上下文窗口,在我们的检查中返回了 2,560 个值。它自行运行所需的资源更少。托管价格取决于可用的提供商,因此在选择之前,请比较 Qwen3 Embedding 8B 和 4B 当前的模型页面。
baai/bge-m3 为你提供了第二个开放的多语言模型,可在你自己的数据集上与 Qwen3 进行对比。其 模型卡涵盖 100 多种语言,输入上限为 8,192 个 token,我们的请求返回了一个 1,024 维的向量。上游模型可以返回多种表示类型,包括稠密向量和稀疏向量。我们的标准嵌入响应返回的是稠密向量。如果你的检索设计依赖于其他表示类型,请使用上游实现。
最适合代码搜索的嵌入模型
当查询需要检索某个函数、文件或某段代码文档时,请使用 voyageai/voyage-code-4。Voyage 专为代码检索和编码智能体工作负载构建了该模型。其 32,000 token 的上下文窗口可以接受较长的文件或查询,不过索引分块仍应代表在被检索时有用的代码单元。
mistralai/codestral-embed-2505 是我们目录中主要的代码专用替代方案。在我们的文本请求检查中,它返回了 1,536 个值。其上下文窗口为 8,192 个 token,而 Voyage Code 4 为 32,000 个。请先测试 Voyage Code 4,并将 Codestral Embed 作为对比模型。
公开评测可以帮助你比较候选模型。代码信息检索基准 CoIR包含十个数据集,覆盖七个领域中的八项代码检索任务。在将最强的候选模型用于你自己代码仓库中的工作进行测试之前,可以用它来比较模型。一个有用的内部评测方式,是将 issue 描述或开发者问题映射到解决它们所需的文件和分块。
最适合文本与图像检索的模型
当同一个索引需要同时检索文本和图像时,请使用 google/gemini-embedding-2。它把两种输入类型放入同一个嵌入向量空间,因此文本查询可以检索到含义相关的图像,图像查询也可以检索到相关文本。
我们通过 embeddings 端点验证了文本、base64 编码的 PNG 图像,以及文本与图像组合的请求。每个请求都返回一个包含 3,072 个数值的向量。我们还发送了一个使用 "dimensions": 768 的文本请求,收到了一个包含 768 个数值的向量。在我们的检查中,一张 64 × 64 像素的 PNG 计为 258 个提示词 token,费用为 $0.000128。截至 2026 年 9 月 18 日,我们的目录在 模型页面上为该模型单独标注了图像输入价格,为每百万图像 token $0.45,因此在为大规模图像集合建立索引之前,请先查看模型页面。本指南将推荐范围限定为文本和图像输入,因为这些是我们验证过的请求类型。
voyageai/voyage-multimodal-3.5 是我们验证的第二个文本与图像模型。它的图像请求和文本与图像组合请求各自返回一个包含 1,024 个数值的向量,同样一张 64 × 64 像素的 PNG 计为 89 个提示词 token,费用为 $0.00003。它具有 32,000 token 的上下文窗口,提示词价格为每百万 token $0.12。Gemini Embedding 2 和 Voyage Multimodal 3.5 使用不同的向量空间,因此在建立索引之前请先选定其中一个。
google/gemini-embedding-001 是一个独立的纯文本模型,具有 20,000 token 的上下文窗口。这两个 Gemini 模型使用不同的向量空间,因此在它们之间切换需要你重新为索引生成嵌入向量。
nvidia/llama-nemotron-embed-vl-1b-v2:free 是我们目录中一个免费的文本与图像路由,上下文窗口为 131,072 个 token。由于下文所述的隐私设置原因,我们的测试账号无法调用它,因此我们将其排除在推荐之外。
最佳低成本与免费选项
perplexity/pplx-embed-v1-0.6b 在我们候选名单中拥有最低的付费文本价格,为每百万输入 token $0.004。它最多接受 32,000 个 token,并返回了一个包含 1,024 个值的向量。更大的 perplexity/pplx-embed-v1-4b 返回了 2,560 个值,其提示词价格为每百万输入 token $0.03。
Perplexity 将 0.6B 模型定位为轻量、低延迟的检索,将 4B 模型定位为更高质量的检索。我们的 API 检查确认了默认向量大小,但并未确认哪个 Perplexity 模型检索效果更好。将提供商的定位视为候选信号,并在带标注的查询上比较这两个模型。
将免费路由用于评估,而不是作为大型生产索引任务的唯一路径。当你需要一个免费的候选模型来测试时,可以从 nvidia/nemotron-3-embed-1b:free 开始。它的上下文窗口为 32,768 个 token,并且 NVIDIA 的模型卡 报告了 2,048 个值的输出向量、覆盖 34 种语言的评估,以及通过 L2 重新归一化将向量切分为更小尺寸的支持。NVIDIA 在 OpenMDW-1.1 许可下发布了权重。在将免费路由用于生产索引任务之前,请查看当前模型页面以了解可用性和速率限制。可用性和速率限制可能会在批处理期间发生变化。
我们目录中的免费路由由数据政策可能允许使用你的提示词进行训练的提供商提供服务。你的账户隐私设置中,付费模型和免费模型有各自独立的开关。当免费模型开关关闭时,向这些路由之一发出的请求会返回 404 错误,该错误会指明免费模型训练设置并列出被排除的端点。我们的测试账户关闭了该开关,这就是那三条免费路由未能通过我们检查的原因。一个禁用免费模型训练的工作区护栏,或在请求中将provider.data_collection设置为deny,会排除相同的端点并产生相同的 404 错误。关于我们如何应用这些设置,请参阅提供商日志记录与训练政策。
liquid/lfm-2.5-embedding-350m:free是候选名单中的另一条免费文本路由。其 512-token 上下文窗口将每次输入限制为一段短文本,因此较长的文档需要比本指南中其他模型更小的分块。仅当每个嵌入文本段都适合在 512 tokens 以内时使用它,例如简短的 FAQ 条目、标题或句子级片段。当你的检索单元需要更长的上下文时,请将其排除。
在你的数据上评估嵌入向量模型
对每个候选模型使用相同的语料库、查询、相关性标签、分块和检索指标。只更换模型,保持评估的其余部分固定不变,以便结果保持可比性。
评估英文 RAG
为每个候选方案使用相同的分块策略。先从约 512 到 1,024 个 token 的块开始,并设置重叠,然后根据你的文档结构和检索结果调整块大小。
从你的用户提出的问题入手,并标注包含答案的块。使用你的应用发送给生成模型的相同检索块数量来衡量召回率。当多个块都相关、但其中一些比另一些更有用时,加入归一化折损累计增益,即 nDCG。
评估多语言检索
纳入你计划支持的所有语言。如果用户可能用一种语言写查询、却检索另一种语言的文档,就加入跨语言用例。将每种语言的结果单独报告,并与总体平均值并列呈现,这样某一语言的优异结果就不会掩盖另一语言的糟糕结果。
评估代码搜索
使用开发者的问题或 issue 描述,并标注能解决它们的文件或代码块。CoIR 可以补充这一数据集。你针对自己代码仓库的标注应占更大权重,因为它们反映了你的应用实际会运行的搜索。
计算向量存储
将向量存储纳入比较。一百万个 4,096 维的 float32 向量在索引开销之前需要约 16.4 GB。一百万个 1,024 维的向量需要约 4.1 GB。你可以用以下公式估算原始存储:
vector storage in bytes = number of vectors x dimensions x bytes per value 在每一个受支持的向量维度上比较检索质量,然后选择满足你目标的最小维度。将选定的模型和维度同时用于索引和查询。
为索引和查询使用兼容的模型
来自不同模型族的向量不共享同一坐标空间。如果你用 openai/text-embedding-3-small 为文档建立索引,就必须用相同的模型和配置为每个查询生成嵌入向量。混用模型会产生不可靠的检索结果。同样的规则也适用于 google/gemini-embedding-2 和 google/gemini-embedding-001。在它们之间切换需要重建索引。
更换模型通常需要重新为整个语料库生成嵌入向量。Voyage 在设计 Voyage 4 文本模型时就使其产生兼容的向量,这在该模型族内构成了一个有文档记录的例外。在更改查询或索引路径之前,先对样本进行测试,因为所选的层级仍可能影响检索质量。
将模型 slug、输出维度、提示词格式和创建日期与索引元数据一起存储。一些嵌入模型使用 input_type 值来区分查询(例如 search_query)与索引内容(例如 search_document)。将每一侧所使用的值随索引元数据一起存储。这些字段让后续部署在查询索引之前能够核对其嵌入配置。
在我们的整个模型目录中,端点保持不变。模型 slug 和输出维度必须与构建索引时所用的配置一致。如果你用非默认维度构建了索引,那么在为查询生成嵌入向量时也要包含相同的 dimensions 值。
通过我们的 API 调用嵌入模型
向 https://openrouter.ai/api/v1/embeddings 发送请求。以下 Python 示例使用了通过我们验证的相同批量请求结构:
import os
import requests
response = requests.post(
"https://openrouter.ai/api/v1/embeddings",
headers={
"Authorization": f"Bearer {os.environ['OPENROUTER_API_KEY']}",
"Content-Type": "application/json",
},
json={
"model": "openai/text-embedding-3-small",
"input": [
"Reset a password from the account settings page.",
"Refunds are available within 14 days of purchase.",
],
},
timeout=90,
)
response.raise_for_status()
result = response.json()
vectors = [item["embedding"] for item in result["data"]]
print(len(vectors))
print(len(vectors[0])) 响应中会按相同顺序为每个输入返回一个向量。当所选模型支持可调维度时,请在请求中添加 "dimensions": 256 或其他受支持的维度值,并将该值与索引元数据一起存储。
对于 Gemini Embedding 2 和 Voyage Multimodal 3.5,请将图像输入放入 content 数组中,该数组位于 input 列表内。我们已在两个模型上验证了这一请求结构:
payload = {
"model": "google/gemini-embedding-2",
"input": [
{
"content": [
{"type": "text", "text": "A purple square"},
{
"type": "image_url",
"image_url": {"url": "data:image/png;base64,BASE64_IMAGE_DATA"},
},
]
}
],
"encoding_format": "float",
} 省略文本部分即可仅嵌入图像。完整的请求与响应 schema 请参阅我们的 Embeddings API 文档。
常见问题
我应该使用哪个嵌入向量模型?
根据你检索的材料以及对部署至关重要的约束条件来选择。先从支持你的输入类型、语言覆盖范围、上下文长度和权重要求的候选模型入手。在同一组标注查询上至少比较两个模型,然后选择那个在可接受的存储和索引成本下满足你检索目标的模型。
我可以在不重建索引的情况下更换嵌入向量模型吗?
切换到另一个模型系列需要重建索引,因为文档和查询必须使用来自同一模型和配置的向量。Voyage 表示,Voyage 4 Large、Voyage 4 和 Voyage 4 Lite 的嵌入向量彼此兼容。在更换档位之前,先在样本上测试检索质量。
最快的嵌入向量模型是什么?
我们没有为本指南运行受控的延迟基准测试。延迟会随输入长度、批大小、提供商负载和路由而变化。请用你的应用实际会使用的输入和批大小来测试这些端点。
我应该使用最大的嵌入维度吗?
根据你的检索结果和存储限制来选择嵌入维度。更高的维度需要更多存储,每次相似度搜索也需要更多计算。当模型支持降低维度时,使用在你的评估集上满足检索目标的最小维度。
text-embedding-ada-002 还是一个好的默认选择吗?
我们不会把 text-embedding-ada-002 作为新的基于 OpenAI 的索引的默认选择。先评估 text-embedding-3-small,然后如果你的检索结果足以证明更高的提示词价格和更大的向量是合理的,再将其与 text-embedding-3-large 进行比较。
为什么一个免费的嵌入向量模型会返回 404 错误?
我们目录中的免费嵌入向量路由由数据政策可能允许使用你的提示词进行训练的提供商提供服务。如果你的账户隐私设置、工作区护栏,或将 provider.data_collection 请求字段设置为 deny 排除了那些会使用免费模型提示词进行训练的提供商,那么就没有符合条件的端点,请求会返回 404 错误,并指明免费模型训练限制。在你认定该模型 ID 无效之前,请先检查你账户的隐私页面以及应用于该 API key 的任何护栏。
An embedding model decides what your retrieval system can find. It turns each input into a vector and places related inputs near one another, so your application can retrieve by meaning instead of exact wording.
The best choice depends on the material you need to search. An English knowledge base, a multilingual support archive, a source-code repository, and a text-and-image collection have different requirements. Vector size, context length, public weights, and price can also change the decision.
We shortlisted models for English RAG, multilingual retrieval, code search, text-and-image retrieval, and low-cost indexing, then sent live requests to each one through our embeddings endpoint.
Last verified: 11 September 2026. Our embedding model catalog returned 37 entries on that date, including batch and preview variants of some models.
Providers can add or remove routes, and prompt prices can change. Check the current model page before starting a large indexing or re-indexing job. If the model page differs from this guide, use the model page.
TL;DR
- Start with
openai/text-embedding-3-smallfor English RAG. - Test
voyageai/voyage-4-largewhen your inputs exceed 8,192 tokens or you want to move between Voyage 4 tiers without rebuilding the index.qwen/qwen3-embedding-8bhas a longer context window at a lower prompt price if you want an open-weight alternative. - Use
qwen/qwen3-embedding-8bfor multilingual retrieval with public weights,voyageai/voyage-code-4for code search, andgoogle/gemini-embedding-2orvoyageai/voyage-multimodal-3.5for text-and-image retrieval. perplexity/pplx-embed-v1-0.6bhas the lowest prompt price among the paid text models in our shortlist.nvidia/nemotron-3-embed-1b:freeis a free text-embedding route with a 32,768-token context window.- Our API checks confirm request and response behavior, not retrieval quality. Compare at least two candidates on labeled queries and documents from your application before building or rebuilding the full index.
Best embedding models by use case
| Use case | Recommended model | Why it is on the shortlist |
|---|---|---|
| Default English RAG | openai/text-embedding-3-small | Low prompt price, 8,192-token context, and adjustable output dimensions |
| Inputs longer than 8,192 tokens | voyageai/voyage-4-large | 32,000-token context, four selectable dimensions, and embeddings compatible with the other Voyage 4 tiers |
| Multilingual retrieval with public weights | qwen/qwen3-embedding-8b | Support for more than 100 languages, a 32,768-token context window, and public weights |
| Code search | voyageai/voyage-code-4 | Built for retrieving code and related technical content |
| Text-and-image retrieval | google/gemini-embedding-2 | Places text and images in the same embedding space. voyageai/voyage-multimodal-3.5 is the second option we verified |
| Lowest-priced paid text option | perplexity/pplx-embed-v1-0.6b | Prompt price of $0.004 per million input tokens with a 32,000-token context window |
| Free text embeddings | nvidia/nemotron-3-embed-1b:free | A free route with a 32,768-token context window and a multilingual model card |
Choose a model by input type
Start with the material you need to search. The chart sorts by input type first, then by whether you need public weights, then by your main constraint.

The chart gives you a starting point. Compare at least two candidates with queries and documents from your application, and track how often each model retrieves the relevant chunks before you build or rebuild a large index.
How we chose these models
We used our live catalog to confirm availability, context windows, input types, and prompt prices. We checked the model providers’ documentation for capabilities and benchmark results, then sent live requests through our embeddings endpoint to confirm request and response behavior.
We sent a two-string batch request to 19 models and ran 28 checks in total, covering batch input, configurable dimensions, image input, text-and-image input, and error handling. The 16 paid models returned one vector per input. The responses confirmed the default dimensions in the table below and showed that the dimensions parameter works with OpenAI Text Embedding 3 Small, Gemini Embedding 2, and Voyage 4 Large. A request for a model that does not exist returned a 400 error with the message Model openai/does-not-exist does not exist.
The three free routes returned a 404 error from our test account because its privacy settings do not allow routing to providers that may train on free-model prompts. We describe that setting in the free options section below. The default dimensions we list for those models come from their model cards, not from our responses.
These requests confirmed API compatibility. They did not measure retrieval quality. We excluded response times because each model received one small request under different serving conditions. We matched each use case to a documented capability, then used language coverage, context length, output dimensions, public weights, and prompt price to narrow the candidates. Published evaluations, including MTEB and CoIR, helped us identify models to test. Your labeled retrieval results should decide which one you deploy.
Compare the shortlisted embedding models
The prices below are the prompt prices listed in our catalog on 11 September 2026, and the image price for Gemini Embedding 2 is the catalog value on 18 September 2026. The default dimensions come from our live responses, except for the free NVIDIA model, whose default comes from its model card.
| Model | Input | Context | Default dimensions | Prompt price per million tokens | Weights |
|---|---|---|---|---|---|
openai/text-embedding-3-small | Text | 8,192 | 1,536 | $0.02 | Closed |
openai/text-embedding-3-large | Text | 8,192 | 3,072 | $0.13 | Closed |
voyageai/voyage-4-lite | Text | 32,000 | 1,024 | $0.02 | Closed |
voyageai/voyage-4 | Text | 32,000 | 1,024 | $0.06 | Closed |
voyageai/voyage-4-large | Text | 32,000 | 1,024 | $0.12 | Closed |
voyageai/voyage-code-4 | Text, optimized for code | 32,000 | 1,024 | $0.12 | Closed |
voyageai/voyage-multimodal-3.5 | Text and image | 32,000 | 1,024 | $0.12 | Closed |
qwen/qwen3-embedding-8b | Text | 32,768 | 4,096 | $0.01 | Open |
qwen/qwen3-embedding-4b | Text | 32,768 | 2,560 | $0.02 | Open |
perplexity/pplx-embed-v1-0.6b | Text | 32,000 | 1,024 | $0.004 | Open |
perplexity/pplx-embed-v1-4b | Text | 32,000 | 2,560 | $0.03 | Open |
google/gemini-embedding-2 | Text and image | 8,192 | 3,072 | $0.20 for text, $0.45 for image tokens | Closed |
nvidia/nemotron-3-embed-1b:free | Text | 32,768 | 2,048 | Free | Open |
The dimensions column affects raw index size. See “Calculate vector storage” below for the formula and examples.
Our catalog contains more models than the table shows. baai/bge-m3 adds another open multilingual option, mistralai/mistral-embed-2312 provides a general text alternative, and mistralai/codestral-embed-2505 targets code retrieval. All three returned vectors in our text request check. The catalog also lists a set of 512-token open models from BAAI, E5, GTE, and Sentence Transformers at $0.005 to $0.01 per million tokens, which we did not test for this guide.
Best default for English RAG
Start with openai/text-embedding-3-small when you need a managed model for an English knowledge base. Its default vector has 1,536 values, half as many as the default from openai/text-embedding-3-large. With the same numeric format, Small uses half as much raw vector storage. Keep the 1,536-value default for the first evaluation and reduce it only if the default meets the retrieval target but storage or search cost remains a constraint.
You can shorten its vectors with the dimensions parameter. Our request with "dimensions": 256 returned a vector with 256 values. Smaller vectors use less database storage and reduce the work required for similarity search, but they can also reduce retrieval quality. Test the smaller size before changing an existing index.
OpenAI describes text-embedding-3-large as its most capable embedding model for English and non-English tasks. Test it when Small misses relevant results, particularly when users search across languages. Moving to Large changes the vector size and prompt price, so compare both models on held-out questions before re-embedding the corpus.
If your inputs exceed Small’s 8,192-token limit, test Voyage 4 Large. For shorter inputs, compare both models using the same chunks, queries, and relevance labels.
Voyage 4 family for longer inputs
Test voyageai/voyage-4-large when you need a managed 32,000-token model with adjustable dimensions and compatibility across Voyage 4 tiers. It accepts up to 32,000 tokens and supports 256, 512, 1,024, and 2,048 dimensions. In our API check, setting dimensions to 512 returned a vector with 512 values.
The family includes voyageai/voyage-4 and voyageai/voyage-4-lite, which use the same context window. Voyage states that all embeddings created with the 4 series are compatible with each other. This lets you test another Voyage 4 tier against an existing index. Validate a tier change on a representative sample before deployment. A compatible vector space removes the rebuild requirement, but it does not guarantee identical retrieval results.
Run Large and at least one lower Voyage 4 tier against the same evaluation set. If they retrieve the same relevant passages at the same cutoff, the lower tier may meet your requirements.
The Voyage models are managed services. If you need public weights for self-hosting or deployment control, Qwen3 Embedding 8B is the open-weight alternative in this shortlist.
Best open-weight model for multilingual retrieval
qwen/qwen3-embedding-8b is our open-weight multilingual choice. It supports more than 100 languages, and you can download the weights from Hugging Face or call the hosted model through our API. Our default API request returned 4,096 values. With the same numeric format, a 4,096-value vector uses four times the raw storage of a 1,024-value vector. Include that difference when estimating index size. Our API checks do not establish whether Qwen3 Embedding 8B retrieves better than nvidia/nemotron-3-embed-1b:free. When route cost and vector size affect the decision, test both on the same labeled set before you commit.
The Qwen model card reports a multilingual score of 70.58 on the Massive Text Embedding Benchmark, MTEB, as of 5 June 2025. This is a vendor-reported public benchmark result. Use it to shortlist Qwen, then test every language and domain your application supports, because your corpus can produce a different ranking.
The model page lists a 32,768-token context window, but the limit is set per endpoint. On 11 September 2026 the DeepInfra and SiliconFlow endpoints for Qwen3 Embedding 8B listed 32,768 tokens and the Nebius endpoint listed 32,000. If you send inputs longer than 32,000 tokens, check the endpoint list and pin a provider with the larger limit, or keep inputs at or under 32,000 tokens.
The 4B version uses the same model-level context window and returned 2,560 values in our check. It requires fewer resources to run yourself. Hosted prices depend on the available providers, so compare the current model pages for Qwen3 Embedding 8B and 4B before choosing.
baai/bge-m3 gives you a second open multilingual model to compare with Qwen3 on your own dataset. Its model card covers more than 100 languages and inputs of up to 8,192 tokens, and our request returned a 1,024-value vector. The upstream model can return several representation types, including dense vectors and sparse vectors. Our standard embeddings response returns the dense vector. Use the upstream implementation if your retrieval design depends on its other representation types.
Best embedding models for code search
Use voyageai/voyage-code-4 when a query needs to retrieve a function, file, or piece of code documentation. Voyage built the model for code retrieval and coding-agent workloads. Its 32,000-token context window can accept long files or queries, although the index chunks should still represent code units that are useful when retrieved.
mistralai/codestral-embed-2505 is the main code-specific alternative in our catalog. It returned 1,536 values in our text request check. Its context window is 8,192 tokens, against 32,000 for Voyage Code 4. Test Voyage Code 4 first and use Codestral Embed as the comparison model.
Public evaluations can help you compare the candidates. The Code Information Retrieval Benchmark, CoIR, contains ten datasets covering eight code-retrieval tasks across seven domains. Use it to compare models before testing the strongest candidates on work from your own repositories. One useful internal evaluation maps issue descriptions or developer questions to the files and chunks needed to resolve them.
Best models for text-and-image retrieval
Use google/gemini-embedding-2 when the same index needs to search text and images. It places both input types in one embedding space, so a text query can retrieve an image with related meaning and an image query can retrieve related text.
We verified text, base64-encoded PNG image, and combined text-and-image requests through our embeddings endpoint. Each request returned one vector with 3,072 values. We also sent a text request with "dimensions": 768 and received a vector with 768 values. In our check, a 64 by 64 pixel PNG counted as 258 prompt tokens and cost $0.000128. Our catalog prices image input for this model separately, at $0.45 per million image tokens on the model page as of 18 September 2026, so check the model page before indexing a large image collection. This guide limits the recommendation to text and image inputs because those are the request types we verified.
voyageai/voyage-multimodal-3.5 is the second text-and-image model we verified. Its image request and its combined text-and-image request each returned a vector with 1,024 values, and the same 64 by 64 pixel PNG counted as 89 prompt tokens and cost $0.00003. It has a 32,000-token context window and a prompt price of $0.12 per million tokens. Gemini Embedding 2 and Voyage Multimodal 3.5 use different vector spaces, so choose one before you index.
google/gemini-embedding-001 is a separate text-only model with a 20,000-token context window. The two Gemini models use different vector spaces, so changing between them requires you to re-embed the index.
nvidia/llama-nemotron-embed-vl-1b-v2:free is a free text-and-image route with a 131,072-token context window in our catalog. Our test account could not call it for the privacy-setting reason described below, so we left it out of the recommendation.
Best low-cost and free options
perplexity/pplx-embed-v1-0.6b has the lowest paid text price in our shortlist at $0.004 per million input tokens. It accepts up to 32,000 tokens and returned a vector with 1,024 values. The larger perplexity/pplx-embed-v1-4b returned 2,560 values and has a prompt price of $0.03 per million input tokens.
Perplexity positions the 0.6B model for lightweight, low-latency retrieval and the 4B model for higher retrieval quality. Our API checks confirmed the default vector sizes, not which Perplexity model retrieves better. Treat the provider’s positioning as a shortlist signal and compare both models on labeled queries.
Use a free route for evaluation, not as the only path for a large production indexing job. Start with nvidia/nemotron-3-embed-1b:free when you need a free candidate to test. It has a 32,768-token context window, and NVIDIA’s model card reports a 2,048-value output vector, evaluation across 34 languages, and support for slicing the vector to a smaller size with L2 re-normalization. NVIDIA publishes the weights under the OpenMDW-1.1 license. Check the current model page for availability and rate limits before using a free route for a production indexing job. Availability and rate limits can change during a batch.
The free routes in our catalog are served by providers whose data policy may allow training on your prompts. Your account privacy settings have separate switches for paid and free models. When the free-model switch is off, a request to one of these routes returns a 404 error that names the free model training setting and lists the excluded endpoint. Our test account has that switch off, which is why the three free routes failed our checks. A workspace guardrail that disables free-model training, or provider.data_collection set to deny on the request, excludes the same endpoints and produces the same 404 error. See provider logging and training policies for how we apply those settings.
liquid/lfm-2.5-embedding-350m:free is the other free text route in the shortlist. Its 512-token context window restricts each input to a short passage, so longer documents require smaller chunks than the other models in this guide. Use it only when each embedded passage fits within 512 tokens, such as short FAQ entries, titles, or sentence-level snippets. Exclude it when your retrieval unit needs longer context.
Evaluate embedding models on your data
Use the same corpus, queries, relevance labels, chunking, and retrieval metric for every candidate. Change the model while keeping the rest of the evaluation fixed so the results remain comparable.
Evaluate English RAG
Use the same chunking strategy for every candidate. Start with chunks of about 512 to 1,024 tokens with overlap, then adjust the size based on your document structure and retrieval results.
Begin with questions your users ask and label the chunks that contain the answer. Measure recall using the same number of retrieved chunks that your application sends to the generation model. Add normalized discounted cumulative gain, nDCG, when several chunks are relevant but some are more useful than others.
Evaluate multilingual retrieval
Include every language you plan to support. Add cross-language cases if users may write a query in one language and retrieve a document in another. Report each language separately alongside the overall average so strong results in one language do not hide weak results in another.
Evaluate code search
Use developer questions or issue descriptions and label the files or code chunks that resolve them. CoIR can supplement this set. Your repository-specific labels should carry more weight because they reflect the searches your application will run.
Calculate vector storage
Include vector storage in the comparison. One million 4,096-dimensional float32 vectors require about 16.4 GB before index overhead. One million 1,024-dimensional vectors require about 4.1 GB. You can estimate the raw storage with this formula:
vector storage in bytes = number of vectors x dimensions x bytes per value Compare retrieval quality at each supported vector size, then choose the smallest one that meets your target. Use the selected model and dimension for both indexing and querying.
Use compatible models for indexing and queries
Vectors from different model families do not share a coordinate space. If you index documents with openai/text-embedding-3-small, embed each query with the same model and configuration. Mixing models produces unreliable retrieval results. The same rule applies to google/gemini-embedding-2 and google/gemini-embedding-001. Switching between them requires rebuilding the index.
Changing the model usually requires re-embedding the corpus. Voyage designed the Voyage 4 text models to produce compatible vectors, which creates a documented exception within that family. Test a sample before changing the query or indexing path, because the selected tier can still affect retrieval quality.
Store the model slug, output dimension, prompt format, and creation date with the index metadata. Some embedding models use an input_type value to distinguish queries, such as search_query, from indexed content, such as search_document. Store the value used for each side with the index metadata. These fields let a later deployment check its embedding configuration before querying the index.
The endpoint stays the same across our model catalog. The model slug and output dimension must match the configuration used to build the index. If you built the index with a non-default dimension, include the same dimensions value when embedding queries.
Call an embedding model through our API
Send requests to https://openrouter.ai/api/v1/embeddings. This Python example uses the same batch request shape that passed our verification:
import os
import requests
response = requests.post(
"https://openrouter.ai/api/v1/embeddings",
headers={
"Authorization": f"Bearer {os.environ['OPENROUTER_API_KEY']}",
"Content-Type": "application/json",
},
json={
"model": "openai/text-embedding-3-small",
"input": [
"Reset a password from the account settings page.",
"Refunds are available within 14 days of purchase.",
],
},
timeout=90,
)
response.raise_for_status()
result = response.json()
vectors = [item["embedding"] for item in result["data"]]
print(len(vectors))
print(len(vectors[0])) The response contains one vector for each input in the same order. When the selected model supports adjustable dimensions, add "dimensions": 256 or another supported size to the request and store that value with the index metadata.
For Gemini Embedding 2 and Voyage Multimodal 3.5, place image input in a content array within the input list. We verified this request structure with both models:
payload = {
"model": "google/gemini-embedding-2",
"input": [
{
"content": [
{"type": "text", "text": "A purple square"},
{
"type": "image_url",
"image_url": {"url": "data:image/png;base64,BASE64_IMAGE_DATA"},
},
]
}
],
"encoding_format": "float",
} Omit the text part to embed the image alone. See our Embeddings API documentation for the full request and response schema.
FAQ
Which embedding model should I use?
Choose by the material you retrieve and the constraints that matter for deployment. Start with candidates that support your input types, language coverage, context length, and weight requirements. Compare at least two on the same labeled queries, then choose the model that meets your retrieval target at an acceptable storage and indexing cost.
Can I change embedding models without rebuilding the index?
Changing to another model family requires rebuilding the index, because documents and queries must use vectors from the same model and configuration. Voyage states that embeddings from Voyage 4 Large, Voyage 4, and Voyage 4 Lite are compatible with each other. Test retrieval quality on a sample before changing tiers.
What is the fastest embedding model?
We did not run a controlled latency benchmark for this guide. Latency changes with input length, batch size, provider load, and routing. Test the endpoints with the inputs and batch sizes your application will use.
Should I use the largest embedding dimension?
Choose the embedding dimension from your retrieval results and storage constraints. Higher dimensions require more storage and more work per similarity search. When a model supports reduced dimensions, use the smallest dimension that meets your retrieval target on your evaluation set.
Is text-embedding-ada-002 still a good default?
We would not use text-embedding-ada-002 as the default for a new OpenAI-based index. Evaluate text-embedding-3-small first, then compare it with text-embedding-3-large if your retrieval results justify the higher prompt price and larger vectors.
Why does a free embedding model return a 404 error?
The free embedding routes in our catalog are served by providers whose data policy may allow training on your prompts. If your account privacy settings, a workspace guardrail, or the provider.data_collection request field set to deny excludes providers that train on free-model prompts, no endpoint is eligible and the request returns a 404 error that names the free model training restriction. Check the privacy page of your account and any guardrail applied to the API key before you treat the model ID as invalid.