jointfm-inference 0.9.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 (70) hide show
  1. jointfm_inference-0.9.0/.gitignore +223 -0
  2. jointfm_inference-0.9.0/LICENSE +201 -0
  3. jointfm_inference-0.9.0/PKG-INFO +217 -0
  4. jointfm_inference-0.9.0/README.md +189 -0
  5. jointfm_inference-0.9.0/pyproject.toml +120 -0
  6. jointfm_inference-0.9.0/src/jointfm_inference/__init__.py +19 -0
  7. jointfm_inference-0.9.0/src/jointfm_inference/cli.py +123 -0
  8. jointfm_inference-0.9.0/src/jointfm_inference/core/__init__.py +15 -0
  9. jointfm_inference-0.9.0/src/jointfm_inference/core/timing.py +170 -0
  10. jointfm_inference-0.9.0/src/jointfm_inference/core/version.py +45 -0
  11. jointfm_inference-0.9.0/src/jointfm_inference/data/__init__.py +15 -0
  12. jointfm_inference-0.9.0/src/jointfm_inference/data/adapters.py +190 -0
  13. jointfm_inference-0.9.0/src/jointfm_inference/data/time_index.py +256 -0
  14. jointfm_inference-0.9.0/src/jointfm_inference/data/types.py +110 -0
  15. jointfm_inference-0.9.0/src/jointfm_inference/model/__init__.py +15 -0
  16. jointfm_inference-0.9.0/src/jointfm_inference/model/checkpoint.py +250 -0
  17. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/__init__.py +92 -0
  18. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/_bounds.py +83 -0
  19. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/adapter.py +225 -0
  20. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/backend_registry.py +95 -0
  21. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/capacity_envelope.py +126 -0
  22. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/checkpoint.py +55 -0
  23. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/conditional_query.py +740 -0
  24. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/conditioning.py +572 -0
  25. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/contract.py +436 -0
  26. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/interval_conditioning.py +391 -0
  27. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/jointfm_1_backend.py +250 -0
  28. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/jointfm_1_grid.py +166 -0
  29. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/session.py +159 -0
  30. jointfm_inference-0.9.0/src/jointfm_inference/model/inference/time_index.py +102 -0
  31. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/__init__.py +15 -0
  32. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/config.py +258 -0
  33. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/encoder.py +267 -0
  34. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/head.py +434 -0
  35. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/input_scale.py +119 -0
  36. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/loader.py +69 -0
  37. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/marginals.py +548 -0
  38. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/model.py +275 -0
  39. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/pooling.py +83 -0
  40. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/readouts.py +255 -0
  41. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/sign_symmetry.py +109 -0
  42. jointfm_inference-0.9.0/src/jointfm_inference/model/jointfm_1/tail_map.py +444 -0
  43. jointfm_inference-0.9.0/src/jointfm_inference/model/linalg.py +230 -0
  44. jointfm_inference-0.9.0/src/jointfm_inference/model/precision.py +117 -0
  45. jointfm_inference-0.9.0/src/jointfm_inference/model/probe.py +545 -0
  46. jointfm_inference-0.9.0/src/jointfm_inference/model/profile.py +530 -0
  47. jointfm_inference-0.9.0/src/jointfm_inference/model/service/__init__.py +56 -0
  48. jointfm_inference-0.9.0/src/jointfm_inference/model/service/checkpoint_source.py +141 -0
  49. jointfm_inference-0.9.0/src/jointfm_inference/model/service/column_specs.py +160 -0
  50. jointfm_inference-0.9.0/src/jointfm_inference/model/service/conditions.py +247 -0
  51. jointfm_inference-0.9.0/src/jointfm_inference/model/service/config.py +307 -0
  52. jointfm_inference-0.9.0/src/jointfm_inference/model/service/constants.py +64 -0
  53. jointfm_inference-0.9.0/src/jointfm_inference/model/service/data_frames.py +224 -0
  54. jointfm_inference-0.9.0/src/jointfm_inference/model/service/errors.py +88 -0
  55. jointfm_inference-0.9.0/src/jointfm_inference/model/service/http_handler.py +226 -0
  56. jointfm_inference-0.9.0/src/jointfm_inference/model/service/http_service.py +818 -0
  57. jointfm_inference-0.9.0/src/jointfm_inference/model/service/scoring.py +119 -0
  58. jointfm_inference-0.9.0/src/jointfm_inference/model/service/serialization.py +111 -0
  59. jointfm_inference-0.9.0/src/jointfm_inference/model/service/server.py +92 -0
  60. jointfm_inference-0.9.0/src/jointfm_inference/model/service/time_conversion.py +35 -0
  61. jointfm_inference-0.9.0/src/jointfm_inference/model/service/validation.py +207 -0
  62. jointfm_inference-0.9.0/src/jointfm_inference/model/service/wire_schema/__init__.py +97 -0
  63. jointfm_inference-0.9.0/src/jointfm_inference/model/service/wire_schema/document.py +163 -0
  64. jointfm_inference-0.9.0/src/jointfm_inference/model/service/wire_schema/examples.py +145 -0
  65. jointfm_inference-0.9.0/src/jointfm_inference/model/service/wire_schema/fields.py +134 -0
  66. jointfm_inference-0.9.0/src/jointfm_inference/model/service/wire_schema/openapi.json +2621 -0
  67. jointfm_inference-0.9.0/src/jointfm_inference/model/service/wire_schema/request.py +422 -0
  68. jointfm_inference-0.9.0/src/jointfm_inference/model/service/wire_schema/response.py +551 -0
  69. jointfm_inference-0.9.0/src/jointfm_inference/model/service/wire_schema/vocabulary.py +188 -0
  70. jointfm_inference-0.9.0/src/jointfm_inference/py.typed +0 -0
@@ -0,0 +1,223 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ # Pipfile.lock
97
+
98
+ # uv
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ # poetry.lock
110
+ # poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ # pdm.lock
117
+ # pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ # pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule*
134
+ celerybeat.pid
135
+
136
+ # Redis
137
+ *.rdb
138
+ *.aof
139
+ *.pid
140
+
141
+ # RabbitMQ
142
+ mnesia/
143
+ rabbitmq/
144
+ rabbitmq-data/
145
+
146
+ # ActiveMQ
147
+ activemq-data/
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ env/
157
+ venv/
158
+ ENV/
159
+ env.bak/
160
+ venv.bak/
161
+
162
+ # Spyder project settings
163
+ .spyderproject
164
+ .spyproject
165
+
166
+ # Rope project settings
167
+ .ropeproject
168
+
169
+ # mkdocs/Zensical documentation
170
+ /site
171
+
172
+ # mypy
173
+ .mypy_cache/
174
+ .dmypy.json
175
+ dmypy.json
176
+
177
+ # Pyre type checker
178
+ .pyre/
179
+
180
+ # pytype static type analyzer
181
+ .pytype/
182
+
183
+ # Cython debug symbols
184
+ cython_debug/
185
+
186
+ # PyCharm
187
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
188
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
190
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
191
+ # .idea/
192
+
193
+ # Abstra
194
+ # Abstra is an AI-powered process automation framework.
195
+ # Ignore directories containing user credentials, local state, and settings.
196
+ # Learn more at https://abstra.io/docs
197
+ .abstra/
198
+
199
+ # Visual Studio Code
200
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
201
+ # can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
202
+ # and can be added to the global gitignore or merged into this file. However, if you prefer, you
203
+ # could uncomment the following to ignore the entire vscode folder
204
+ # .vscode/
205
+ # Temporary file for partial code execution
206
+ tempCodeRunnerFile.py
207
+
208
+ # Ruff stuff:
209
+ .ruff_cache/
210
+
211
+ # PyPI configuration file
212
+ .pypirc
213
+
214
+ # Marimo
215
+ marimo/_static/
216
+ marimo/_lsp/
217
+ __marimo__/
218
+
219
+ # Streamlit
220
+ .streamlit/secrets.toml
221
+
222
+ # Leak guard: maintainers' private patterns, which name the material they guard
223
+ /.leak-patterns.private
@@ -0,0 +1,201 @@
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 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 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 those 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
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 DataRobot, Inc.
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,217 @@
1
+ Metadata-Version: 2.5
2
+ Name: jointfm-inference
3
+ Version: 0.9.0
4
+ Summary: Inference runner that serves JointFM checkpoints over HTTP
5
+ Project-URL: Repository, https://github.com/datarobot-oss/joint-inference-python
6
+ Project-URL: Changelog, https://github.com/datarobot-oss/joint-inference-python/blob/main/CHANGELOG.md
7
+ Author-email: Stefan Hackmann <stefan.hackmann@datarobot.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: forecasting,inference,jointfm
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Operating System :: MacOS
15
+ Classifier: Operating System :: POSIX :: Linux
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.13
22
+ Requires-Dist: numpy
23
+ Requires-Dist: orjson>=3.11
24
+ Requires-Dist: pandas
25
+ Requires-Dist: scipy
26
+ Requires-Dist: torch==2.15.0
27
+ Description-Content-Type: text/markdown
28
+
29
+ <p align="center">
30
+ <a href="https://github.com/datarobot-oss/joint-inference-python">
31
+ <img src="https://raw.githubusercontent.com/datarobot-oss/joint-inference-python/main/.github/datarobot_logo.avif" width="600px" alt="DataRobot Logo"/>
32
+ </a>
33
+ </p>
34
+ <h3 align="center">JointFM Inference Runner</h3>
35
+
36
+ <p align="center">
37
+ <a href="https://www.datarobot.com/">Homepage</a>
38
+ ·
39
+ <a href="https://pypi.org/project/jointfm-inference/">PyPI</a>
40
+ ·
41
+ <a href="https://github.com/datarobot-oss/joint-client-python">Python client</a>
42
+ ·
43
+ <a href="https://docs.datarobot.com/en/docs/get-started/troubleshooting/general-help.html">Support</a>
44
+ </p>
45
+
46
+ <p align="center">
47
+ <a href="https://github.com/datarobot-oss/joint-inference-python/actions/workflows/ci.yml">
48
+ <img src="https://github.com/datarobot-oss/joint-inference-python/actions/workflows/ci.yml/badge.svg" alt="CI">
49
+ </a>
50
+ <a href="https://pypi.org/project/jointfm-inference/">
51
+ <img src="https://img.shields.io/pypi/v/jointfm-inference" alt="PyPI version">
52
+ </a>
53
+ <a href="https://pypi.org/project/jointfm-inference/">
54
+ <img src="https://img.shields.io/pypi/pyversions/jointfm-inference" alt="Python versions">
55
+ </a>
56
+ <a href="https://github.com/datarobot-oss/joint-inference-python/blob/main/LICENSE">
57
+ <img src="https://img.shields.io/github/license/datarobot-oss/joint-inference-python" alt="License">
58
+ </a>
59
+ </p>
60
+
61
+ `jointfm-inference` is the inference runner for JointFM: it loads JointFM checkpoints and serves joint probabilistic forecasts over HTTP. Applications talk to a running instance through the [`jointfm-client`](https://github.com/datarobot-oss/joint-client-python) SDK ([PyPI](https://pypi.org/project/jointfm-client/)).
62
+
63
+ The repository holds the serving code for JointFM 1 checkpoints, the `jointfm-inference` command, and a container image. Neither the package nor the image contains weights: every service names the checkpoint it serves in its own configuration.
64
+
65
+ > **Status: beta.** Every released JointFM 1 checkpoint keeps loading and predicting as it did, and every documented request keeps working; a checkpoint layout is dropped only after a notice of at least 90 days ([Compatibility of released exports](https://github.com/datarobot-oss/joint-inference-python/blob/main/CONTRIBUTING.md#compatibility-of-released-exports)). Anything else can still change in a minor release while the version is `0.x`.
66
+
67
+ ## Quickstart
68
+
69
+ 1. **Check the requirements:** Python 3.13 or newer on Ubuntu, Amazon Linux, or macOS. [Hardware](#hardware) lists the GPU, memory, and disk space the service needs.
70
+ 2. **Get a weights file.** Serving needs a JointFM serving weights file: a JointFM 1 checkpoint in the format the runner reads. How to obtain one will be documented here.
71
+ 3. **Install the package** into a fresh environment:
72
+
73
+ ```sh
74
+ python3.13 -m venv .venv
75
+ . .venv/bin/activate
76
+ pip install jointfm-inference
77
+ ```
78
+
79
+ 4. **Serve the weights file**; [Configuration](#configuration) lists every other setting, such as the GPU to run on:
80
+
81
+ ```sh
82
+ JOINTFM_INFERENCE_CHECKPOINT_PATH=/path/to/weights.pt jointfm-inference serve # stop with Ctrl-C
83
+ ```
84
+
85
+ 5. **Check it** from a second shell in the same environment; this requests every return mode the service advertises:
86
+
87
+ ```sh
88
+ jointfm-inference probe --service-url http://127.0.0.1:8080
89
+ ```
90
+
91
+ 6. **Forecast** from Python with [`jointfm-client`](https://github.com/datarobot-oss/joint-client-python), pointing its local selector `JOINTFM_LOCAL_BASE_URL` at `http://127.0.0.1:8080`.
92
+
93
+ ### From a clone
94
+
95
+ The `task` targets serve from a clone of this repository instead and read the settings from a `.env` file; they also build and run the [container](#container). They need [uv](https://docs.astral.sh/uv/) and [Task](https://taskfile.dev/), and the container needs Docker:
96
+
97
+ ```sh
98
+ git clone https://github.com/datarobot-oss/joint-inference-python.git
99
+ cd joint-inference-python
100
+ cp .env.template .env # then set the weights file in .env
101
+ task serve # creates the environment on first use; stop with Ctrl-C
102
+ task probe # from a second shell
103
+ ```
104
+
105
+ In `.env`, set `JOINTFM_INFERENCE_CHECKPOINT_PATH` to the weights file, or to where it should be downloaded together with `JOINTFM_INFERENCE_CHECKPOINT_URL` and `JOINTFM_INFERENCE_CHECKPOINT_SHA256`.
106
+
107
+ ## Hardware
108
+
109
+ These figures are for the JointFM 1 open weights at the default `bf16` precision, rounded up from our estimate for the largest request the model accepts: 100 series, 732 steps of history, and all 92 forecast steps. Smaller requests need less, and next-day forecasts need far less.
110
+
111
+ **GPU.** Any NVIDIA GPU of the Ampere generation or newer with 16 GB of memory. `bf16` needs native bfloat16 support, and the service refuses to start with `bf16` on a GPU without it; there, set `JOINTFM_INFERENCE_PRECISION=fp32`, which needs more memory. GPU memory grows with the samples, forecast steps, and series a request asks for, because the model runs once per request and draws all of its samples from that run:
112
+
113
+ | Samples per request (`JOINTFM_INFERENCE_MAX_SAMPLE_COUNT`) | GPU memory for the largest request |
114
+ | --- | --- |
115
+ | 1,000 (the default) | about 10 GB |
116
+ | 5,000 | about 12 GB |
117
+ | 20,000 | about 20 GB |
118
+
119
+ With `JOINTFM_INFERENCE_MAX_CONCURRENT_REQUESTS` above 1, each concurrent request needs that much again, apart from the roughly 2 GB of weights and CUDA context they share.
120
+
121
+ **RAM.** About 4 GB when the model runs on a GPU, plus about 20 bytes for every value a response returns (samples × forecast steps × series), so about 8 GB for 20,000 samples of the largest request. On the CPU, the model itself runs in RAM: plan for about 16 GB at 1,000 samples and about 32 GB at 20,000.
122
+
123
+ **Disk.** About 0.7 GB for the weights; a download is written next to the file before it replaces it, so replacing a file briefly needs twice that. About 6 GB for the Python environment on Linux, most of it PyTorch with its CUDA libraries, and about as much again for the [container](#container) image.
124
+
125
+ ## Configuration
126
+
127
+ `jointfm-inference serve` takes no options: it reads every setting from `JOINTFM_INFERENCE_*` environment variables, and the `Taskfile` targets load them from `.env`, a git-ignored file that [.env.template](https://github.com/datarobot-oss/joint-inference-python/blob/main/.env.template) documents. The checkpoint is either already at `JOINTFM_INFERENCE_CHECKPOINT_PATH` or downloaded there at startup from `JOINTFM_INFERENCE_CHECKPOINT_URL`. A download needs the file's SHA-256 digest: it streams into a temporary file, is verified, and only then moves into place, and a file already at the path is reused only when its digest matches, so changing the URL never serves the old weights. The service stops cleanly on SIGINT or SIGTERM.
128
+
129
+ | Variable | Default | Meaning |
130
+ | --- | --- | --- |
131
+ | `JOINTFM_INFERENCE_CHECKPOINT_PATH` | required | Checkpoint file to serve, or to download to |
132
+ | `JOINTFM_INFERENCE_CHECKPOINT_VERSION` | first 12 hexadecimal digits of the checkpoint's SHA-256 | Version label `/healthz` reports as `checkpoint_version`; the default changes exactly when the weights do |
133
+ | `JOINTFM_INFERENCE_CHECKPOINT_URL` | unset | `https` or `http` URL to download the checkpoint from when the file is absent |
134
+ | `JOINTFM_INFERENCE_CHECKPOINT_SHA256` | unset | Lowercase hexadecimal SHA-256 of the checkpoint; required with a URL, refused without one |
135
+ | `JOINTFM_INFERENCE_CHECKPOINT_TOKEN` | unset | Bearer token sent with the download; only to an `https` URL |
136
+ | `JOINTFM_INFERENCE_DEVICE` | `cpu` | Torch device the model runs on, such as `cuda:0` |
137
+ | `JOINTFM_INFERENCE_MAP_LOCATION` | the device | Device the checkpoint tensors are first read onto |
138
+ | `JOINTFM_INFERENCE_PRECISION` | `bf16` | Model precision of every forward: `fp32`, `bf16`, or `fp16` |
139
+ | `JOINTFM_INFERENCE_BIND_HOST` | `0.0.0.0` | Address the service listens on |
140
+ | `JOINTFM_INFERENCE_PORT` | `8080` | Port the service listens on |
141
+ | `JOINTFM_INFERENCE_MAX_SAMPLE_COUNT` | `1000` | Largest sample count one request may ask for |
142
+ | `JOINTFM_INFERENCE_MAX_REQUEST_BYTES` | admits a request at every limit of the checkpoint's capacity envelope | Largest request body read, which `/healthz` reports as `max_request_bytes`; a larger one is refused unread with HTTP 413 and `INPUT_SIZE_EXCEEDED`. The default budgets each value at full float64 precision keyed by a column name of up to 64 bytes, so raise it for longer names |
143
+ | `JOINTFM_INFERENCE_MAX_CONCURRENT_REQUESTS` | `1` | Prediction requests run at the same time; raise it only as far as the largest requests fit the device together |
144
+ | `JOINTFM_INFERENCE_MODEL_VERSION` | `jointfm-inference:<version>+ckpt.<checkpoint version>` | Model version `/healthz` reports; a request that names a model version must match it |
145
+
146
+ A connection that sends or accepts no byte for 60 seconds is closed, a stalled request body with HTTP 408, so a stalled client cannot hold a server thread.
147
+
148
+ `jointfm-inference probe --service-url URL` (repeatable) checks each service's health and requests every return mode it advertises; `task probe` probes the local service, and `task probe -- --service-url URL` any others.
149
+
150
+ `jointfm-inference profile` shows where a request's time goes. It loads the checkpoint that the same settings configure into its own process, answers synthetic forecast requests one at a time without HTTP, over a grid of column counts (`--columns`), sample counts (`--samples`), and return modes (`--return-modes`), and prints a Markdown table of median milliseconds per stage: preparation, the network forward (encoder, then pooling and head), the read-out (for samples: Cholesky factorization, Gaussian draws, Gamma draws, and assembly), serialization, and JSON encoding, next to the end-to-end time with the stage timers off. `--output FILE` also writes every timing as JSON, and `task profile -- <options>` runs it from `.env`. Profile on a device no other process uses: a timer waits for all work on its device, so other work there lands in the stages. Library code turns the same timers on with `jointfm_inference.core.timing.set_enabled(True)`.
151
+
152
+ ## HTTP API
153
+
154
+ The service answers `GET /healthz` and `POST /predict`. [openapi.json](https://github.com/datarobot-oss/joint-inference-python/blob/main/src/jointfm_inference/model/service/wire_schema/openapi.json) is their [OpenAPI 3.1](https://spec.openapis.org/oas/v3.1.0) document: every request, response, health, and error field with its type and meaning, and one example request per query mode and return mode. The service's own code generates it, so it cannot drift from what the service accepts and sends: `jointfm-inference schema` writes it, a commit hook rewrites a stale copy and stops the commit until the rewritten one is staged, and the package ships it as data, so every release tag carries the document of the contract that release serves. Its `info.version` is the `schema_version` every prediction request sends.
155
+
156
+ ## Container
157
+
158
+ `task docker:build` builds `jointfm-inference:<project version>` from [container/Dockerfile](https://github.com/datarobot-oss/joint-inference-python/blob/main/container/Dockerfile). The image holds the package and its dependencies, never weights: its command is `jointfm-inference serve`, it listens on port 8080, and it expects the checkpoint at `/models/jointfm.pt` unless `JOINTFM_INFERENCE_CHECKPOINT_PATH` says otherwise. `/models` is a volume, so mount a directory there that holds the checkpoint, or one the container may download it into:
159
+
160
+ ```sh
161
+ docker run --rm -p 8080:8080 -v "$PWD/models:/models" jointfm-inference:<version>
162
+ ```
163
+
164
+ `task docker:run` does this from `.env`: it passes every `JOINTFM_INFERENCE_*` setting on to the container, mounts the directory of `JOINTFM_INFERENCE_CHECKPOINT_PATH` at `/models`, runs as the calling user so a downloaded file belongs to them, and publishes the container's port 8080 at `.env`'s bind host and port. Options after `--` reach `docker run`, such as `task docker:run -- --gpus all` together with `JOINTFM_INFERENCE_DEVICE=cuda`.
165
+
166
+ ## Releases
167
+
168
+ A release is a tagged version of this repository, uploaded to [PyPI](https://pypi.org/project/jointfm-inference/). Cutting one adds a commit `bump: version <old> → <new>` to `main` that sets `version` in [pyproject.toml](https://github.com/datarobot-oss/joint-inference-python/blob/main/pyproject.toml) and `uv.lock` and adds the new version's entries to `CHANGELOG.md`, and tags that commit `v<new>`. Pushing the tag runs the [Publish to PyPI](https://github.com/datarobot-oss/joint-inference-python/blob/main/.github/workflows/publish.yml) workflow. It uploads the release only after `task build` has built the distribution, installed its wheel into a fresh environment without `uv.lock`, as `pip` would for a user, served a test checkpoint from it, and probed every return mode, and only when the tag names the version it built. The tag, the wheel, and the PyPI version therefore always agree, and a wheel that lacks a module or a dependency never reaches PyPI. No container image is pushed. Install a release with `pip install jointfm-inference==<version>`.
169
+
170
+ The workflow authenticates through PyPI's [trusted publishing](https://docs.pypi.org/trusted-publishers/), so the repository stores no PyPI token. It needs two settings outside the repository, made once by an owner of the PyPI project and an administrator of the repository:
171
+
172
+ - a trusted publisher of the PyPI project `jointfm-inference` for owner `datarobot-oss`, repository `joint-inference-python`, workflow `publish.yml`, and environment `pypi`; before the first upload, a [pending publisher](https://docs.pypi.org/trusted-publishers/creating-a-project-through-oidc/) creates the project;
173
+ - a GitHub Actions environment named `pypi` on the repository, which may require a reviewer to approve each upload.
174
+
175
+ ### Version numbers
176
+
177
+ [Commitizen](https://commitizen-tools.github.io/commitizen/) picks the next [Semantic Versioning](https://semver.org/spec/v2.0.0.html) number from the [Conventional Commit](https://www.conventionalcommits.org/) subjects on `main` since the last `v*` tag. Pull requests are squash-merged with their title as the commit subject, so the title decides the bump:
178
+
179
+ | Commit | Bump |
180
+ | --- | --- |
181
+ | `feat:` | minor |
182
+ | `fix:`, `perf:`, `refactor:` | patch |
183
+ | breaking change: `feat!:`, `fix!:`, or a `BREAKING CHANGE:` footer | major, but minor while the version is `0.x` |
184
+ | any other type (`docs:`, `build:`, `chore:`, `ci:`, `test:`), or not a Conventional Commit | none, and left out of `CHANGELOG.md` |
185
+
186
+ A release whose commits drive no bump, such as dependency updates alone, goes out as a patch. `task release -- --increment minor` (or `major`, `patch`) overrides the inferred bump. `cz bump` owns the `version` in `pyproject.toml`; never edit it by hand.
187
+
188
+ ### Cutting a release
189
+
190
+ Maintainers release from an up-to-date `main` checkout set up with `task setup`, with docker running:
191
+
192
+ ```sh
193
+ task release:dry # preview the next version and its CHANGELOG entries; changes nothing
194
+ task release # commit the bump and tag it, locally
195
+ task release:publish # push main and the new tag to origin
196
+ ```
197
+
198
+ `task release` first checks that the tag of the current version exists, the working tree is clean, the branch is `main`, `main` matches `origin/main` after a fetch, and `main` has commits since that tag; any failure stops it before a file changes. It then runs `cz bump`, which writes the new `CHANGELOG.md` section, sets the version in `pyproject.toml`, runs `uv lock` so `uv.lock` records it, commits the three files, and creates the tag. That commit runs the commit hooks like any other, including the license header hook (hence docker) and the full test suite with its coverage floor. When a hook fails there is no commit and no tag, but the three files stay changed and staged; discard those changes before trying again.
199
+
200
+ Nothing has left the machine at this point. Inspect the commit with `git show`; to cut a different version, drop the tag and the commit (`git tag -d v<new>`, then `git reset --hard origin/main`) and run `task release` again.
201
+
202
+ `task release:publish` checks again that the tree is clean on `main`, that the tag of the version in `pyproject.toml` points at `HEAD`, and that `origin` does not have that tag yet, since a published tag never moves. It lists the commits it will push, asks for confirmation when run from a terminal, and pushes `main` first, then that one tag. The push to `main` starts the workflows every push to `main` runs; the tag starts Publish to PyPI.
203
+
204
+ - The release commit goes to `main` directly, while the repository's rules require pull-request review and passing status checks for `main`. GitHub accepts the push only from an account that may bypass those rules.
205
+ - When a pull request merged into `main` after `task release`, the push of `main` is rejected as not a fast-forward and nothing is pushed. Drop the tag and the commit as above and cut the release again; rebasing would move the release commit away from its tag, which `task release:publish` refuses.
206
+ - When `main` was pushed but the tag push failed, run `task release:publish` again: the checks still pass and only the tag is left to push.
207
+ - When Publish to PyPI fails, the tag is published but the version is not on PyPI. Rerun the workflow once a failing setting outside the repository is fixed; when the distribution itself must change, cut a new release, because a published tag never moves.
208
+
209
+ Commitizen bumps from the tag that matches the version in `pyproject.toml`. Before the first release that tag does not exist yet, so every release task stops and prints the `git tag` command that seeds it on the commit that set the version.
210
+
211
+ ## Contributing
212
+
213
+ [CONTRIBUTING.md](https://github.com/datarobot-oss/joint-inference-python/blob/main/CONTRIBUTING.md) covers the development setup, every `task` target, the package layout, the checkpoint format, and the checks that keep this public repository free of private material. Rules for contributors and coding agents are in [AGENTS.md](https://github.com/datarobot-oss/joint-inference-python/blob/main/AGENTS.md).
214
+
215
+ ## License
216
+
217
+ Licensed under the [Apache License, Version 2.0](https://github.com/datarobot-oss/joint-inference-python/blob/main/LICENSE).