npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@xpert-ai/plugin-xinference

v0.0.1

Published

## Overview

Readme

Xpert Plugin: Xinference

Overview

@xpert-ai/plugin-xinference connects Xorbits Inference endpoints to the XpertAI platform. The plugin speaks the OpenAI-compatible interface exposed by Xinference so XpertAI agents can call large language models, embedding models, and rerankers that you deploy on your own infrastructure.

Core Features

  • Ships XinferenceModule, which registers the NestJS provider strategy, lifecycle hooks, and configuration schema required by the plugin runtime.
  • Implements XinferenceLargeLanguageModel, a LangChain-powered adapter that supports streaming chat completions, function calling, and token accounting callbacks for agent telemetry.
  • Provides XinferenceTextEmbeddingModel, which reuses LangChain's OpenAIEmbeddings but overrides batching/encoding logic so Xinference's float embeddings return without base64 decoding issues.
  • Exposes XinferenceRerankModel, wrapping OpenAICompatibleReranker for better retrieval ordering when your Xinference deployment offers rerank-capable endpoints.
  • Shares a console-ready xinference.yaml that drives the XpertAI UI forms (icons, help links, credential prompts) for quick operator onboarding.

Installation

npm install @xpert-ai/plugin-xinference

Peer Dependencies: Ensure your host service also provides @xpert-ai/plugin-sdk, @nestjs/common, @nestjs/config, @metad/contracts, @langchain/openai, i18next, chalk, zod, and tslib. Refer to package.json for exact versions.

Enabling in XpertAI

  1. Add the plugin to the service dependencies so Node.js can resolve @xpert-ai/plugin-xinference.
  2. Declare the plugin before bootstrapping the XpertAI server:
    PLUGINS=@xpert-ai/plugin-xinference
  3. In the XpertAI admin console (or config file), create a model provider pointing to xinference, then add individual models that map to your Xinference deployments.

Credentials & Model Configuration

The xinference.yaml schema backs the form fields you see in the console:

| Field | Description | | --- | --- | | server_url | Required. Base URL of the Xinference REST endpoint (e.g., http://192.168.1.100:9997/v1). | | model_uid | Required. The concrete model identifier registered in Xinference; used when it differs from the logical XpertAI model name. | | api_key | Optional API token. Use no-key-required for unsecured endpoints. | | invoke_timeout | Request timeout in seconds; defaults to 60. | | max_retries | Client retry attempts for transient failures; defaults to 3. |

During validation, the plugin instantiates lightweight LangChain clients (ChatOpenAI, OpenAIEmbeddings, OpenAICompatibleReranker) against the provided credentials to ensure connectivity and permissions.

Model Capabilities

  • Conversational Models: XinferenceLargeLanguageModel merges provider credentials with per-model overrides, turns on streaming, and registers token usage callbacks so agent telemetry stays accurate.
  • Embedding Models: XinferenceTextEmbeddingModel batches documents, sets encoding_format: 'float', and supports optional dimension overrides, making it suitable for large corpus ingestion.
  • Reranking Models: XinferenceRerankModel proxies the OpenAI-compatible rerank API to refine retrieval results before answer synthesis.
  • Console Metadata: The plugin metadata declares support for speech-to-text and TTS in advance, enabling you to extend the implementation without changing the admin UI contract.

Development & Debugging

From the repo root, run Nx commands for this package:

cd xpertai
npx nx build @xpert-ai/plugin-xinference
npx nx test @xpert-ai/plugin-xinference

Artifacts land in xpertai/packages/xinference/dist. Jest settings live in jest.config.ts, and the asset copier runs via npm run prepack before publishing.

License

This plugin is distributed under the AGPL-3.0 License located at the repository root.