nebius_embedder.py
Run the Example
1
Set up your virtual environment
2
Export the API key and model settings
3
Install dependencies
4
Run the example
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Generate embeddings with an active Nebius model through its OpenAI-compatible API.
import os
from agno.knowledge.embedder.nebius import NebiusEmbedder
embedder = NebiusEmbedder(
id=os.environ["NEBIUS_EMBEDDING_MODEL"],
dimensions=int(os.environ["NEBIUS_EMBEDDING_DIMENSIONS"]),
)
embedding = embedder.get_embedding(
"The quick brown fox jumps over the lazy dog."
)
print(f"First values: {embedding[:5]}")
print(f"Dimensions: {len(embedding)}")
BAAI/bge-en-icl, is retired. Override both id and dimensions with values for an active Nebius embedding model.Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activate
uv venv --python 3.12
.venv\Scripts\activate
Export the API key and model settings
export NEBIUS_API_KEY=your_nebius_api_key_here
export NEBIUS_EMBEDDING_MODEL=your_active_embedding_model
export NEBIUS_EMBEDDING_DIMENSIONS=your_model_output_dimensions
Install dependencies
uv pip install -U agno openai
Run the example
python nebius_embedder.py
Was this page helpful?