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.4.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

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

File metadata

File hashes

Hashes for llama_index_embeddings_nebius-0.4.1.tar.gz
Algorithm Hash digest
SHA256 f1cff0b424f20299be9d6deefc8940c9ac3e1561b6b9ccf19efbff728f59a801
MD5 b83d8d3e8d0e838c9a4cac0059dae68b
BLAKE2b-256 16cd22b4959a35333c7a1e4ea1d46a1beb770d46bd4646c826d36975487a29cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_embeddings_nebius-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9d8fc0f02c9aff93d9e4be5195f312a169c986053cbf7b01af9c779e9d4f4a0c
MD5 1ede07e6985de7199916a3e63c538f1b
BLAKE2b-256 ff1f35da9f119610336929b5e2076b74d7ef1afd282ffa75cbbf6a841e4b13e9

See more details on using hashes here.

Supported by

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