Install the SDK
You can install the Haystack Enterprise SDK as a command-line tool or as a project dependency.
About This Task
You can install the Haystack Enterprise SDK as a standalone command-line tool or as a Python API you can use in your own projects.
Where to Install Haystack
The SDK needs Haystack installed in the same environment as your pipeline. Install Haystack where your pipeline lives, not where the CLI lives.
The validate, run, and deploy commands load your pipeline in a subprocess. They use your project's interpreter: either a virtual environment the SDK detects near your pipeline file, or the one you pass to --python.
If your pipeline runs in the same environment as the CLI, there's no separate project environment to detect. Install the deploy extra for that case:
uv tool install "haystack-enterprise-sdk[deploy]"
Prerequisites
Install the CLI
When using the Haystack Enterprise SDK on Windows, if haystack-enterprise isn't on your PATH, replace it with python -m haystack_enterprise_sdk.cli, for example:
haystack-enterprise validate pipeline.py
becomes
python -m haystack_enterprise_sdk.cli validate pipeline.py
The SDK is published to PyPI as haystack-enterprise-sdk. Install the CLI as a standalone tool with uv:
uv tool install haystack-enterprise-sdk
This installs the haystack-enterprise command into the uv tools directory, often ~/.local/bin on macOS and Linux. If your shell can't find the command, add that directory to your PATH or run uv tool update-shell, then open a new terminal.
Run the following command to check if the CLI is installed correctly:
haystack-enterprise --version
If the command is still not found, see Troubleshoot Installation.
Install the CLI with the Install Script
If you don't have uv yet, the install script sets up uv and the CLI in one step. Running the script again upgrades the CLI to the latest version.
On macOS, Linux, or Git Bash, MSYS2, or Cygwin on Windows, run:
curl -fsSL https://raw.githubusercontent.com/deepset-ai/haystack-enterprise-sdk/main/install.sh | bash
In Windows PowerShell, run:
powershell -ExecutionPolicy ByPass -c "irm https://raw.githubusercontent.com/deepset-ai/haystack-enterprise-sdk/main/install.ps1 | iex"
Both scripts accept the following optional environment variables:
HE_VERSION: installs a specific version of the SDK, for example0.2.0.HE_EXTRAS: installs extras, for example[deploy].
In Bash, set them in front of the command, for example HE_VERSION=0.2.0 curl ... | bash. In PowerShell, set them first, for example $env:HE_VERSION = "0.2.0".
When the script finishes, it prints the installed version. If it tells you to open a new terminal, do so before you run haystack-enterprise, so your shell picks up the updated PATH.
Upgrade the CLI
To get the latest release of the CLI, run:
haystack-enterprise upgrade
If you installed the CLI with uv tool install, the command upgrades it in place and keeps the extras you installed, such as deploy. uv prints the old and new versions, or tells you there's nothing to upgrade. If you installed the CLI another way, the command doesn't change anything and prints the command to run instead: pip install -U haystack-enterprise-sdk.
When a newer release is available, the CLI also prints a hint that points to this command. To turn off the hint, set the HAYSTACK_ENTERPRISE_NO_UPDATE_CHECK environment variable.
If the upgrade fails with uv, run uv tool upgrade haystack-enterprise-sdk directly to see the full error, and check that you have network access to PyPI.
Install the Python API
To use the Python API, add the SDK as a dependency to your project.
Add the SDK to a Project
Run the following command to add the SDK to your project:
uv add haystack-enterprise-sdk
You can also use the pip install haystack-enterprise-sdk command to install.
The import name is haystack_enterprise_sdk:
from haystack_enterprise_sdk import PipelineClient
Install for Development
To work on the SDK itself, clone the repository and sync all dependency groups:
git clone https://github.com/deepset-ai/haystack-enterprise-sdk.git
cd haystack-enterprise-sdk
uv sync --all-groups
Run the CLI from source with the following command:
uv run haystack-enterprise --help
For the full workflow, see CONTRIBUTING.md.
Next Steps
- Quickstart: log in and deploy your first pipeline.
- Set Up Configuration: API keys, workspaces, and settings precedence.
Related Information
Was this page helpful?