back to home

xorbitsai / inference

Swap GPT for any LLM by changing a single line of code. Xinference lets you run open-source, speech, and multimodal models on cloud, on-prem, or your laptop โ€” all through one unified, production-ready inference API.

9,058 stars
796 forks
171 issues
PythonJavaScriptDockerfile

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing xorbitsai/inference in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind-ai.vercel.app/repo/xorbitsai/inference)
Preview:Analyzed by RepoMind

Repository Summary (README)

Preview
<div align="center"> <img src="./assets/xorbits-logo.png" width="180px" alt="xorbits" />

Xorbits Inference: Model Serving Made Easy ๐Ÿค–

<p align="center"> <a href="https://xinference.io/en">Xinference Enterprise</a> ยท <a href="https://inference.readthedocs.io/en/latest/getting_started/installation.html#installation">Self-hosting</a> ยท <a href="https://inference.readthedocs.io/">Documentation</a> </p>

PyPI Latest Release License Build Status Docker Pulls Discord Twitter

<p align="center"> <a href="./README.md"><img alt="README in English" src="https://img.shields.io/badge/English-454545?style=for-the-badge"></a> <a href="./README_zh_CN.md"><img alt="็ฎ€ไฝ“ไธญๆ–‡็‰ˆ่‡ช่ฟฐๆ–‡ไปถ" src="https://img.shields.io/badge/ไธญๆ–‡ไป‹็ป-d9d9d9?style=for-the-badge"></a> <a href="./README_ja_JP.md"><img alt="ๆ—ฅๆœฌ่ชžใฎREADME" src="https://img.shields.io/badge/ๆ—ฅๆœฌ่ชž-d9d9d9?style=for-the-badge"></a> </p> </div> <br />

Xorbits Inference(Xinference) is a powerful and versatile library designed to serve language, speech recognition, and multimodal models. With Xorbits Inference, you can effortlessly deploy and serve your or state-of-the-art built-in models using just a single command. Whether you are a researcher, developer, or data scientist, Xorbits Inference empowers you to unleash the full potential of cutting-edge AI models.

<div align="center"> <i><a href="https://discord.gg/Xw9tszSkr5">๐Ÿ‘‰ Join our Discord community!</a></i> </div>

๐Ÿ”ฅ Hot Topics

Framework Enhancements

  • Auto batch: Multiple concurrent requests are automatically batched, significantly improving throughput: #4197
  • Xllamacpp: New llama.cpp Python binding, maintained by Xinference team, supports continuous batching and is more production-ready.: #2997
  • Distributed inference: running models across workers: #2877
  • VLLM enhancement: Shared KV cache across multiple replicas: #2732
  • Support Continuous batching for Transformers engine: #1724
  • Support MLX backend for Apple Silicon chips: #1765
  • Support specifying worker and GPU indexes for launching models: #1195
  • Support SGLang backend: #1161

New Models

Integrations

  • Dify: an LLMOps platform that enables developers (and even non-developers) to quickly build useful applications based on large language models, ensuring they are visual, operable, and improvable.
  • FastGPT: a knowledge-based platform built on the LLM, offers out-of-the-box data processing and model invocation capabilities, allows for workflow orchestration through Flow visualization.
  • RAGFlow: is an open-source RAG engine based on deep document understanding.
  • MaxKB: MaxKB = Max Knowledge Brain, it is a powerful and easy-to-use AI assistant that integrates Retrieval-Augmented Generation (RAG) pipelines, supports robust workflows, and provides advanced MCP tool-use capabilities.
  • Chatbox: a desktop client for multiple cutting-edge LLM models, available on Windows, Mac and Linux.

Key Features

๐ŸŒŸ Model Serving Made Easy: Simplify the process of serving large language, speech recognition, and multimodal models. You can set up and deploy your models for experimentation and production with a single command.

โšก๏ธ State-of-the-Art Models: Experiment with cutting-edge built-in models using a single command. Inference provides access to state-of-the-art open-source models!

๐Ÿ–ฅ Heterogeneous Hardware Utilization: Make the most of your hardware resources with ggml. Xorbits Inference intelligently utilizes heterogeneous hardware, including GPUs and CPUs, to accelerate your model inference tasks.

โš™๏ธ Flexible API and Interfaces: Offer multiple interfaces for interacting with your models, supporting OpenAI compatible RESTful API (including Function Calling API), RPC, CLI and WebUI for seamless model management and interaction.

๐ŸŒ Distributed Deployment: Excel in distributed deployment scenarios, allowing the seamless distribution of model inference across multiple devices or machines.

๐Ÿ”Œ Built-in Integration with Third-Party Libraries: Xorbits Inference seamlessly integrates with popular third-party libraries including LangChain, LlamaIndex, Dify, and Chatbox.

Why Xinference

FeatureXinferenceFastChatOpenLLMRayLLM
OpenAI-Compatible RESTful APIโœ…โœ…โœ…โœ…
vLLM Integrationsโœ…โœ…โœ…โœ…
More Inference Engines (GGML, TensorRT)โœ…โŒโœ…โœ…
More Platforms (CPU, Metal)โœ…โœ…โŒโŒ
Multi-node Cluster Deploymentโœ…โŒโŒโœ…
Image Models (Text-to-Image)โœ…โœ…โŒโŒ
Text Embedding Modelsโœ…โŒโŒโŒ
Multimodal Modelsโœ…โŒโŒโŒ
Audio Modelsโœ…โŒโŒโŒ
More OpenAI Functionalities (Function Calling)โœ…โŒโŒโŒ

Using Xinference

  • Self-hosting Xinference Community Edition</br> Quickly get Xinference running in your environment with this starter guide. Use our documentation for further references and more in-depth instructions.

  • Xinference for enterprise / organizations</br> We provide additional enterprise-centric features. send us an email to discuss enterprise needs. </br>

Staying Ahead

Star Xinference on GitHub and be instantly notified of new releases.

star-us

Getting Started

Jupyter Notebook

The lightest way to experience Xinference is to try our Jupyter Notebook on Google Colab.

Docker

Nvidia GPU users can start Xinference server using Xinference Docker Image. Prior to executing the installation command, ensure that both Docker and CUDA are set up on your system.

docker run --name xinference -d -p 9997:9997 -e XINFERENCE_HOME=/data -v </on/your/host>:/data --gpus all xprobe/xinference:latest xinference-local -H 0.0.0.0

K8s via helm

Ensure that you have GPU support in your Kubernetes cluster, then install as follows.

# add repo
helm repo add xinference https://xorbitsai.github.io/xinference-helm-charts

# update indexes and query xinference versions
helm repo update xinference
helm search repo xinference/xinference --devel --versions

# install xinference
helm install xinference xinference/xinference -n xinference --version 0.0.1-v<xinference_release_version>

For more customized installation methods on K8s, please refer to the documentation.

Quick Start

Install Xinference by using pip as follows. (For more options, see Installation page.)

pip install "xinference[all]"

To start a local instance of Xinference, run the following command:

$ xinference-local

Once Xinference is running, there are multiple ways you can try it: via the web UI, via cURL, via the command line, or via the Xinferenceโ€™s python client. Check out our docs for the guide.

web UI

Getting involved

PlatformPurpose
Github IssuesReporting bugs and filing feature requests.
DiscordCollaborating with other Xinference users.
TwitterStaying up-to-date on new features.

Citation

If this work is helpful, please kindly cite as:

@inproceedings{lu2024xinference,
    title = "Xinference: Making Large Model Serving Easy",
    author = "Lu, Weizheng and Xiong, Lingfeng and Zhang, Feng and Qin, Xuye and Chen, Yueguo",
    booktitle = "Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing: System Demonstrations",
    month = nov,
    year = "2024",
    address = "Miami, Florida, USA",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2024.emnlp-demo.30",
    pages = "291--300",
}

Contributors

<a href="https://github.com/xorbitsai/inference/graphs/contributors"> <img src="https://contrib.rocks/image?repo=xorbitsai/inference" /> </a>

Star History

Star History Chart