llama-index embeddings xinference integration
Project description
LlamaIndex Embeddings Integration: Xinference
Xorbits Inference (Xinference) is an open-source platform to streamline the operation and integration of a wide array of AI models.
You can find a list of built-in embedding models in Xinference from its document Embedding Models
To learn more about Xinference in general, visit https://inference.readthedocs.io/en/latest/
Installation
pip install llama-index-embeddings-xinference
Usage
Parameters Description:
model_uid
: Model uid not the model name, sometimes they may be the same (e.g.,bce-embedding-base_v1
).base_url
: base url of Xinference (e.g.,http://localhost:9997
).timeout
: request timeout set (default 60s).prompt
: Text to embed.
Text Embedding Example
from llama_index.embeddings.xinference import XinferenceEmbedding
xi_model_uid = "xinference model uid"
xi_base_url = "xinference base url"
xi_embed = XinferenceEmbedding(
model_uid=xi_model_uid,
base_url=xi_base_url,
timeout=60,
)
def text_embedding(prompt: str):
embeddings = xi_embed.get_query_embedding(prompt)
print(embeddings)
async def async_text_embedding(prompt: str):
embeddings = await xi_embed.aget_query_embedding(prompt)
print(embeddings)
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file llama_index_embeddings_xinference-0.2.0.tar.gz
.
File metadata
- Download URL: llama_index_embeddings_xinference-0.2.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df63b9907cdc7d0cd84c1ba363df7968a78a4991fa70a9b7503ca1e27866e889 |
|
MD5 | 118496f08dc0607572c0aa80f90dfbe2 |
|
BLAKE2b-256 | 7f417a41259479fde86c068ebbe706e3ada5658d758bd2bab3a47901acced810 |
File details
Details for the file llama_index_embeddings_xinference-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_embeddings_xinference-0.2.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7bd7e9cd34ecf4043aaa48ba99aae41efedd0ece0210eea149933132d7134398 |
|
MD5 | da3b37e93094ba69e386477648ca1f37 |
|
BLAKE2b-256 | 43c2dd9d2a38ac9fd65a3ff0fced16ca8b40a52533612ab8ec431234f8201928 |