Skip to main content

llama-index embeddings Nebius AI Studio integration

Project description

LlamaIndex Embeddings Integration: Nebius AI Studio

Overview

Integrate with Nebius AI Studio API, which provides access to open-source state-of-the-art text embeddings models.

Installation

pip install llama-index-embeddings-nebius

Usage

Initialization

With environmental variables.

NEBIUS_API_KEY=your_api_key
from llama_index.embeddings.nebius import NebiusEmbedding

embed_model = NebiusEmbedding(model_name="BAAI/bge-en-icl")

Without environmental variables

from llama_index.embeddings.nebius import NebiusEmbedding

embed_model = NebiusEmbedding(
    api_key="your_api_key", model_name="BAAI/bge-en-icl"
)

Launching

Basic usage

text = "Everyone loves justice at another person's expense"
embeddings = embed_model.get_text_embedding(text)
print(embeddings[:5])

Asynchronous usage

text = "Everyone loves justice at another person's expense"
embeddings = await embed_model.aget_text_embedding(text)
print(embeddings[:5])

Batched usage

texts = [
    "As the hours pass",
    "I will let you know",
    "That I need to ask",
    "Before I'm alone",
]

embeddings = embed_model.get_text_embedding_batch(texts)
print(*[x[:3] for x in embeddings], sep="\n")

Batched asynchronous usage

texts = [
    "As the hours pass",
    "I will let you know",
    "That I need to ask",
    "Before I'm alone",
]

embeddings = await embed_model.aget_text_embedding_batch(texts)
print(*[x[:3] for x in embeddings], sep="\n")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_embeddings_nebius-0.2.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_embeddings_nebius-0.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_embeddings_nebius-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b68772c694da9367d61e478f12854fc7c5d941f01ab71ef35420253b7cf22b9f
MD5 3a5f911ea555c61259edb2bd123c53fa
BLAKE2b-256 4d29eb1a8c8d987014b8015952cb39d3966a480f3fb807e235c6d9ec8d234431

See more details on using hashes here.

File details

Details for the file llama_index_embeddings_nebius-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_embeddings_nebius-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 68be8c94371245aa2517a5f0907c07fb75390d2986170d51bc4ccb27f39d66a9
MD5 df03d5909b9001fca62bc9d94a8f096a
BLAKE2b-256 e2d6d666d426b01ac94c86accebcc08c523d4624f1ddf11e28700f7c56936ecd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page