Experimental. This SDK is under active development. APIs and CLI commands may change without notice.
Python SDK and CLI for the Haystack Enterprise Platform.
Paste this into Claude Code, Codex, Cursor, or another coding agent. It installs the CLI and walks you through logging in:
Set up Haystack Enterprise for me. Fetch https://raw.githubusercontent.com/deepset-ai/haystack-enterprise-sdk/main/get-started.md and follow it.
On macOS or Linux, one command installs the CLI. It installs uv first if you don't have it, and running it again upgrades the CLI:
curl -fsSL https://raw.githubusercontent.com/deepset-ai/haystack-enterprise-sdk/main/install.sh | bashOr install it yourself:
# Install as a CLI tool
uv tool install haystack-enterprise-sdk
# Or add it as a dependency of your project
uv add haystack-enterprise-sdk
# pip works too
pip install haystack-enterprise-sdkdeploy, validate, and run load your pipeline in a subprocess using your project's own interpreter
(an auto-detected venv, or --python), so the CLI environment does not need Haystack. Install the
deploy extra only when the CLI environment doubles as the pipeline environment — that is, when there
is no separate project venv to detect:
uv tool install "haystack-enterprise-sdk[deploy]"To install unreleased changes from main:
uv tool install git+https://github.com/deepset-ai/haystack-enterprise-sdk.githaystack-enterprise --helphaystack-enterprise login
haystack-enterprise logout# Upload a folder to a workspace
haystack-enterprise upload ./my-files
# List files in a workspace
haystack-enterprise list-files
# Download files to your local machine
haystack-enterprise download# Validate a local pipeline against the platform
haystack-enterprise validate ./pipeline.py
# Run a local pipeline in the platform sandbox (shows a spinner with the elapsed time while it waits)
haystack-enterprise run ./pipeline.py
# Transient failures (network errors, timeouts, 429, 5xx) are retried twice by default; 0 disables it.
# Config and input errors always fail immediately.
haystack-enterprise run ./pipeline.py --retries 0
# Deploy a local pipeline as a service deployment (reused if it exists, otherwise created serverless).
# Asks at most which socket receives the query and which is the main output -- and nothing at all when
# your socket names already say so. Prints the service's chat-completions endpoint once it is serving.
haystack-enterprise deploy ./pipeline.py my-service
# Create a managed (provisioned) service instead, with explicit sizing
haystack-enterprise deploy ./pipeline.py my-service --managed --cpu 2 --memory 4Gi
# Deploy and get a shareable prototype link (a chat UI). Because that UI routes through the pipeline's
# input/output mapping, --share is also what asks you to review the mapping.
haystack-enterprise deploy ./pipeline.py my-service --share
# Check the status of a service deployment
haystack-enterprise service-status my-serviceA deployed service is served over an OpenAI-compatible chat-completions endpoint, which deploy prints
once the service is running:
curl -N https://api.cloud.deepset.ai/api/v1/workspaces/<workspace>/deployments/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "<workspace>/<deployment-id>", "messages": [{"role": "user", "content": "Hello"}]}'The response is a server-sent-event stream of chat.completion.chunk objects. Any OpenAI client works —
point its base_url at everything up to and including /deployments/v1.
Pass --verbose to any command for INFO/DEBUG logs, and <command> --help for its arguments.
# Install uv if you don't have it
pip install uv
# Sync all dependencies (including dev dependencies)
uv sync --all-groups
# Run the CLI from source
uv run haystack-enterprise --helpSee CONTRIBUTING.md for contribution guidelines.
The SDK is licensed under Apache 2.0, see LICENSE.
Some bundled libraries are licensed under the MPL 2.0 license: