llama-index embeddings databricks integration
Project description
LlamaIndex Embeddings Integration: Databricks
This integration adds support for embedding models hosted on the databricks platform via serving endpoints. The API follows the specifications of OpenAI, so this integration simply adapts the llama-index-embeddings-openai integration and internally uses the openai Python API library, too.
The signature furthermore aligns with the existing Databricks LLM integration with respect to the naming of the model, api_key and endpoint variables to ensure a smooth user experience.
Installation
pip install llama-index
pip install llama-index-embeddings-databricks
Usage
Passing the api_key and endpoint directly as arguments:
import os
from llama_index.core import Settings
from llama_index.embeddings.databricks import DatabricksEmbedding
# Set up the DatabricksEmbedding class with the required model, API key and serving endpoint
embed_model = DatabricksEmbedding(
model="databricks-bge-large-en",
api_key="<MY TOKEN>",
endpoint="<MY ENDPOINT>",
)
Settings.embed_model = embed_model
# Embed some text
embeddings = embed_model.get_text_embedding(
"The DatabricksEmbedding integration works great."
)
Using environment variables:
export DATABRICKS_TOKEN=<MY TOKEN>
export DATABRICKS_SERVING_ENDPOINT=<MY ENDPOINT>
import os
from dotenv import load_dotenv
from llama_index.core import Settings
from llama_index.embeddings.databricks import DatabricksEmbedding
load_dotenv()
# Set up the DatabricksEmbedding class with the required model, API key and serving endpoint
embed_model = DatabricksEmbedding(model="databricks-bge-large-en")
Settings.embed_model = embed_model
# Embed some text
embeddings = embed_model.get_text_embedding(
"The DatabricksEmbedding integration works great."
)
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_embeddings_databricks-0.5.0.tar.gz.
File metadata
- Download URL: llama_index_embeddings_databricks-0.5.0.tar.gz
- Upload date:
- Size: 5.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee8c1f081b807fef1bda7c29b4a6bae78802effc04a99f5a5fde81144fe8b198
|
|
| MD5 |
ca12b07118ac85ce4f519b9c72c99fbd
|
|
| BLAKE2b-256 |
f42ee0279914e6473cd8090afeaee0134527fc2913fc19c53ecf65c76fa3c6dc
|
File details
Details for the file llama_index_embeddings_databricks-0.5.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_embeddings_databricks-0.5.0-py3-none-any.whl
- Upload date:
- Size: 4.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ab1f70830a604c596510e3100029b52c2aa19cc8c15109c6dbaf448fa3ecdce
|
|
| MD5 |
a33bccce802bc1b30229b099f096061f
|
|
| BLAKE2b-256 |
6f8f08f7dff1788717e942fb82a4ca737dd98f34561f8112ee28ebdc223847e3
|