TiRex-2 time series forecasting inference
Project description
TiRex-2: Generalizing TiRex to Multivariate Data and Streaming
This repository provides the pre-trained multivariate forecasting model TiRex-2 introduced in the paper TiRex-2: Generalizing TiRex to Multivariate Data and Streaming.
TiRex-2
TiRex-2 is a pretrained time series foundation model that forecasts one or many target variates directly from their history, optionally conditioned on past and future-known covariates. A single checkpoint serves both univariate and multivariate forecasting and operates in a streaming fashion as new observations arrive — all zero-shot, with no task-specific training or fine-tuning.
Key facts
-
Zero-shot multivariate forecasting: TiRex-2 forecasts multiple target variates out of the box, without training or fine-tuning on you data.
-
Past and future-known covariates: TiRex-2 natively conditions on past covariates and future-known covariates, such as calendar features, holidays, promotions, or scheduled interventions.
-
Small active footprint: TiRex-2 activates 38.4M parameters in univariate mode and an additional 44.1M parameters for multivariate forecasting.
Installation
Via Pip
pip install tirex-2
Install with additional dependencies:
pip install "tirex-2[examples,fev,gluonts]"
TiRex is currently only tested on Linux and MacOS.
Via Pixi
We use Pixi for our development and benchmarking environment to ensure that it is set up correctly. Run the following command to install it on your machine:
curl -fsSL https://pixi.sh/install.sh | sh
Getting started
The most easy way for you to get started is by checking out our "Getting Started" notebook. Moreover, you can jump straight into testing out TiRex using Google Colab. If you have cloned this repository, you can also easily start the notebook via Pixi by running:
pixi run notebook
Note that for pixi, depending on your CUDA version and use-case, you may need to use another environment, e.g., -e example-cu128, that are defined in pyproject.toml under section tool.pixi.environments.
Minimal usage predicting a simple sine wave
from tirex2 import TimeseriesType, load_model
from tirex2.plotting import plot_multivariate # requires matplotlib to be installed
# load model
model = load_model("NX-AI/TiRex-2", device="cpu") # use `device="cuda"` if cuda is available
# generate data - target expects time series of shape (n_targets, context_length)
context = torch.sin(torch.arange(128).float() / 8)
ts = TimeseriesType(target=context.unsqueeze(0), past_covariates=None, future_covariates=None)
# perform forecast - each forecast is of shape (n_targets, 9 quantiles, prediction_length)
forecast = model.forecast([ts], prediction_length=32, output_type="numpy")[0]
# visualize result
_ = plot_multivariate(ts, forecast, engine="matplotlib")
Covariate example
This example originates from the "Getting Started" notebook, showing the value of additional covariates.
from tirex2 import load_model
from tirex2.demo import Demo
from tirex2.plotting import plot_multivariate
# load model
model = load_model("NX-AI/TiRex-2", device="cpu") # use `device="cuda"` if cuda is available
# load data
demo_nonstationary = Demo.create_nonstationary_demo()
ts = demo_nonstationary.to_timeseries_type()
# perform forecast - each forecast is of shape (n_targets, 9 quantiles, prediction_length)
forecast = model.forecast([ts], prediction_length=demo_nonstationary.horizon, output_type="numpy")[0]
# visualize result
_ = plot_multivariate(ts, forecast, engine="matplotlib")
Benchmarking
To reproduce our results for the GIFT-Eval and fev-bench leaderboards, follow the instructions in /examples/gifteval/ and /examples/fevbench/, respectively.
Cite
If you use TiRex in your research, please cite our work:
@misc{podest2026tirex2generalizingtirexmultivariate,
title={TiRex-2: Generalizing TiRex to Multivariate Data and Streaming},
author={Patrick Podest and Marco Pichler and Elias Bürger and Levente Zólyomi and Bernhard Voggenberger and Wilhelm Berghammer and Daniel Klotz and Sebastian Böck and Günter Klambauer and Sepp Hochreiter},
year={2026},
eprint={2607.01204},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2607.01204},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tirex_2-0.1.1.tar.gz.
File metadata
- Download URL: tirex_2-0.1.1.tar.gz
- Upload date:
- Size: 61.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc82b6e0698b9828888cd6e5037717dba8e107320116725061824308e10fbeb2
|
|
| MD5 |
f46ce826a8aacde5006e72f2b453ff9b
|
|
| BLAKE2b-256 |
b32034a0a32c9e7598f8f3d723ca1d53f1c2735789a75ee430b106a9a8bece52
|
Provenance
The following attestation bundles were made for tirex_2-0.1.1.tar.gz:
Publisher:
publish.yaml on NX-AI/tirex-2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tirex_2-0.1.1.tar.gz -
Subject digest:
bc82b6e0698b9828888cd6e5037717dba8e107320116725061824308e10fbeb2 - Sigstore transparency entry: 2046728503
- Sigstore integration time:
-
Permalink:
NX-AI/tirex-2@abdf2898162482cc5c862905a406fc1134fbae67 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/NX-AI
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@abdf2898162482cc5c862905a406fc1134fbae67 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tirex_2-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tirex_2-0.1.1-py3-none-any.whl
- Upload date:
- Size: 58.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d9f0ead93662d4438371ef0bb3b6319dc4811ba9d17fe343c8fa8f456b1730b
|
|
| MD5 |
557ab113057cb012e3cf6ff690f7ab55
|
|
| BLAKE2b-256 |
28915068f34a4e8862fcc519c7f2768226dc5b4e1a84211511b2c6940dad98d6
|
Provenance
The following attestation bundles were made for tirex_2-0.1.1-py3-none-any.whl:
Publisher:
publish.yaml on NX-AI/tirex-2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tirex_2-0.1.1-py3-none-any.whl -
Subject digest:
1d9f0ead93662d4438371ef0bb3b6319dc4811ba9d17fe343c8fa8f456b1730b - Sigstore transparency entry: 2046728534
- Sigstore integration time:
-
Permalink:
NX-AI/tirex-2@abdf2898162482cc5c862905a406fc1134fbae67 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/NX-AI
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@abdf2898162482cc5c862905a406fc1134fbae67 -
Trigger Event:
release
-
Statement type: