haystack-enterprise-sdk 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. haystack_enterprise_sdk-0.1.0/LICENSE +202 -0
  2. haystack_enterprise_sdk-0.1.0/PKG-INFO +161 -0
  3. haystack_enterprise_sdk-0.1.0/README.md +121 -0
  4. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/README.md +42 -0
  5. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/__init__.py +89 -0
  6. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_api/config.py +135 -0
  7. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_api/deployments.py +726 -0
  8. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_api/files.py +284 -0
  9. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_api/haystack_enterprise_api.py +442 -0
  10. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_api/pipeline_run.py +219 -0
  11. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_api/shared_prototypes.py +127 -0
  12. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_api/upload_sessions.py +293 -0
  13. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_console.py +105 -0
  14. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_s3/__init__.py +1 -0
  15. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_s3/upload.py +394 -0
  16. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_service/deployment_service.py +583 -0
  17. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_service/files_service.py +737 -0
  18. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_service/io_spec.py +203 -0
  19. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_service/pipeline_extract.py +1675 -0
  20. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_service/pipeline_service.py +444 -0
  21. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_service/pipeline_transform.py +575 -0
  22. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_utils/__init__.py +1 -0
  23. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/_utils/datetime.py +13 -0
  24. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/cli.py +1719 -0
  25. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/models.py +293 -0
  26. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/workflows/__init__.py +35 -0
  27. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/workflows/async_client/__init__.py +1 -0
  28. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/workflows/async_client/async_pipeline_client.py +132 -0
  29. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/workflows/async_client/deployment_client.py +221 -0
  30. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/workflows/async_client/files.py +315 -0
  31. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/workflows/sync_client/__init__.py +1 -0
  32. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/workflows/sync_client/deployment_client.py +197 -0
  33. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/workflows/sync_client/files.py +334 -0
  34. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/workflows/sync_client/pipeline_client.py +132 -0
  35. haystack_enterprise_sdk-0.1.0/haystack_enterprise_sdk/workflows/sync_client/utils.py +32 -0
  36. haystack_enterprise_sdk-0.1.0/pyproject.toml +146 -0
  37. haystack_enterprise_sdk-0.1.0/pyproject.toml.orig +144 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2021 deepset GmbH
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,161 @@
1
+ Metadata-Version: 2.4
2
+ Name: haystack-enterprise-sdk
3
+ Version: 0.1.0
4
+ Summary: Haystack Enterprise SDK
5
+ Keywords:
6
+ Author: deepset.ai
7
+ Author-email: deepset.ai <malte.pietsch@deepset.ai>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Programming Language :: Python
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Programming Language :: Python :: 3.14
18
+ Requires-Dist: structlog>=24.0.0
19
+ Requires-Dist: httpx>=0.27.2
20
+ Requires-Dist: python-dotenv>=1.0.1
21
+ Requires-Dist: typer>=0.15.0
22
+ Requires-Dist: click<=8.3.1
23
+ Requires-Dist: tenacity>=8.3.0
24
+ Requires-Dist: aiohttp>=3.10.10
25
+ Requires-Dist: aiofiles>=24.1.0
26
+ Requires-Dist: tabulate>=0.9.0
27
+ Requires-Dist: tqdm>=4.66.4
28
+ Requires-Dist: yaspin>=3.0.0
29
+ Requires-Dist: pyrate-limiter>=3.7.0
30
+ Requires-Dist: pydantic>=2.11.4
31
+ Requires-Dist: ruamel-yaml>=0.18.10
32
+ Requires-Dist: sniffio>=1.3.1
33
+ Requires-Dist: haystack-ai>=2.13.2 ; extra == 'deploy'
34
+ Requires-Python: >=3.10
35
+ Project-URL: Documentation, https://github.com/deepset-ai/haystack-enterprise-sdk#readme
36
+ Project-URL: Issues, https://github.com/deepset-ai/haystack-enterprise-sdk/issues
37
+ Project-URL: Source, https://github.com/deepset-ai/haystack-enterprise-sdk
38
+ Provides-Extra: deploy
39
+ Description-Content-Type: text/markdown
40
+
41
+ <p align="center">
42
+ <picture>
43
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/deepset-ai/haystack-enterprise-sdk/main/assets/logo-dark.svg">
44
+ <img src="https://raw.githubusercontent.com/deepset-ai/haystack-enterprise-sdk/main/assets/logo.svg" alt="Haystack Enterprise SDK" width="420">
45
+ </picture>
46
+ </p>
47
+
48
+ # Haystack Enterprise SDK
49
+
50
+ > **Experimental.** This SDK is under active development. APIs and CLI commands may change without notice.
51
+
52
+ Python SDK and CLI for the Haystack Enterprise Platform.
53
+
54
+ ## Installation
55
+
56
+ Not published to a package registry yet — install directly from this repository with [uv](https://docs.astral.sh/uv/):
57
+
58
+ ```bash
59
+ # Install as a CLI tool
60
+ uv tool install git+https://github.com/deepset-ai/haystack-enterprise-sdk.git
61
+
62
+ # Or add it as a dependency of your project
63
+ uv add git+https://github.com/deepset-ai/haystack-enterprise-sdk.git
64
+ ```
65
+
66
+ ## Usage
67
+
68
+ ```bash
69
+ haystack-enterprise --help
70
+ ```
71
+
72
+ ### Authentication
73
+
74
+ ```bash
75
+ haystack-enterprise login
76
+ haystack-enterprise logout
77
+ ```
78
+
79
+ ### Files
80
+
81
+ ```bash
82
+ # Upload a folder to a workspace
83
+ haystack-enterprise upload ./my-files
84
+
85
+ # List files in a workspace
86
+ haystack-enterprise list-files
87
+
88
+ # Download files to your local machine
89
+ haystack-enterprise download
90
+ ```
91
+
92
+ ### Pipelines
93
+
94
+ ```bash
95
+ # Validate a local pipeline against the platform
96
+ haystack-enterprise validate ./pipeline.py
97
+
98
+ # Run a local pipeline in the platform sandbox (shows a spinner with the elapsed time while it waits)
99
+ haystack-enterprise run ./pipeline.py
100
+
101
+ # Transient failures (network errors, timeouts, 429, 5xx) are retried twice by default; 0 disables it.
102
+ # Config and input errors always fail immediately.
103
+ haystack-enterprise run ./pipeline.py --retries 0
104
+
105
+ # Deploy a local pipeline as a service deployment (reused if it exists, otherwise created serverless).
106
+ # Asks at most which socket receives the query and which is the main output -- and nothing at all when
107
+ # your socket names already say so. Prints the service's chat-completions endpoint once it is serving.
108
+ haystack-enterprise deploy ./pipeline.py my-service
109
+
110
+ # Create a managed (provisioned) service instead, with explicit sizing
111
+ haystack-enterprise deploy ./pipeline.py my-service --managed --cpu 2 --memory 4Gi
112
+
113
+ # Deploy and get a shareable prototype link (a chat UI). Because that UI routes through the pipeline's
114
+ # input/output mapping, --share is also what asks you to review the mapping.
115
+ haystack-enterprise deploy ./pipeline.py my-service --share
116
+
117
+ # Check the status of a service deployment
118
+ haystack-enterprise service-status my-service
119
+ ```
120
+
121
+ ### Calling a deployed service
122
+
123
+ A deployed service is served over an OpenAI-compatible chat-completions endpoint, which `deploy` prints
124
+ once the service is running:
125
+
126
+ ```bash
127
+ curl -N https://api.cloud.deepset.ai/api/v1/workspaces/<workspace>/deployments/<deployment-id>/chat/completions \
128
+ -H "Authorization: Bearer $API_KEY" \
129
+ -H "Content-Type: application/json" \
130
+ -d '{"model": "<workspace>/<service-name>", "messages": [{"role": "user", "content": "Hello"}]}'
131
+ ```
132
+
133
+ The response is a server-sent-event stream of `chat.completion.chunk` objects. Any OpenAI client works —
134
+ point its `base_url` at everything up to and including `/deployments/<deployment-id>`.
135
+
136
+ Pass `--verbose` to any command for INFO/DEBUG logs, and `<command> --help` for its arguments.
137
+
138
+ ## Development
139
+
140
+ ```bash
141
+ # Install uv if you don't have it
142
+ pip install uv
143
+
144
+ # Sync all dependencies (including dev dependencies)
145
+ uv sync --all-groups
146
+
147
+ # Run the CLI from source
148
+ uv run haystack-enterprise --help
149
+ ```
150
+
151
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
152
+
153
+ ## Licenses
154
+
155
+ The SDK is licensed under Apache 2.0, see [LICENSE](LICENSE).
156
+
157
+ Some bundled libraries are licensed under the [MPL 2.0 license](https://www.mozilla.org/en-US/MPL/2.0/):
158
+
159
+ - [tqdm](https://github.com/tqdm/tqdm) for progress bars
160
+ - [pathspec](https://github.com/cpburnz/python-pathspec) for pattern matching file paths
161
+ - [certifi](https://github.com/certifi/python-certifi) for validating trustworthiness of SSL certificates
@@ -0,0 +1,121 @@
1
+ <p align="center">
2
+ <picture>
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/deepset-ai/haystack-enterprise-sdk/main/assets/logo-dark.svg">
4
+ <img src="https://raw.githubusercontent.com/deepset-ai/haystack-enterprise-sdk/main/assets/logo.svg" alt="Haystack Enterprise SDK" width="420">
5
+ </picture>
6
+ </p>
7
+
8
+ # Haystack Enterprise SDK
9
+
10
+ > **Experimental.** This SDK is under active development. APIs and CLI commands may change without notice.
11
+
12
+ Python SDK and CLI for the Haystack Enterprise Platform.
13
+
14
+ ## Installation
15
+
16
+ Not published to a package registry yet — install directly from this repository with [uv](https://docs.astral.sh/uv/):
17
+
18
+ ```bash
19
+ # Install as a CLI tool
20
+ uv tool install git+https://github.com/deepset-ai/haystack-enterprise-sdk.git
21
+
22
+ # Or add it as a dependency of your project
23
+ uv add git+https://github.com/deepset-ai/haystack-enterprise-sdk.git
24
+ ```
25
+
26
+ ## Usage
27
+
28
+ ```bash
29
+ haystack-enterprise --help
30
+ ```
31
+
32
+ ### Authentication
33
+
34
+ ```bash
35
+ haystack-enterprise login
36
+ haystack-enterprise logout
37
+ ```
38
+
39
+ ### Files
40
+
41
+ ```bash
42
+ # Upload a folder to a workspace
43
+ haystack-enterprise upload ./my-files
44
+
45
+ # List files in a workspace
46
+ haystack-enterprise list-files
47
+
48
+ # Download files to your local machine
49
+ haystack-enterprise download
50
+ ```
51
+
52
+ ### Pipelines
53
+
54
+ ```bash
55
+ # Validate a local pipeline against the platform
56
+ haystack-enterprise validate ./pipeline.py
57
+
58
+ # Run a local pipeline in the platform sandbox (shows a spinner with the elapsed time while it waits)
59
+ haystack-enterprise run ./pipeline.py
60
+
61
+ # Transient failures (network errors, timeouts, 429, 5xx) are retried twice by default; 0 disables it.
62
+ # Config and input errors always fail immediately.
63
+ haystack-enterprise run ./pipeline.py --retries 0
64
+
65
+ # Deploy a local pipeline as a service deployment (reused if it exists, otherwise created serverless).
66
+ # Asks at most which socket receives the query and which is the main output -- and nothing at all when
67
+ # your socket names already say so. Prints the service's chat-completions endpoint once it is serving.
68
+ haystack-enterprise deploy ./pipeline.py my-service
69
+
70
+ # Create a managed (provisioned) service instead, with explicit sizing
71
+ haystack-enterprise deploy ./pipeline.py my-service --managed --cpu 2 --memory 4Gi
72
+
73
+ # Deploy and get a shareable prototype link (a chat UI). Because that UI routes through the pipeline's
74
+ # input/output mapping, --share is also what asks you to review the mapping.
75
+ haystack-enterprise deploy ./pipeline.py my-service --share
76
+
77
+ # Check the status of a service deployment
78
+ haystack-enterprise service-status my-service
79
+ ```
80
+
81
+ ### Calling a deployed service
82
+
83
+ A deployed service is served over an OpenAI-compatible chat-completions endpoint, which `deploy` prints
84
+ once the service is running:
85
+
86
+ ```bash
87
+ curl -N https://api.cloud.deepset.ai/api/v1/workspaces/<workspace>/deployments/<deployment-id>/chat/completions \
88
+ -H "Authorization: Bearer $API_KEY" \
89
+ -H "Content-Type: application/json" \
90
+ -d '{"model": "<workspace>/<service-name>", "messages": [{"role": "user", "content": "Hello"}]}'
91
+ ```
92
+
93
+ The response is a server-sent-event stream of `chat.completion.chunk` objects. Any OpenAI client works —
94
+ point its `base_url` at everything up to and including `/deployments/<deployment-id>`.
95
+
96
+ Pass `--verbose` to any command for INFO/DEBUG logs, and `<command> --help` for its arguments.
97
+
98
+ ## Development
99
+
100
+ ```bash
101
+ # Install uv if you don't have it
102
+ pip install uv
103
+
104
+ # Sync all dependencies (including dev dependencies)
105
+ uv sync --all-groups
106
+
107
+ # Run the CLI from source
108
+ uv run haystack-enterprise --help
109
+ ```
110
+
111
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for contribution guidelines.
112
+
113
+ ## Licenses
114
+
115
+ The SDK is licensed under Apache 2.0, see [LICENSE](LICENSE).
116
+
117
+ Some bundled libraries are licensed under the [MPL 2.0 license](https://www.mozilla.org/en-US/MPL/2.0/):
118
+
119
+ - [tqdm](https://github.com/tqdm/tqdm) for progress bars
120
+ - [pathspec](https://github.com/cpburnz/python-pathspec) for pattern matching file paths
121
+ - [certifi](https://github.com/certifi/python-certifi) for validating trustworthiness of SSL certificates
@@ -0,0 +1,42 @@
1
+ # Software development kit for the deepset API
2
+
3
+ This package is split into multiple layers:
4
+ - API layer
5
+ - Client layer
6
+ - Service layer
7
+ - Workflow layer
8
+
9
+
10
+ ### API layer
11
+ This layer is the lowest level of abstraction and contains the API definition, including all HTTP methods. It takes care of the authentication.
12
+ You can find this layer in the `haystack_enterprise_sdk/_api/haystack_enterprise_api.py` file. We should implement reties on this lowest layer.
13
+
14
+ ### Client layer
15
+ This layer adds a thin wrapper around the API layer and provides a more convenient interface to the API. It includes explicit methods
16
+ for endpoints by specifying the HTTP methods and endpoints for example for uploading files.
17
+
18
+ ### Service layer
19
+ This layer takes care of combining client methods to provide more complex functionality. Within this layer, we can add functionalities like
20
+ creating sessions, uploading files, and closing sessions.
21
+
22
+ ### Workflow layer
23
+ Public methods for users. These workflows are split into async and sync implementation.
24
+
25
+
26
+ ## Software architecture principles
27
+
28
+ ### Factories
29
+ We are using factories implemented like this:
30
+ ```python
31
+ @classmethod
32
+ async def factory(cls, config: CommonConfig) -> YourClass:
33
+ """Create a new instance of the API client.
34
+
35
+ :param config: CommonConfig object.
36
+ """
37
+ yield cls(config)
38
+ ```
39
+
40
+ ### Tests
41
+ We are using the classical pyramid of tests: unit tests (for each layer), integration tests. The goal is to gradually test each layer and
42
+ then test the whole stack once within the integration tests.
@@ -0,0 +1,89 @@
1
+ """This is the entrypoint for the package."""
2
+
3
+ import logging
4
+
5
+ import structlog
6
+
7
+ from haystack_enterprise_sdk._api.deployments import (
8
+ DeploymentMode,
9
+ DeploymentServiceLevel,
10
+ PipelineValidationError,
11
+ PipelineValidationIssue,
12
+ PipelineValidationResult,
13
+ )
14
+ from haystack_enterprise_sdk._api.pipeline_run import PipelineRunError
15
+ from haystack_enterprise_sdk._api.shared_prototypes import (
16
+ FailedToCreateSharedPrototypeError,
17
+ SharedPrototype,
18
+ )
19
+ from haystack_enterprise_sdk._service.deployment_service import (
20
+ CreateOptions,
21
+ DeploymentFailedError,
22
+ DeployResult,
23
+ ServiceNotFoundError,
24
+ ShareOptions,
25
+ )
26
+ from haystack_enterprise_sdk._service.pipeline_service import (
27
+ ErrorDetail,
28
+ HaystackEnterpriseValidationError,
29
+ )
30
+ from haystack_enterprise_sdk._service.pipeline_transform import (
31
+ PipelineSettings,
32
+ PipelineTransformError,
33
+ )
34
+ from haystack_enterprise_sdk.models import (
35
+ BaseConfig,
36
+ IndexConfig,
37
+ IndexInputs,
38
+ IndexOutputs,
39
+ PipelineConfig,
40
+ PipelineInputs,
41
+ PipelineOutputs,
42
+ PipelineOutputType,
43
+ )
44
+ from haystack_enterprise_sdk.workflows.async_client.async_pipeline_client import (
45
+ AsyncPipelineClient,
46
+ )
47
+ from haystack_enterprise_sdk.workflows.async_client.deployment_client import (
48
+ AsyncDeploymentClient,
49
+ )
50
+ from haystack_enterprise_sdk.workflows.sync_client.deployment_client import DeploymentClient
51
+ from haystack_enterprise_sdk.workflows.sync_client.pipeline_client import PipelineClient
52
+
53
+ structlog.configure(
54
+ wrapper_class=structlog.make_filtering_bound_logger(logging.INFO),
55
+ )
56
+
57
+ log = structlog.get_logger()
58
+
59
+ __all__ = [
60
+ "AsyncPipelineClient",
61
+ "BaseConfig",
62
+ "ErrorDetail",
63
+ "PipelineClient",
64
+ "PipelineConfig",
65
+ "PipelineInputs",
66
+ "PipelineOutputs",
67
+ "IndexConfig",
68
+ "IndexInputs",
69
+ "IndexOutputs",
70
+ "HaystackEnterpriseValidationError",
71
+ "PipelineOutputType",
72
+ "DeploymentClient",
73
+ "AsyncDeploymentClient",
74
+ "CreateOptions",
75
+ "DeploymentMode",
76
+ "DeploymentServiceLevel",
77
+ "DeployResult",
78
+ "ShareOptions",
79
+ "SharedPrototype",
80
+ "DeploymentFailedError",
81
+ "ServiceNotFoundError",
82
+ "FailedToCreateSharedPrototypeError",
83
+ "PipelineSettings",
84
+ "PipelineTransformError",
85
+ "PipelineValidationError",
86
+ "PipelineValidationResult",
87
+ "PipelineValidationIssue",
88
+ "PipelineRunError",
89
+ ]