Skip to main content

llama-index embeddings OCI Data Science integration

Project description

LlamaIndex Embeddings Integration: Oracle Cloud Infrastructure (OCI) Data Science Service

Oracle Cloud Infrastructure (OCI) Data Science is a fully managed, serverless platform for data science teams to build, train, and manage machine learning models in Oracle Cloud Infrastructure.

It offers AI Quick Actions, which can be used to deploy embedding models in OCI Data Science. AI Quick Actions target users who want to quickly leverage the capabilities of AI. They aim to expand the reach of foundation models to a broader set of users by providing a streamlined, code-free, and efficient environment for working with foundation models. AI Quick Actions can be accessed from the Data Science Notebook.

Detailed documentation on how to deploy embedding models in OCI Data Science using AI Quick Actions is available here and here.

Installation

Install the required packages:

pip install oracle-ads llama-index-core llama-index-embeddings-oci-data-science

The oracle-ads is required to simplify the authentication within OCI Data Science.

Authentication

The authentication methods supported for LlamaIndex are equivalent to those used with other OCI services and follow the standard SDK authentication methods, specifically API Key, session token, instance principal, and resource principal. More details can be found here. Make sure to have the required policies to access the OCI Data Science Model Deployment endpoint.

Usage

import ads
from llama_index.embeddings.oci_data_science import OCIDataScienceEmbedding

ads.set_auth(auth="security_token", profile="<replace-with-your-profile>")

embedding = OCIDataScienceEmbedding(
    endpoint="https://<MD_OCID>/predict",
)

e1 = embeddings.get_text_embedding("This is a test document")
print(e1)

e2 = embeddings.get_text_embedding_batch([
        "This is a test document",
        "This is another test document"
    ])
print(e2)

Async

import ads
from llama_index.embeddings.oci_data_science import OCIDataScienceEmbedding

ads.set_auth(auth="security_token", profile="<replace-with-your-profile>")

embedding = OCIDataScienceEmbedding(
    endpoint="https://<MD_OCID>/predict",
)

e1 = await embeddings.aget_text_embedding("This is a test document")
print(e1)

e2 = await embeddings.aget_text_embedding_batch([
        "This is a test document",
        "This is another test document"
    ])
print(e2)

More examples

https://docs.llamaindex.ai/en/stable/examples/embeddings/oci_data_science/

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

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_oci_data_science-0.3.0.tar.gz.

File metadata

  • Download URL: llama_index_embeddings_oci_data_science-0.3.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_embeddings_oci_data_science-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fb86d1a68e2fb57966d6029b139a82eaa4491d328e58760719dc944e0831c07f
MD5 3269d8a7a8adb7950562a18ada3097cc
BLAKE2b-256 2cd942caf9103904604c71990e7f97a9592ce7d5f459d0c7623222eff4dc0d83

See more details on using hashes here.

File details

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

File metadata

  • Download URL: llama_index_embeddings_oci_data_science-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_embeddings_oci_data_science-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3a955515161eed48fe6fa231cdf77a2486c5ca285f34923a8c17bc976fa9376
MD5 c8678f704eb3e991c96aa675a8733bea
BLAKE2b-256 ab9fa440b228d8c683111a37f4ba8df470978e39edfecebbf9e9e16c088dd8e3

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