Haystack Enterprise SDK
The Haystack Enterprise SDK moves your Haystack Open Source pipelines and agents onto Haystack Enterprise Platform. You validate, run, and deploy them from your terminal. The Python SDK and the command-line tool both read the same pipeline file, so what you validate is what you deploy.
Use it to:
- Validate a local Haystack pipeline against the Haystack Platform before you deploy it.
- Run a pipeline in the Haystack Platform sandbox and see real output, without deploying.
- Deploy a pipeline or agent as a service, served over an OpenAI-compatible endpoint.
- Share a deployed pipeline as a chat UI prototype link.
- Upload files and their metadata to a Haystack Platform workspace in bulk.
- Automate any of these actions in a CI/CD workflow.
We're actively developing the Haystack Enterprise SDK. Its commands and Python API may change.
Main Benefits
- You stay in your editor and terminal for the whole workflow, from writing a pipeline to deploying it.
- You deploy the pipeline file you already tested, without copying YAML into the UI by hand.
- You upload files into a workspace in bulk instead of one at a time.
- You can wire pipeline deployment into a CI/CD workflow.
When To Use the SDK
Use the SDK when you want to work from your editor and terminal instead of the Haystack Enterprise Platform UI:
- You build and test pipelines locally with Haystack and want to deploy them without copying YAML by hand.
- You want to upload your files into a workspace in bulk.
- You want to wire pipeline deployment into a CI/CD workflow.
For work you'd rather do in the browser, use Haystack Enterprise Platform directly.
Tasks
The SDK currently covers two main tasks: deploying pipelines and uploading files.
Deploying Pipelines
Build a pipeline locally with Haystack, then validate, run, and deploy it from your terminal. All three commands read the same pipeline file.
haystack-enterprise validate pipeline.py
haystack-enterprise run pipeline.py --query "What is deepset?"
haystack-enterprise deploy pipeline.py my-service
Every deployed service exposes an OpenAI-compatible chat completions endpoint, so any OpenAI client can call it. You can also generate a chat UI link using the --share flag and send it to a colleague for feedback.
How Deployment Works
The SDK takes a pipeline from your editor to a running service in four stages. Every stage transforms your pipeline the same way, so the results stay consistent as you iterate.
- Build: You write the pipeline or agent locally with Haystack Open Source. The SDK isn't involved yet.
- Validate: The SDK converts your pipeline into deployable YAML, and the platform checks it. This deploys nothing.
- Run: The Haystack Platform executes the pipeline in a sandbox and prints the results in your terminal. This still deploys nothing.
- Deploy: The Haystack Platform creates a service from your pipeline. Each deployment creates a new revision, so your changes go out incrementally.
Change your pipeline locally and repeat these steps as many times as you need.
The Python Environment
The validate, run, and deploy commands load your pipeline in a subprocess. They use your project's own interpreter: either a virtual environment the SDK detects near your pipeline file, or the one you pass with --python.
Install Haystack in your project environment, not alongside the SDK. The SDK runs your pipeline where your pipeline lives, which keeps the SDK's own dependencies minimal.
Uploading Files
Upload files and their metadata into a workspace in bulk, from the command line or from Python:
haystack-enterprise upload ./my-files
Get Started
- Quickstart: deploy your first pipeline in a few minutes.
- Install the SDK: get the
haystack-enterprisecommand. - Set Up Configuration: API keys, workspaces, and settings precedence.
Related Information
- CLI Reference: every command and flag.
- Quick Reference: the most common commands on one page.
- Haystack Enterprise SDK on GitHub
- Haystack: the open source framework the platform is built on.
Was this page helpful?