Skip to content

Installation

KD requires Python 3.11 or later. The distribution is named sail-kd; Python code imports it as kd.

Install KD

Use pip in an activated Python environment, or use uv to create .venv and install KD. With uv, --torch-backend=auto selects the PyTorch build for the available hardware: a CUDA build the installed driver supports, or the CPU build.

python -m pip install sail-kd
uv venv
uv pip install sail-kd --torch-backend=auto

If you used uv, activate .venv before running the Python examples or kd-agent. On Linux and macOS:

source .venv/bin/activate

In Windows PowerShell:

.venv\Scripts\Activate.ps1

To create a virtual environment for pip, run python -m venv .venv, activate it with the command for your platform above, then run the pip installation.

CPU PyTorch

For a Linux environment that will use CPU PyTorch, install that build before KD:

python -m pip install torch --index-url https://download.pytorch.org/whl/cpu

Then install KD with the pip command above. With uv, replace --torch-backend=auto with --torch-backend=cpu.

CUDA PyTorch

A CUDA build of PyTorch runs only with a driver that supports its CUDA version. pip install sail-kd resolves the newest CUDA build on PyPI; on a machine whose driver is older, torch.cuda.is_available() returns False and KD runs on the CPU. Install the build for the driver first, from the PyTorch index for that CUDA version, then install KD with the pip command above:

python -m pip install torch --index-url https://download.pytorch.org/whl/cu128

With uv, --torch-backend=auto reads the driver and selects a supported build; a specific build can be named instead, for example --torch-backend=cu128.

Optional components

PySR requires an extra and downloads a Julia runtime on first use:

uv pip install "sail-kd[pysr]" --torch-backend=auto

The experimental language-model controller requires the agent extra:

uv pip install "sail-kd[agent]" --torch-backend=auto

For PySR searches through the controller, install sail-kd[agent,pysr]. The same extra names work with python -m pip install. The controller guide covers endpoint configuration, data selection and run reports. EqGPT downloads pretrained assets on first use; LLM4ED requires a configured language-model endpoint. Their algorithm pages describe the corresponding setup.

Check the installation

python -c "import kd; print(kd.__version__)"
kd-agent --help

The command's help is available with the base installation. Controller runs require the extra above.

Continue with the first fit, or read data requirements before loading your own observations.