feat: add one-line install script for Linux/macOS#5178
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new one-line installation script (scripts/install.sh) for Linux and macOS that installs Xinference as an isolated tool using uv, and updates the README and documentation accordingly. The review feedback correctly identifies that the command uv tool update-shell referenced in the script does not exist, and provides a robust code suggestion to simplify the PATH warning logic.
1497e36 to
ebf0460
Compare
Add scripts/install.sh, a POSIX sh installer invoked via curl -fsSL .../scripts/install.sh | sh. It installs Xinference as an isolated uv tool so it does not touch the system Python and avoids PEP 668 (externally-managed-environment) errors, bootstrapping uv first if needed. By default only the base package is installed; XINFERENCE_EXTRAS and XINFERENCE_VERSION allow opting into optional backends or pinning a version. Document the one-liner in the README quick start and the installation guide.
ebf0460 to
db2784d
Compare
qinxuye
left a comment
There was a problem hiding this comment.
Thanks for adding this. I think the scope needs to be clarified before this becomes the primary Quick Start installer. The base xinference package already depends on torch, so even the default installation is hardware-sensitive: on Linux we need to account for CPU, NVIDIA, AMD/ROCm, Intel GPU, and the driver-supported PyTorch backend. Please use hardware-aware backend selection such as uv --torch-backend auto, allow an explicit override, and keep hardware-specific backends such as vLLM on a clearly supported path. macOS also needs to distinguish Apple Silicon from Intel. Since uv tool creates an isolated environment, packages from an active Conda environment or virtualenv are not reused; the script should at least detect an existing xinference command and warn about PATH/environment conflicts. If the intended scope is only installing the CLI/server framework, the README should state clearly that common model backends are not installed and this should not replace the existing functional Quick Start. Otherwise, please provide explicit CPU/CUDA/ROCm/MLX modes, select a tested Python version, perform preflight checks, and add CI coverage that actually exercises the installer rather than only repository lint/tests.
Summary
Adds a one-line installer so Linux/macOS users can install Xinference with:
curl -fsSL https://raw.githubusercontent.com/xorbitsai/inference/main/scripts/install.sh | shThe script installs Xinference as an isolated uv tool, so it does not touch the system Python and avoids PEP 668 (
externally-managed-environment) errors. It bootstrapsuvfirst if it is not already present.Details
scripts/install.sh— POSIXsh, supports Linux and macOS (Windows users are directed topipin a virtualenv).xinferencepackage to stay small and cross-platform. Heavy extras such asvllmrequire Linux + CUDA and often fail on macOS/CPU-only machines, so they are opt-in.XINFERENCE_EXTRAS— install optional backends, e.g.XINFERENCE_EXTRAS=allorXINFERENCE_EXTRAS=vllm,transformers.XINFERENCE_VERSION— pin a version, e.g.XINFERENCE_VERSION=1.8.1(a leadingvis stripped).xinference-local) and the Web UI URL (http://127.0.0.1:9997), and warns if the command is not yet onPATH.doc/source/getting_started/installation.rst.Notes
get.xinference.io) is set up later, the URL can be swapped.sh -nsyntax and exhaustively tested the package-spec assembly acrossXINFERENCE_EXTRAS/XINFERENCE_VERSIONcombinations. The actualuv tool installwas not executed in CI-less local testing.