tfc-t0 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.
@@ -0,0 +1,19 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ smoke:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
13
+ - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
14
+ - name: Install
15
+ run: uv sync
16
+ - name: Lint
17
+ run: uv run ruff check .
18
+ - name: Import smoke
19
+ run: uv run python -c "from t0 import T0Config, T0Forecaster; print(T0Config.medium())"
@@ -0,0 +1,19 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ jobs:
8
+ pypi:
9
+ runs-on: ubuntu-latest
10
+ environment: pypi
11
+ permissions:
12
+ id-token: write
13
+ steps:
14
+ - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
15
+ - uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5
16
+ - name: Build wheel + sdist
17
+ run: uv build
18
+ - name: Publish to PyPI
19
+ uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
@@ -0,0 +1,8 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ dist/
5
+ build/
6
+ *.egg-info/
7
+ .ruff_cache/
8
+ .pytest_cache/
tfc_t0-0.1.0/LICENSE ADDED
@@ -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 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
+ Copyright 2026 The Forecasting Company
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.
tfc_t0-0.1.0/NOTICE ADDED
@@ -0,0 +1,11 @@
1
+ T0 (tfc-t0)
2
+ Copyright 2026 The Forecasting Company
3
+
4
+ This product includes software developed at Datadog (https://www.datadoghq.com/),
5
+ Copyright 2025 Datadog, Inc., licensed under the Apache License 2.0.
6
+ Source: https://github.com/DataDog/toto
7
+
8
+ This product includes software derived from Chronos-2 by Amazon.com, Inc. or
9
+ its affiliates, Copyright Amazon.com, Inc. All Rights Reserved, licensed under
10
+ the Apache License 2.0.
11
+ Source: https://github.com/amazon-science/chronos-forecasting
tfc_t0-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,180 @@
1
+ Metadata-Version: 2.4
2
+ Name: tfc-t0
3
+ Version: 0.1.0
4
+ Summary: Open-weights time-series forecasting foundation model from The Forecasting Company
5
+ Project-URL: Homepage, https://huggingface.co/theforecastingcompany/t0-alpha
6
+ Project-URL: Source, https://github.com/theforecastingcompany/tfc-t0
7
+ Project-URL: Issues, https://github.com/theforecastingcompany/tfc-t0/issues
8
+ Project-URL: Documentation, https://huggingface.co/theforecastingcompany/t0-alpha
9
+ Author: The Forecasting Company
10
+ License: Apache-2.0
11
+ License-File: LICENSE
12
+ License-File: NOTICE
13
+ Keywords: forecasting,foundation-model,huggingface,probabilistic-forecasting,time-series,transformer
14
+ Classifier: Development Status :: 4 - Beta
15
+ Classifier: Intended Audience :: Science/Research
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.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: <3.14,>=3.11
26
+ Requires-Dist: einops<1,>=0.8
27
+ Requires-Dist: huggingface-hub<1,>=0.26
28
+ Requires-Dist: jaxtyping<1,>=0.3
29
+ Requires-Dist: numpy<3,>=1.26
30
+ Requires-Dist: rotary-embedding-torch<0.9,>=0.8
31
+ Requires-Dist: safetensors<1,>=0.4
32
+ Requires-Dist: torch<3,>=2.4
33
+ Provides-Extra: evaluation
34
+ Requires-Dist: gluonts<0.17,>=0.15; extra == 'evaluation'
35
+ Requires-Dist: tqdm>=4.66; extra == 'evaluation'
36
+ Provides-Extra: plot
37
+ Requires-Dist: matplotlib<4,>=3.8; extra == 'plot'
38
+ Description-Content-Type: text/markdown
39
+
40
+ <p align="center">
41
+ <img src="https://www.theforecastingcompany.com/logo/logo_horizontal_pride_dark.png" alt="The Forecasting Company" width="280" />
42
+ </p>
43
+
44
+ # `t0`
45
+
46
+ Open-weights time-series forecasting foundation model from [The Forecasting Company](https://theforecastingcompany.com/).
47
+ `t0` is a transformer-based model that
48
+ produces probabilistic multi-horizon forecasts and natively operates on
49
+ multiple covariates. `t0-alpha` is our first iteration of the model.
50
+
51
+ You can use `t0` on [Retrocast](https://app.retrocast.com/), our platform for forecasting on your own data. You can also compare forecast across different open-weight models.
52
+
53
+ ![t0 forecasting French national electricity demand in Retrocast](https://huggingface.co/theforecastingcompany/t0-alpha/resolve/main/assets/enedis_with_holidays.png)
54
+
55
+ _`t0` forecasting French national electricity demand in Retrocast. Data:
56
+ [Enedis open data](https://data.enedis.fr/)._
57
+
58
+ ## 📈 Forecasting with covariates
59
+
60
+ `t0` leverages covariate information, in the past and future when
61
+ available, to improve its forecast.
62
+
63
+ | Without covariates | With covariates |
64
+ | ----------------------------------------------------------------- | ----------------------------------------------------------- |
65
+ | ![t0 forecast without covariates](https://huggingface.co/theforecastingcompany/t0-alpha/resolve/main/assets/medicam_without_cov.png) | ![t0 forecast with covariates](https://huggingface.co/theforecastingcompany/t0-alpha/resolve/main/assets/medicam_with_cov.png) |
66
+
67
+ _Data: [Medic'AM](https://www.assurance-maladie.ameli.fr/etudes-et-donnees/medicaments-classe-atc-medicam),
68
+ monthly drug reimbursements from the French national health insurance._
69
+
70
+ The [Quickstart](#-quickstart) below shows the API for both a plain
71
+ univariate forecast and a multivariate forecast that conditions on
72
+ historical and known-future covariates.
73
+
74
+ ## 🚀 Quickstart
75
+
76
+ ```bash
77
+ pip install tfc-t0
78
+ ```
79
+
80
+ The simplest path is a univariate forecast through `predict`:
81
+
82
+ ```python
83
+ import torch
84
+ from t0 import T0Forecaster
85
+
86
+ model = T0Forecaster.from_pretrained("theforecastingcompany/t0-alpha").eval()
87
+
88
+ context = torch.randn(4, 512) # 4 series, 512 past timesteps
89
+ out = model.predict(context, horizon=64, quantiles=[0.1, 0.5, 0.9])
90
+ out.quantiles # (4, 64, 3)
91
+ out.median # (4, 64)
92
+ ```
93
+
94
+ `predict` accepts `numpy` arrays. 1-D contexts are auto-promoted to a
95
+ single-row batch. NaN values in the context are treated as missing
96
+ observations.
97
+
98
+ ### Forecasting with covariates
99
+
100
+ Anything you know over the **past** goes in `context` — alongside the
101
+ target, extra variates attend to it and are forecast together. Anything
102
+ you know over the **future** (calendar features, planned promotions,
103
+ weather forecasts) goes in `future_covariates`, shaped
104
+ `[B, F, context + horizon]`; the model conditions on it but does not
105
+ forecast it.
106
+
107
+ ```python
108
+ import torch
109
+ from t0 import T0Forecaster
110
+
111
+ model = T0Forecaster.from_pretrained("theforecastingcompany/t0-alpha").eval()
112
+
113
+ context = torch.randn(2, 512) # 2 series, 512 past timesteps
114
+ future_covariates = torch.randn(2, 3, 512 + 64) # 3 covariates known over context + horizon
115
+
116
+ out = model.predict(
117
+ context,
118
+ horizon=64,
119
+ quantiles=[0.1, 0.5, 0.9],
120
+ future_covariates=future_covariates,
121
+ )
122
+ out.quantiles # (2, 64, 3)
123
+ out.median # (2, 64)
124
+ ```
125
+
126
+ ## 🏗️ Architecture
127
+
128
+ `t0` is a decoder-style patch transformer that alternates time and
129
+ covariate attention layers. It predicts 5 quantiles (0.1, 0.25, 0.5,
130
+ 0.75, 0.9), decoding multiple horizons in parallel — up to 1024
131
+ timesteps in one forward pass — and falling back on autoregressive
132
+ rollout for longer horizons.
133
+
134
+ | | |
135
+ | --------------- | ------------------------- |
136
+ | Parameters | ~102M |
137
+ | Layers | 24 |
138
+ | Embedding dim | 512 |
139
+ | Feedforward dim | 2048 |
140
+ | Attention heads | 8 |
141
+ | Patch size | 32 |
142
+ | Quantile levels | 0.1, 0.25, 0.5, 0.75, 0.9 |
143
+
144
+ ### 🧬 Lineage
145
+
146
+ `t0` builds on ideas — and in places, code — from open-source forecasting
147
+ models. We gratefully acknowledge:
148
+
149
+ - **Toto** by Datadog ([repo](https://github.com/DataDog/toto)) &
150
+ **Chronos-2** by Amazon
151
+ ([repo](https://github.com/amazon-science/chronos-forecasting)) —
152
+ factorizing attention in the time and variates dimension.
153
+ - **TiRex** by NXAI
154
+ ([repo](https://github.com/NX-AI/tirex)) — contiguous patch masking.
155
+
156
+ Code-level attributions are listed in [`NOTICE`](NOTICE), all under
157
+ Apache-2.0.
158
+
159
+ ## 🧰 Public API
160
+
161
+ - `T0Forecaster` — `nn.Module` with `from_pretrained` /
162
+ `save_pretrained` (via `huggingface_hub.PyTorchModelHubMixin`) and the
163
+ user-facing `predict(context, horizon, quantiles, future_covariates)`.
164
+ - `T0Config` — frozen dataclass; `T0Config.medium()` is the published
165
+ configuration.
166
+
167
+ ## 📚 Citation
168
+
169
+ ```bibtex
170
+ @misc{tfc-t0,
171
+ title = {t0: A time-series forecasting foundation model},
172
+ author = {The Forecasting Company},
173
+ year = {2026},
174
+ url = {https://huggingface.co/theforecastingcompany/t0-alpha},
175
+ }
176
+ ```
177
+
178
+ ## ⚖️ License
179
+
180
+ Apache-2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE).
tfc_t0-0.1.0/README.md ADDED
@@ -0,0 +1,141 @@
1
+ <p align="center">
2
+ <img src="https://www.theforecastingcompany.com/logo/logo_horizontal_pride_dark.png" alt="The Forecasting Company" width="280" />
3
+ </p>
4
+
5
+ # `t0`
6
+
7
+ Open-weights time-series forecasting foundation model from [The Forecasting Company](https://theforecastingcompany.com/).
8
+ `t0` is a transformer-based model that
9
+ produces probabilistic multi-horizon forecasts and natively operates on
10
+ multiple covariates. `t0-alpha` is our first iteration of the model.
11
+
12
+ You can use `t0` on [Retrocast](https://app.retrocast.com/), our platform for forecasting on your own data. You can also compare forecast across different open-weight models.
13
+
14
+ ![t0 forecasting French national electricity demand in Retrocast](https://huggingface.co/theforecastingcompany/t0-alpha/resolve/main/assets/enedis_with_holidays.png)
15
+
16
+ _`t0` forecasting French national electricity demand in Retrocast. Data:
17
+ [Enedis open data](https://data.enedis.fr/)._
18
+
19
+ ## 📈 Forecasting with covariates
20
+
21
+ `t0` leverages covariate information, in the past and future when
22
+ available, to improve its forecast.
23
+
24
+ | Without covariates | With covariates |
25
+ | ----------------------------------------------------------------- | ----------------------------------------------------------- |
26
+ | ![t0 forecast without covariates](https://huggingface.co/theforecastingcompany/t0-alpha/resolve/main/assets/medicam_without_cov.png) | ![t0 forecast with covariates](https://huggingface.co/theforecastingcompany/t0-alpha/resolve/main/assets/medicam_with_cov.png) |
27
+
28
+ _Data: [Medic'AM](https://www.assurance-maladie.ameli.fr/etudes-et-donnees/medicaments-classe-atc-medicam),
29
+ monthly drug reimbursements from the French national health insurance._
30
+
31
+ The [Quickstart](#-quickstart) below shows the API for both a plain
32
+ univariate forecast and a multivariate forecast that conditions on
33
+ historical and known-future covariates.
34
+
35
+ ## 🚀 Quickstart
36
+
37
+ ```bash
38
+ pip install tfc-t0
39
+ ```
40
+
41
+ The simplest path is a univariate forecast through `predict`:
42
+
43
+ ```python
44
+ import torch
45
+ from t0 import T0Forecaster
46
+
47
+ model = T0Forecaster.from_pretrained("theforecastingcompany/t0-alpha").eval()
48
+
49
+ context = torch.randn(4, 512) # 4 series, 512 past timesteps
50
+ out = model.predict(context, horizon=64, quantiles=[0.1, 0.5, 0.9])
51
+ out.quantiles # (4, 64, 3)
52
+ out.median # (4, 64)
53
+ ```
54
+
55
+ `predict` accepts `numpy` arrays. 1-D contexts are auto-promoted to a
56
+ single-row batch. NaN values in the context are treated as missing
57
+ observations.
58
+
59
+ ### Forecasting with covariates
60
+
61
+ Anything you know over the **past** goes in `context` — alongside the
62
+ target, extra variates attend to it and are forecast together. Anything
63
+ you know over the **future** (calendar features, planned promotions,
64
+ weather forecasts) goes in `future_covariates`, shaped
65
+ `[B, F, context + horizon]`; the model conditions on it but does not
66
+ forecast it.
67
+
68
+ ```python
69
+ import torch
70
+ from t0 import T0Forecaster
71
+
72
+ model = T0Forecaster.from_pretrained("theforecastingcompany/t0-alpha").eval()
73
+
74
+ context = torch.randn(2, 512) # 2 series, 512 past timesteps
75
+ future_covariates = torch.randn(2, 3, 512 + 64) # 3 covariates known over context + horizon
76
+
77
+ out = model.predict(
78
+ context,
79
+ horizon=64,
80
+ quantiles=[0.1, 0.5, 0.9],
81
+ future_covariates=future_covariates,
82
+ )
83
+ out.quantiles # (2, 64, 3)
84
+ out.median # (2, 64)
85
+ ```
86
+
87
+ ## 🏗️ Architecture
88
+
89
+ `t0` is a decoder-style patch transformer that alternates time and
90
+ covariate attention layers. It predicts 5 quantiles (0.1, 0.25, 0.5,
91
+ 0.75, 0.9), decoding multiple horizons in parallel — up to 1024
92
+ timesteps in one forward pass — and falling back on autoregressive
93
+ rollout for longer horizons.
94
+
95
+ | | |
96
+ | --------------- | ------------------------- |
97
+ | Parameters | ~102M |
98
+ | Layers | 24 |
99
+ | Embedding dim | 512 |
100
+ | Feedforward dim | 2048 |
101
+ | Attention heads | 8 |
102
+ | Patch size | 32 |
103
+ | Quantile levels | 0.1, 0.25, 0.5, 0.75, 0.9 |
104
+
105
+ ### 🧬 Lineage
106
+
107
+ `t0` builds on ideas — and in places, code — from open-source forecasting
108
+ models. We gratefully acknowledge:
109
+
110
+ - **Toto** by Datadog ([repo](https://github.com/DataDog/toto)) &
111
+ **Chronos-2** by Amazon
112
+ ([repo](https://github.com/amazon-science/chronos-forecasting)) —
113
+ factorizing attention in the time and variates dimension.
114
+ - **TiRex** by NXAI
115
+ ([repo](https://github.com/NX-AI/tirex)) — contiguous patch masking.
116
+
117
+ Code-level attributions are listed in [`NOTICE`](NOTICE), all under
118
+ Apache-2.0.
119
+
120
+ ## 🧰 Public API
121
+
122
+ - `T0Forecaster` — `nn.Module` with `from_pretrained` /
123
+ `save_pretrained` (via `huggingface_hub.PyTorchModelHubMixin`) and the
124
+ user-facing `predict(context, horizon, quantiles, future_covariates)`.
125
+ - `T0Config` — frozen dataclass; `T0Config.medium()` is the published
126
+ configuration.
127
+
128
+ ## 📚 Citation
129
+
130
+ ```bibtex
131
+ @misc{tfc-t0,
132
+ title = {t0: A time-series forecasting foundation model},
133
+ author = {The Forecasting Company},
134
+ year = {2026},
135
+ url = {https://huggingface.co/theforecastingcompany/t0-alpha},
136
+ }
137
+ ```
138
+
139
+ ## ⚖️ License
140
+
141
+ Apache-2.0 — see [LICENSE](LICENSE) and [NOTICE](NOTICE).