verda-inferno 0.4.4__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.
@@ -0,0 +1,71 @@
1
+ # If you prefer the allow list template instead of the deny list, see community template:
2
+ # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
3
+ #
4
+ # Binaries for programs and plugins
5
+ *.exe
6
+ *.exe~
7
+ *.dll
8
+ *.so
9
+ *.dylib
10
+
11
+ # Test binary, built with `go test -c`
12
+ *.test
13
+
14
+ # Code coverage profiles and other test artifacts
15
+ *.out
16
+ coverage.*
17
+ *.coverprofile
18
+ profile.cov
19
+ .coverage
20
+
21
+ # Dependency directories (remove the comment below to include it)
22
+ # vendor/
23
+
24
+ # Go workspace file
25
+ go.work
26
+ go.work.sum
27
+
28
+ # env file
29
+ .env
30
+
31
+ # Editor/IDE
32
+ .idea/
33
+ .vscode/
34
+
35
+ # Randoms
36
+ target/
37
+ bin/
38
+
39
+ # Built binaries at repo root
40
+ /inferno
41
+ /inferno-server
42
+ /inferno-nats
43
+
44
+ .DS_Store
45
+ .AppleDouble
46
+ .LSOverride
47
+
48
+ test/test_1mb.json
49
+ test/test_10mb.json
50
+ test/test_100mb.json
51
+ test/test_256mb.json
52
+
53
+ tmp_example_folder
54
+
55
+ # Python
56
+ venv/
57
+ .venv/
58
+ __pycache__/
59
+ *.py[cod]
60
+ *$py.class
61
+ *.egg-info/
62
+ *.egg
63
+ .eggs/
64
+ dist/
65
+ .pytest_cache/
66
+ uv.lock
67
+ .mypy_cache/
68
+ *.pyo
69
+ *.pyd
70
+
71
+ .claude
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2024-2026 Verda
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
@@ -0,0 +1,197 @@
1
+ Metadata-Version: 2.5
2
+ Name: verda-inferno
3
+ Version: 0.4.4
4
+ Summary: Python worker framework for the Verda inference orchestrator
5
+ Project-URL: Homepage, https://github.com/verda-cloud/inferno
6
+ Project-URL: Repository, https://github.com/verda-cloud/inferno
7
+ Project-URL: Documentation, https://github.com/verda-cloud/inferno#readme
8
+ Project-URL: Issues, https://github.com/verda-cloud/inferno/issues
9
+ Author: Verda
10
+ Maintainer-email: Jaakko Varjo <jaakko@verda.com>
11
+ License-Expression: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: inference,inferno,ml,orchestrator,unix-socket,verda,worker
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: Apache Software License
17
+ Classifier: Operating System :: MacOS
18
+ Classifier: Operating System :: POSIX :: Linux
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
26
+ Requires-Python: >=3.10
27
+ Requires-Dist: msgpack>=1.0.0
28
+ Requires-Dist: pyyaml>=6.0
29
+ Provides-Extra: test
30
+ Requires-Dist: pytest-cov>=5.0; extra == 'test'
31
+ Requires-Dist: pytest-mock>=3.10; extra == 'test'
32
+ Requires-Dist: pytest>=8.0; extra == 'test'
33
+ Description-Content-Type: text/markdown
34
+
35
+ # Verda Inferno
36
+
37
+ Python worker framework for [Verda Inferno](https://github.com/verda-cloud/inferno).
38
+
39
+ ## Installation
40
+
41
+ ```bash
42
+ pip install verda-inferno
43
+ ```
44
+
45
+ Or with [uv](https://docs.astral.sh/uv/):
46
+
47
+ ```bash
48
+ uv add verda-inferno
49
+ ```
50
+
51
+ ## Quick Start
52
+
53
+ Create a worker with initialization and prediction functions:
54
+
55
+ ```python
56
+ import json
57
+ import inferno
58
+
59
+ @inferno.initialize
60
+ def setup():
61
+ """Called once at startup. Load your model here."""
62
+ global model
63
+ model = load_my_model()
64
+
65
+ @inferno.predict
66
+ def predict(payload: bytes) -> inferno.Response:
67
+ """Called for each inference request."""
68
+ result = model(payload)
69
+ return inferno.Response(
70
+ data=json.dumps(result).encode(),
71
+ headers={"Content-Type": "application/json"},
72
+ )
73
+ ```
74
+
75
+ Run it with the Verda server:
76
+
77
+ ```bash
78
+ inferno run server -c config.yaml
79
+ ```
80
+
81
+ Or run the worker directly:
82
+
83
+ ```bash
84
+ python -m inferno main.py --control-socket /tmp/inferno.ctrl.sock --data-socket /tmp/inferno.data.sock --name worker-1
85
+ ```
86
+
87
+ Available flags:
88
+
89
+ - `--control-socket` — Path to the control Unix socket
90
+ - `--data-socket` — Path to the data Unix socket
91
+ - `--name` — Worker identity name
92
+ - `-c, --config` — Path to a YAML config file (alternative to flags)
93
+ - `--debug` — Enable debug logging
94
+
95
+ ## Ordered Initialization
96
+
97
+ When your startup sequence requires specific ordering, use `@inferno.initialize` with an order parameter. Functions run in ascending order:
98
+
99
+ ```python
100
+ import inferno
101
+
102
+ @inferno.initialize(0)
103
+ def load_tokenizer():
104
+ global tokenizer
105
+ tokenizer = AutoTokenizer.from_pretrained("model-name")
106
+
107
+ @inferno.initialize(1)
108
+ def load_model():
109
+ global model
110
+ model = AutoModelForCausalLM.from_pretrained("model-name")
111
+
112
+ @inferno.initialize(2)
113
+ def warm_up():
114
+ model.generate(tokenizer("warm up", return_tensors="pt").input_ids)
115
+ ```
116
+
117
+ Using `@inferno.initialize` without an argument defaults to order 0. Multiple functions with the same order run in registration order.
118
+
119
+ ## Response Types
120
+
121
+ The `@inferno.predict` function can return:
122
+
123
+ - **`inferno.Response`** — includes response data, HTTP headers, and status code (recommended)
124
+ - **`bytes`** — sent as-is with `200 OK` and `application/octet-stream` (backward compatible)
125
+ - **generator yielding `bytes`** — streamed as SSE chunks
126
+
127
+ ```python
128
+ # Return with headers and status code
129
+ @inferno.predict
130
+ def predict(payload: bytes) -> inferno.Response:
131
+ try:
132
+ data = json.loads(payload)
133
+ result = model(data)
134
+ return inferno.Response(
135
+ data=json.dumps(result).encode(),
136
+ headers={"Content-Type": "application/json"},
137
+ )
138
+ except ValueError as e:
139
+ return inferno.Response(
140
+ data=json.dumps({"error": str(e)}).encode(),
141
+ headers={"Content-Type": "application/json"},
142
+ status_code=422,
143
+ )
144
+ ```
145
+
146
+ ## Streaming Responses
147
+
148
+ Return a generator from your predict function to stream results:
149
+
150
+ ```python
151
+ @inferno.predict
152
+ def predict(payload: bytes):
153
+ for token in model.generate_stream(payload):
154
+ yield token.encode()
155
+ ```
156
+
157
+ ## Hardware Health
158
+
159
+ Register a function to report hardware status via the `/hardware-health` endpoint:
160
+
161
+ ```python
162
+ @inferno.hardware_health
163
+ def check_hardware() -> dict:
164
+ import torch
165
+ if not torch.cuda.is_available():
166
+ return {"status": "no cuda device detected"}
167
+ free, total = torch.cuda.mem_get_info(0)
168
+ return {
169
+ "status": "ok",
170
+ "device": torch.cuda.get_device_properties(0).name,
171
+ "total_memory_mb": total // (1024 * 1024),
172
+ "free_memory_mb": free // (1024 * 1024),
173
+ }
174
+ ```
175
+
176
+ If no `@inferno.hardware_health` function is registered, the endpoint returns `{"status": "not enabled"}`.
177
+
178
+ ## API
179
+
180
+ - `@inferno.initialize` - Register a startup function (called once, supports ordering)
181
+ - `@inferno.predict` - Register the prediction function (called per request, exactly one required)
182
+ - `@inferno.hardware_health` - Register a hardware health check function (optional)
183
+ - `inferno.Response` - Wrap response data with HTTP headers and status code
184
+ - `inferno.run()` - Start the worker loop programmatically
185
+
186
+ ## How It Works
187
+
188
+ The inferno package connects to the Verda server via Unix domain sockets using a binary protocol (MessagePack + 12-byte headers). Initialization functions run once at startup in order, and `@inferno.predict` is called for each inference request routed by the server. When a predict function returns `inferno.Response`, the worker sends the data with an `Envelope` data type that carries HTTP headers and status code back to the server.
189
+
190
+ ## Requirements
191
+
192
+ - Python 3.10+
193
+ - Linux or macOS (Unix domain sockets required)
194
+
195
+ ## License
196
+
197
+ Apache License 2.0
@@ -0,0 +1,163 @@
1
+ # Verda Inferno
2
+
3
+ Python worker framework for [Verda Inferno](https://github.com/verda-cloud/inferno).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install verda-inferno
9
+ ```
10
+
11
+ Or with [uv](https://docs.astral.sh/uv/):
12
+
13
+ ```bash
14
+ uv add verda-inferno
15
+ ```
16
+
17
+ ## Quick Start
18
+
19
+ Create a worker with initialization and prediction functions:
20
+
21
+ ```python
22
+ import json
23
+ import inferno
24
+
25
+ @inferno.initialize
26
+ def setup():
27
+ """Called once at startup. Load your model here."""
28
+ global model
29
+ model = load_my_model()
30
+
31
+ @inferno.predict
32
+ def predict(payload: bytes) -> inferno.Response:
33
+ """Called for each inference request."""
34
+ result = model(payload)
35
+ return inferno.Response(
36
+ data=json.dumps(result).encode(),
37
+ headers={"Content-Type": "application/json"},
38
+ )
39
+ ```
40
+
41
+ Run it with the Verda server:
42
+
43
+ ```bash
44
+ inferno run server -c config.yaml
45
+ ```
46
+
47
+ Or run the worker directly:
48
+
49
+ ```bash
50
+ python -m inferno main.py --control-socket /tmp/inferno.ctrl.sock --data-socket /tmp/inferno.data.sock --name worker-1
51
+ ```
52
+
53
+ Available flags:
54
+
55
+ - `--control-socket` — Path to the control Unix socket
56
+ - `--data-socket` — Path to the data Unix socket
57
+ - `--name` — Worker identity name
58
+ - `-c, --config` — Path to a YAML config file (alternative to flags)
59
+ - `--debug` — Enable debug logging
60
+
61
+ ## Ordered Initialization
62
+
63
+ When your startup sequence requires specific ordering, use `@inferno.initialize` with an order parameter. Functions run in ascending order:
64
+
65
+ ```python
66
+ import inferno
67
+
68
+ @inferno.initialize(0)
69
+ def load_tokenizer():
70
+ global tokenizer
71
+ tokenizer = AutoTokenizer.from_pretrained("model-name")
72
+
73
+ @inferno.initialize(1)
74
+ def load_model():
75
+ global model
76
+ model = AutoModelForCausalLM.from_pretrained("model-name")
77
+
78
+ @inferno.initialize(2)
79
+ def warm_up():
80
+ model.generate(tokenizer("warm up", return_tensors="pt").input_ids)
81
+ ```
82
+
83
+ Using `@inferno.initialize` without an argument defaults to order 0. Multiple functions with the same order run in registration order.
84
+
85
+ ## Response Types
86
+
87
+ The `@inferno.predict` function can return:
88
+
89
+ - **`inferno.Response`** — includes response data, HTTP headers, and status code (recommended)
90
+ - **`bytes`** — sent as-is with `200 OK` and `application/octet-stream` (backward compatible)
91
+ - **generator yielding `bytes`** — streamed as SSE chunks
92
+
93
+ ```python
94
+ # Return with headers and status code
95
+ @inferno.predict
96
+ def predict(payload: bytes) -> inferno.Response:
97
+ try:
98
+ data = json.loads(payload)
99
+ result = model(data)
100
+ return inferno.Response(
101
+ data=json.dumps(result).encode(),
102
+ headers={"Content-Type": "application/json"},
103
+ )
104
+ except ValueError as e:
105
+ return inferno.Response(
106
+ data=json.dumps({"error": str(e)}).encode(),
107
+ headers={"Content-Type": "application/json"},
108
+ status_code=422,
109
+ )
110
+ ```
111
+
112
+ ## Streaming Responses
113
+
114
+ Return a generator from your predict function to stream results:
115
+
116
+ ```python
117
+ @inferno.predict
118
+ def predict(payload: bytes):
119
+ for token in model.generate_stream(payload):
120
+ yield token.encode()
121
+ ```
122
+
123
+ ## Hardware Health
124
+
125
+ Register a function to report hardware status via the `/hardware-health` endpoint:
126
+
127
+ ```python
128
+ @inferno.hardware_health
129
+ def check_hardware() -> dict:
130
+ import torch
131
+ if not torch.cuda.is_available():
132
+ return {"status": "no cuda device detected"}
133
+ free, total = torch.cuda.mem_get_info(0)
134
+ return {
135
+ "status": "ok",
136
+ "device": torch.cuda.get_device_properties(0).name,
137
+ "total_memory_mb": total // (1024 * 1024),
138
+ "free_memory_mb": free // (1024 * 1024),
139
+ }
140
+ ```
141
+
142
+ If no `@inferno.hardware_health` function is registered, the endpoint returns `{"status": "not enabled"}`.
143
+
144
+ ## API
145
+
146
+ - `@inferno.initialize` - Register a startup function (called once, supports ordering)
147
+ - `@inferno.predict` - Register the prediction function (called per request, exactly one required)
148
+ - `@inferno.hardware_health` - Register a hardware health check function (optional)
149
+ - `inferno.Response` - Wrap response data with HTTP headers and status code
150
+ - `inferno.run()` - Start the worker loop programmatically
151
+
152
+ ## How It Works
153
+
154
+ The inferno package connects to the Verda server via Unix domain sockets using a binary protocol (MessagePack + 12-byte headers). Initialization functions run once at startup in order, and `@inferno.predict` is called for each inference request routed by the server. When a predict function returns `inferno.Response`, the worker sends the data with an `Envelope` data type that carries HTTP headers and status code back to the server.
155
+
156
+ ## Requirements
157
+
158
+ - Python 3.10+
159
+ - Linux or macOS (Unix domain sockets required)
160
+
161
+ ## License
162
+
163
+ Apache License 2.0
@@ -0,0 +1,28 @@
1
+ # SPDX-License-Identifier: Apache-2.0
2
+
3
+ """
4
+ Verda Inferno - ML Worker Framework
5
+
6
+ A framework for building ML inference workers that communicate
7
+ with the Verda inference server over Unix sockets.
8
+
9
+ Usage:
10
+ import inferno
11
+
12
+ @inferno.initialize
13
+ def setup():
14
+ # Load model, initialize resources
15
+ pass
16
+
17
+ @inferno.predict
18
+ def predict(payload: bytes) -> inferno.Response:
19
+ # Process payload and return result
20
+ return inferno.Response(data=result, headers={"Content-Type": "application/json"})
21
+ """
22
+
23
+ from .decorators import initialize, predict, hardware_health, get_initialize_func, get_predict_func, get_hardware_health_func
24
+ from .response import Response
25
+ from .worker import run
26
+
27
+ __version__ = "0.4.4"
28
+ __all__ = ["initialize", "predict", "hardware_health", "Response", "run"]