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.
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.
db2784d to
b77efaa
Compare
|
Thanks @qinxuye, this was the right call — the base package pulls in Hardware-aware PyTorch. The script now creates a dedicated uv-managed virtualenv and installs via macOS Apple Silicon vs Intel. Isolated env / conflict detection. Preflight now warns when an existing Scope is explicit. This installs only the base framework — no model backends. Both the README and the installation docs now state this clearly and position it as a convenience bootstrap, not a replacement for the existing Pinned Python + preflight + CI. The venv pins Python (default 3.12, override via I verified the flow end-to-end locally on macOS arm64 (installs base |
Add scripts/install.sh, a POSIX sh installer invoked via curl -fsSL .../scripts/install.sh | sh. It installs the *base* Xinference framework (CLI + server + Web UI) into a dedicated, uv-managed virtualenv and links the commands into ~/.local/bin, so it does not touch the system Python and avoids PEP 668 errors. Because the base package depends on PyTorch, the installer is hardware-aware: it selects the PyTorch build via uv's --torch-backend (auto/cpu/cuXXX/rocm/xpu), which requires the 'uv pip' interface and a managed venv rather than 'uv tool install'. macOS distinguishes Apple silicon from Intel, and the script performs preflight checks for an existing install and active conda/venv environments. The default install includes no model backend; XINFERENCE_EXTRAS, XINFERENCE_VERSION, XINFERENCE_PYTHON and XINFERENCE_HOME_DIR tune the install. Docs make clear this bootstraps only the base framework and is not a replacement for the existing 'pip install "xinference[all]"' Quick Start. A new CI workflow shellchecks the script and exercises it end-to-end (CPU backend) on Linux and macOS.
b77efaa to
fddd0a4
Compare
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.