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.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_postprocessor_xinference_rerank-0.3.1.tar.gz
Algorithm Hash digest
SHA256 462290680231f7315fbc84bd70f43fc4842071bdfcdcb4e1edd555c8673d6d7f
MD5 9eb4079d35e7dd46034305dcb61cb38d
BLAKE2b-256 02de09b934eb8dbe949c4ae85e9ac3f26138e0188b54e91b5d769c9292cc64e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for llama_index_postprocessor_xinference_rerank-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4dffe05d033c5bb8a5258fe44ff97b47a35f9c45148e968a363bcf640583c980
MD5 99a685f8ec67bec01fcfbce0c3ce52cb
BLAKE2b-256 b578238c6cc39c20101deb0b84d8161e4c85b298aff01ecdada82574c07937e5

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