Skip to content

feat: add one-line install script for Linux/macOS - #5178

Open
OliverBryant wants to merge 1 commit into
xorbitsai:mainfrom
OliverBryant:feat/one-line-install-script
Open

feat: add one-line install script for Linux/macOS#5178
OliverBryant wants to merge 1 commit into
xorbitsai:mainfrom
OliverBryant:feat/one-line-install-script

Conversation

@OliverBryant

Copy link
Copy Markdown
Collaborator

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 | sh

The 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 bootstraps uv first if it is not already present.

Details

  • New file scripts/install.sh — POSIX sh, supports Linux and macOS (Windows users are directed to pip in a virtualenv).
  • Default installs only the base xinference package to stay small and cross-platform. Heavy extras such as vllm require Linux + CUDA and often fail on macOS/CPU-only machines, so they are opt-in.
  • Environment variables:
    • XINFERENCE_EXTRAS — install optional backends, e.g. XINFERENCE_EXTRAS=all or XINFERENCE_EXTRAS=vllm,transformers.
    • XINFERENCE_VERSION — pin a version, e.g. XINFERENCE_VERSION=1.8.1 (a leading v is stripped).
  • On success it prints how to start the server (xinference-local) and the Web UI URL (http://127.0.0.1:9997), and warns if the command is not yet on PATH.
  • Documented in the README quick start and doc/source/getting_started/installation.rst.

Notes

  • The docs reference the raw GitHub URL so the installer works immediately. If a short vanity domain (e.g. get.xinference.io) is set up later, the URL can be swapped.
  • Validated sh -n syntax and exhaustively tested the package-spec assembly across XINFERENCE_EXTRAS / XINFERENCE_VERSION combinations. The actual uv tool install was not executed in CI-less local testing.

@XprobeBot XprobeBot added this to the v2.x milestone Jul 14, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread scripts/install.sh Outdated
@OliverBryant
OliverBryant force-pushed the feat/one-line-install-script branch 2 times, most recently from ebf0460 to db2784d Compare July 14, 2026 10:06

@qinxuye qinxuye left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@XprobeBot XprobeBot modified the milestones: v2.x, v3.x Jul 19, 2026
@OliverBryant
OliverBryant force-pushed the feat/one-line-install-script branch from db2784d to b77efaa Compare July 27, 2026 07:18
@OliverBryant

Copy link
Copy Markdown
Collaborator Author

Thanks @qinxuye, this was the right call — the base package pulls in torch, so a naive uv tool install is indeed hardware-blind. I've reworked the installer to address each point:

Hardware-aware PyTorch. The script now creates a dedicated uv-managed virtualenv and installs via uv pip install --torch-backend "$XINFERENCE_BACKEND" .... --torch-backend is only available in the uv pip interface (not uv tool install), which is why I moved off the tool path. XINFERENCE_BACKEND defaults to auto (uv detects CUDA/ROCm/Intel driver and picks the matching index) and accepts explicit cpu / cuXXX / rocm / xpu overrides.

macOS Apple Silicon vs Intel. uname -m is checked; on x86_64 macOS the script warns that recent PyTorch no longer ships Intel-mac wheels. --torch-backend is skipped on macOS (single universal wheel).

Isolated env / conflict detection. Preflight now warns when an existing xinference is on PATH (it will be shadowed via ~/.local/bin), and when run inside an active virtualenv/conda env it warns that uv installs into a separate env and packages are not reused, pointing to pip install "xinference[all]" for in-place installs.

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 pip install "xinference[all]" Quick Start, which is kept as the functional path. Extras remain opt-in via XINFERENCE_EXTRAS.

Pinned Python + preflight + CI. The venv pins Python (default 3.12, override via XINFERENCE_PYTHON). A new install-script.yaml workflow shellchecks the script and runs it end-to-end in CPU mode on Linux and macOS, asserting xinference-local --help and xinference --version work — so the installer itself is exercised, not just repo lint/tests.

I verified the flow end-to-end locally on macOS arm64 (installs base xinference, links the commands, xinference-local --help returns 0). vLLM/ROCm/XPU paths are documented but not exercised in CI (no such hardware on hosted runners). Let me know if you'd prefer a different default backend or Python version.

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.
@OliverBryant
OliverBryant force-pushed the feat/one-line-install-script branch from b77efaa to fddd0a4 Compare July 28, 2026 03:18
@OliverBryant OliverBryant self-assigned this Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants