Skip to main content

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


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_xinference-0.4.0.tar.gz (4.3 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_xinference-0.4.0.tar.gz.

File metadata

  • Download URL: llama_index_embeddings_xinference-0.4.0.tar.gz
  • Upload date:
  • Size: 4.3 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_xinference-0.4.0.tar.gz
Algorithm Hash digest
SHA256 f4da3b64c4b7261d4ec208a8d9904a27915dabdefa137cc1a48aeff199f7349f
MD5 92f2da31ee2774356c91517b320ecdb3
BLAKE2b-256 6c3c1f898c83adbb8e5aef23250ea29eb5fe6e47470e987a5ddd12e8d3f5dda5

See more details on using hashes here.

File details

Details for the file llama_index_embeddings_xinference-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_embeddings_xinference-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 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_xinference-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2fabf5151e714d73afdbfce9d7c89a3a532fc7bc1e4961a92f32c96a9abe3b83
MD5 a4d920c413ea00063a6677144e5ce3cc
BLAKE2b-256 638efdb669b023ec1931b810f9fa405854a70c1b73ca79c70b4f7e71349aa0dd

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