Skip to main content
The NebiusEmbedder can be used to embed text data into vectors using the Nebius AI Studio API. Nebius uses the OpenAI API specification, so the NebiusEmbedder class is similar to the OpenAIEmbedder class, incorporating adjustments to ensure compatibility with the Nebius platform. Get your key from here.

Usage

nebius_embedder.py
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.pgvector import PgVector
from agno.knowledge.embedder.nebius import NebiusEmbedder

# Embed sentence in database
embeddings = NebiusEmbedder().get_embedding("The quick brown fox jumps over the lazy dog.")

# Print the embeddings and their dimensions
print(f"Embeddings: {embeddings[:5]}")
print(f"Dimensions: {len(embeddings)}")

# Use an embedder in a knowledge base
knowledge = Knowledge(
    vector_db=PgVector(
        db_url="postgresql+psycopg://ai:ai@localhost:5532/ai",
        table_name="nebius_embeddings",
        embedder=NebiusEmbedder(),
    ),
    max_results=2,
)

Params

For a full list of parameters, see the Nebius Embedder reference.

Developer Resources

I