Xorbits Inference(Xinference)是一个功能强大且多用途的库,旨在为语言、语音识别和多模态模型提供服务。借助 Xorbits Inference,您只需一条命令即可轻松部署和提供您自己的或最先进的内置模型。无论您是研究人员、开发人员还是数据科学家,Xorbits Inference 都能帮助您释放尖端 AI 模型的全部潜力。
🌟 模型服务化,轻松上手:简化大型语言、语音识别和多模态模型的服务化过程。只需一条命令即可为实验和生产环境设置和部署您的模型。
⚡️ 最先进的模型:通过一条命令即可体验尖端的内置模型。Xinference 提供对最先进开源模型的访问!
🖥 异构硬件利用:借助 ggml,充分利用您的硬件资源。Xinference 智能地利用异构硬件,包括 GPU 和 CPU,以加速模型推理任务。
⚙️ 灵活的 API 和接口:提供多种与模型交互的接口,支持 OpenAI 兼容的 RESTful API(包括 Function Calling API)、RPC、CLI 和 WebUI,实现无缝的模型管理和交互。
🌐 分布式部署:在分布式部署场景中表现出色,允许模型推理无缝分布在多个设备或机器上。
🔌 内置第三方库集成:Xinference 与流行的第三方库无缝集成,包括 LangChain、LlamaIndex、Dify 和 Chatbox。
| 特性 | Xinference | FastChat | OpenLLM | RayLLM |
|---|---|---|---|---|
| OpenAI 兼容的 RESTful API | ✅ | ✅ | ✅ | ✅ |
| vLLM 集成 | ✅ | ✅ | ✅ | ✅ |
| 更多推理引擎 (GGML, TensorRT) | ✅ | ❌ | ✅ | ✅ |
| 更多平台支持 (CPU, Metal) | ✅ | ✅ | ❌ | ❌ |
| 多节点集群部署 | ✅ | ❌ | ❌ | ✅ |
| 图像模型 (文生图) | ✅ | ✅ | ❌ | ❌ |
| 文本嵌入模型 | ✅ | ❌ | ❌ | ❌ |
| 多模态模型 | ✅ | ❌ | ❌ | ❌ |
| 音频模型 | ✅ | ❌ | ❌ | ❌ |
| 更多 OpenAI 功能 (Function Calling) | ✅ | ❌ | ❌ | ❌ |
自托管 Xinference 社区版
通过此快速入门指南快速在您的环境中运行 Xinference。
使用我们的文档获取更多参考和更深入的说明。
面向企业/组织的 Xinference
我们提供额外的企业级功能。发送邮件与我们讨论企业需求。
在 GitHub 上 Star Xinference,即时获取新版本通知。

体验 Xinference 最轻量的方式是尝试我们的 Google Colab Jupyter Notebook。
Nvidia GPU 用户可以使用 Xinference Docker 镜像启动 Xinference 服务器。在执行安装命令之前,请确保您的系统已安装 Docker 和 CUDA。
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
确保您的 Kubernetes 集群支持 GPU,然后按如下方式安装。
# 添加仓库
helm repo add xinference https://xorbitsai.github.io/xinference-helm-charts
# 更新索引并查询 xinference 版本
helm repo update xinference
helm search repo xinference/xinference --devel --versions
# 安装 xinference
helm install xinference xinference/xinference -n xinference --version 0.0.1-v<xinference_release_version>
有关在 K8s 上更定制的安装方法,请参阅文档。
使用 pip 安装 Xinference,如下所示。(更多选项,请参见安装页面。)
pip install "xinference[all]"
要启动 Xinference 的本地实例,请运行以下命令:
$ xinference-local
Xinference 运行后,您可以通过多种方式尝试:通过 Web UI、cURL、命令行或 Xinference 的 Python 客户端。查看我们的文档获取指南。

| 平台 | 用途 |
|---|---|
| Github Issues | 报告 Bug 和提交功能请求。 |
| Discord | 与其他 Xinference 用户协作。 |
| 了解新功能的最新动态。 |
如果这项工作对您有帮助,请引用:
@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",
}