Skip to main content

TiRex emoji TiRex-2: Generalizing TiRex to Multivariate Data and Streaming

Paper Hugging Face PyPI PyPI Downloads Docker License docs Tests pre-commit Open in Colab TiRex-2 Demo

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 PRO: This repository is our open-source release. TiRex-2 PRO extends it with dedicated support, streaming, hardware-optimized inference (edge, embedded, and industrial PCs, among others), fine-tuning, and classification & regression support — see TiRex-2 PRO below or contact us at contact@nx-ai.com.

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, built on a recurrent architecture designed for efficient streaming settings — all zero-shot, with no task-specific training or fine-tuning.

TiRex-2 generalizes our original univariate model, TiRex, to multivariate forecasting with past and future covariates.

Key facts

  • Zero-shot multivariate forecasting: TiRex-2 forecasts multiple target variates out of the box, without training or fine-tuning on your 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]"

The Python package installation is currently only tested on Linux and macOS. Docker usage is documented separately and includes Linux, macOS, and Windows Docker Desktop instructions.

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 (Linux/macOS):

# install Pixi
curl -fsSL https://pixi.sh/install.sh | sh
# install dependencies for TiRex-2
pixi install

Pixi selects a compatible platform automatically (PyTorch w/ CUDA 13.0 for Linux/Windows, PyTorch w/ default for macOS), or you can choose one explicitly, for example -p linux-64-cuda-126. Both environments and platforms are defined in pyproject.toml.

FAQ

How do I run TiRex-2 on CUDA?

With device="cuda", TiRex-2 builds its fused sLSTM kernel (FlashRNN) with nvcc on the first forecast. In order to run TiRex-2 on CUDA you need:

  1. A CUDA Toolkit installed and discoverable — nvcc must be on PATH or reachable via CUDA_HOME.
  2. A CUDA Toolkit whose major version matches your PyTorch build — any 12.x toolkit for a cu12x torch wheel, any 13.x toolkit for a cu13x one. Check with python -c "import torch; print(torch.version.cuda)".
  3. A CUDA Toolkit no newer than your driver supports.
Which NVIDIA GPU architectures does TiRex-2 support?
  • TiRex-2 runs on NVIDIA GPUs with compute capability 8.0 (Ampere) or newer.
  • Older cards — Turing (7.5), Volta (7.0) and earlier — cannot run device="cuda"; use device="cpu" instead.
Why does TiRex-2 fail with where cl on Windows?

PyTorch may compile model components at runtime, so the Python process needs access to the MSVC C++ compiler, even when using device="cpu".

Install Visual Studio Build Tools with Desktop development with C++, then run TiRex-2 from an x64 Native Tools Command Prompt for Visual Studio. Confirm the compiler is available before starting your script:

where cl
python your_script.py

Launch VS Code or Jupyter from the same prompt so it inherits the compiler environment. See #15 and #17 for related reports.

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

Minimal usage predicting a simple sine wave

import torch
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
fig = plot_multivariate(ts, forecast, engine="matplotlib")
fig.show()

output of plot_multivariate function visualizing context and forecast

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, plot_demo_forecast

# load model
model = load_model("NX-AI/TiRex-2", device="cpu")  # use `device="cuda"` if cuda is available

# load data
demo = Demo.create_nonstationary_demo()
ts_univariate = demo.to_timeseries_type(include_covariates=False)
ts_multivariate = demo.to_timeseries_type(include_covariates=True)

# perform forecast - each forecast is of shape (n_targets, 9 quantiles, prediction_length)
forecasts = model.forecast(
    timeseries=[ts_univariate, ts_multivariate],
    prediction_length=demo.horizon,
    output_type="numpy",
)

# visualize result
fig = plot_demo_forecast(demo, *forecasts, engine="matplotlib")
fig.show()

output of plot_multivariate function visualizing context and forecast of multivariate input

Benchmarking

To reproduce our results for the GIFT-Eval and fev-bench leaderboards, follow the instructions in /examples/gifteval/ and /examples/fevbench/, respectively.

TiRex Docker image

For detailed instructions on building and running TiRex-2 in a Docker container, see the Docker README.

TiRex-2 PRO

TiRex-2 already provides state-of-the-art performance for zero-shot prediction, so you can use this open-source release without training on your own data.

TiRex-2 PRO extends this open-source release with:

  • Support: dedicated support and engagement from NXAI.
  • Streaming: incremental forecast updates as new observations arrive, without recomputing forecasts over the full history.
  • Speed: optimized inference, including hardware-specific optimizations for edge, embedded, and industrial PC deployments.
  • Fine-tuning: models adapted to your data or pretrained on different datasets for improved performance.
  • Classification & Regression: TiRex-2 adapted for classification and regression tasks.

See the full feature comparison in the docs, or contact us at contact@nx-ai.com.

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},
}

License

TiRex-2 is licensed under the Apache License 2.0.

Metadata

Release files for tirex-2 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tirex-2 0.3.0
File Size Uploaded
tirex_2-0.3.0.tar.gz 82.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tirex-2 0.3.0
File Interpreter ABI Platform
tirex_2-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 153.8 kB

Release files / tirex_2-0.3.0.tar.gz

Download URL tirex_2-0.3.0.tar.gz
Size 82.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5c795c4dbaf67d8bc94934dff6936b2cc4620eca0220a8b29068c6f2d0351fe8
BLAKE2b-256 checksum
How to use checksums
4dc577623de5227ab5e56bba4867faf5b29f9113e60020abf92b36eec85802b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release files / tirex_2-0.3.0-py3-none-any.whl

Download URL tirex_2-0.3.0-py3-none-any.whl
Size 71.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7997975a5f87feeb10ba06262c628ce2ebc1ae327ae37fa8d5892909e7e59a48
BLAKE2b-256 checksum
How to use checksums
34fcd69c218b8a5c54fa9a380af9dea943e6b4791a75f2aa60c22372ce8f624c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page