Skip to main content

llama-index postprocessor xinference rerank integration

Project description

LlamaIndex Postprocessor Integration: Xinference Rerank

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 rerank models in Xinference from its document Rerank Models

To learn more about Xinference in general, visit https://inference.readthedocs.io/en/stable/models/model_abilities/rerank.html

Installation

pip install llama-index-postprocessor-xinference-rerank

Usage

Parameters Description:

  • model: Model uid not model name, sometimes they may be the same (e.g., bge-reranker-base).
  • base_url: base url of Xinference (e.g., http://localhost:9997).
  • top_n: Top n nodes to return from reranker. (default 5).

Nodes Rerank Example

from llama_index.postprocessor.xinference_rerank import XinferenceRerank

xi_model_uid = "xinference model uid"
xi_base_url = "xinference base url"

xi_rerank = XinferenceRerank(
    top_n=5,
    model=xi_model_uid,
    base_url=xi_base_url,
)


def test_rerank_nodes(nodes, query_str):
    response = xi_rerank.postprocess_nodes(nodes, query_str)

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

File metadata

File hashes

Hashes for llama_index_postprocessor_xinference_rerank-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b0fdcf7257941df7737befb47caf6d47bc02750063a8a2e744d19f45c39c6b28
MD5 aff9fcc31add02fec24274960a509384
BLAKE2b-256 e67a68684925947a7ff6cc2043954977192ecfc9ef93ddcb8fb43b7c5302a804

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_postprocessor_xinference_rerank-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 431df01c89d96b1420d478143847e3d389e74c204f7713a4fb0a59c373d28939
MD5 e411be27eab68e2b2aea1384d26f3342
BLAKE2b-256 4c9714357ee2b0315b0fba4e248abe0a99fdc50e00f3e44d2eae4bf10bcc4fae

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