Skip to main content
Nebius AI Studio provides API access to high-quality embedding models through a unified interface. The Nebius embedding models convert text into numerical vectors that capture semantic meaning, making them useful for various applications like semantic search, clustering, and recommendations.

Overview

The NebiusEmbeddings class provides access to Nebius AI Studio’s embedding models through LangChain. These embeddings can be used for semantic search, document similarity, and other NLP tasks requiring vector representations of text.

Integration details

  • Provider: Nebius AI Studio
  • Model Types: Text embedding models
  • Primary Use Case: Generate vector representations of text for semantic similarity and retrieval
  • Available Models: Various embedding models including BAAI/bge-en-icl and others
  • Dimensions: Varies by model (typically 1024-4096 dimensions)

Setup

Installation

The Nebius integration can be installed via pip:

Credentials

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 AI Studio.

Instantiation

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

Available models

The list of supported models is available at studio.nebius.com/?modality=embedding

Indexing and retrieval

Embedding models are often used in retrieval-augmented generation (RAG) flows, 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:

Direct usage

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:

Async support

NebiusEmbeddings supports async operations:

Document similarity example


API reference

For more details about the Nebius AI Studio API, visit the Nebius AI Studio Documentation.