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

Uploaded Source

Built Distribution

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

llama_index_embeddings_nebius-0.3.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: llama_index_embeddings_nebius-0.3.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.5.0-1025-azure

File hashes

Hashes for llama_index_embeddings_nebius-0.3.0.tar.gz
Algorithm Hash digest
SHA256 975e4637771c9e774a057434d9eba0ad447dcc115dcf17e7e1d5ecb9b70b10ee
MD5 c04d4ecc78e2feabff3e654e44010618
BLAKE2b-256 72b8b84b78348e51340e37ebc33a3ab3f4075298422a8094c67f67268bc5cd56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_embeddings_nebius-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4885078ea8760124eb4824eb7a1f2020cdb3c188f1678cdfbca1dcd0c77acfa4
MD5 c5560e6c19cf686c4c1a618a86c9e791
BLAKE2b-256 24f1f644d782e55e270f2a0086f26c3e0578ff0a14e8e96d2f5bbb166ecbc236

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