Skip to main content
Nebius Token Factory 提供对 high-quality 向量嵌入模型 through a unified 接口。 The Nebius 向量嵌入模型 convert text into numerical vectors that capture semantic meaning, making them useful for various applications like semantic search, clustering, and recommendations.

概述

The NebiusEmbeddings class provides access to Nebius Token Factory’s 向量嵌入模型 through LangChain. These embeddings can be used for semantic search, document similarity, and other NLP tasks requiring vector representations of text.

集成详情

  • Provider: Nebius Token Factory
  • Model Type: Text 向量嵌入模型
  • Primary Use Case: Generate vector representations of text for semantic similarity and retrieval
  • Currently Highlighted Model: Qwen/Qwen3-Embedding-8B
  • Embedding Dimensions: 4,096 (for Qwen/Qwen3-Embedding-8B)

设置

安装

The Nebius integration can be installed via pip:

凭证

Nebius requires an API key that can be passed as an initialization parameter api_key or set as the environment variable NEBIUS_API_KEY. You can obtain an API key by creating an account on Nebius Token Factory.

实例化

The NebiusEmbeddings class can be instantiated with optional parameters for the API key and model name:

可用模型

The list of supported models is available at Nebius Token Factory Models Page

索引与检索

向量嵌入模型常用于检索增强生成 (RAG) 流程中, both for indexing data and later retrieving it. The following example demonstrates how to use NebiusEmbeddings with a vector store for document retrieval.

Using with InMemoryVectorStore

You can also use the InMemoryVectorStore for lightweight applications:

直接使用

You can directly use the NebiusEmbeddings class to generate embeddings for text without using a vector store.

Embedding a single text

You can use the embed_query method to embed a single piece of text:

Embedding multiple texts

You can embed multiple texts at once using the embed_documents method:

异步支持

NebiusEmbeddings 支持异步操作:

Document similarity example


API 参考

更多详情 about the Nebius Token Factory API, visit the Nebius Token Factory Documentation.