Self-hosted service
thuml/Time-Series-Library avatar
thuml/Time-Series-Library

Time Series Library (TSLib): Deep Learning Benchmark for Time Series Analysis

A Library for Advanced Deep Time Series Models for General Time Series Analysis.

12,923 stars2,008 forksPythonMIT

At a glance

What is it?
TSLib is an open-source Python library from Tsinghua University's THUML lab that provides a standardized benchmark environment for evaluating deep learning models on five time series tasks: long-term forecasting, short-term forecasting, imputation, anomaly detection, and classification. In April 2026, the maintainers announced they will no longer actively add new features.
Who is it for?
TSLib is the right tool for researchers who need a reproducible baseline environment to evaluate their own time series model against published work, or who want to run the existing models on their own datasets without reimplementing them. It is not the right choice for production deployments or for teams that need ongoing feature additions: the maintainers stated in April 2026 that they will no longer actively add new features and recommended seeking newer benchmarks.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 165 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 30, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What TSLib Is Built For

TSLib provides a controlled environment for evaluating deep learning models on time series data. The library covers five tasks: long-term forecasting, short-term forecasting, imputation, anomaly detection, and classification. Each task has a corresponding experiment script, dataset loaders in `data_provider/`, and model implementations in `models/`.

The target users are deep learning researchers who want to compare a new model against established baselines on standard benchmarks, and practitioners who want to apply existing models from the library to their own datasets. The README describes the library as extended from the THUML lab's earlier Autoformer repository, which it replaces as the group's main benchmark platform.

Models in the Library and the Leaderboard

TSLib contains implementations of a large number of time series models. The models directory includes iTransformer, TimeMixer, TimeXer, PatchTST, DLinear, FEDformer, Autoformer, Informer, TimesNet, and a Mamba implementation contributed by a community member.

The README includes a leaderboard based on results as of March 2024. For long-term forecasting with a look-back window of 96, TimeXer ranks first. For long-term forecasting with look-back length searching, TimeMixer ranks first. For short-term forecasting, imputation, classification, and anomaly detection, TimesNet holds the top position across all four tasks.

The maintainers noted in a 2024 update that they split long-term forecasting into two leaderboard categories (Look-Back-96 and Look-Back-Searching) after observing inconsistent look-back length choices in the literature. The leaderboard was last updated in March 2024.

Installing and Running TSLib with Docker

The recommended installation path is Docker. The Dockerfile uses the `pytorch/pytorch:2.5.1-cuda12.1-cudnn9-devel` base image. It installs `mamba_ssm` separately for the Mamba model and `uni2ts` with `--no-deps` for the Moirai model.

Build and start the container with Docker Compose:

bash
docker compose up -d

The `docker-compose.yml` sets `NVIDIA_VISIBLE_DEVICES=all` and `NVIDIA_DRIVER_CAPABILITIES=compute,utility`, and allocates 8 GB of shared memory (`shm_size: 8gb`). A workspace volume is mounted at `/workspace`. The working directory inside the container is `/workspace`.

For local installation without Docker, the `requirements.txt` pins specific versions of all dependencies including `numpy==2.1.2`, `scipy==1.16.3`, `scikit-learn==1.7.2`, `pandas==2.3.3`, `transformers==4.57.3`, `lightning==2.6.0`, and the `chronos-forecasting`, `timesfm`, and `tirex-ts` packages for large time series model evaluation. The pinned versions mean that running TSLib in an environment with other Python packages may produce dependency conflicts.

Zero-Shot Forecasting and Large Time Series Models

In November 2025, TSLib added a zero-shot forecasting feature to support evaluation of Large Time Series Models (LTSMs). The experiment script is at `exp/exp_zero_shot_forecasting.py` and a sample shell script for LTSM evaluation is at `scripts/long_term_forecast/ETT_script/LTSM.sh`.

This feature is separate from the standard supervised benchmarks. It allows researchers to evaluate whether a pre-trained large model can forecast on a new dataset without fine-tuning. The README also references the THUML lab's separate OpenLTM repository, which provides a pretrain-finetuning paradigm distinct from TSLib's benchmark approach. Researchers interested in large time series models may find it worth examining both repositories.

A tutorial notebook for TimesNet is at `tutorial/TimesNet_tutorial.ipynb`, which the README describes as friendly to beginners of deep time series analysis.

Limitations and When to Use Something Else

The most significant constraint is the one the maintainers stated directly. In April 2026, they announced that due to limited bandwidth they will no longer actively add new features. They also noted that many benchmarks in the library may no longer be meaningful for evaluating progress in current research. The baseline implementations remain correct, and the maintainers recommend seeking newer benchmarks for research comparisons.

The pinned dependency versions in `requirements.txt` are another practical barrier. Installing TSLib into an existing Python environment that uses different versions of NumPy, PyTorch, or transformers is likely to cause conflicts. The Docker path avoids this, but requires a machine with an NVIDIA GPU for the compute-intensive models.

TSLib is a research benchmarking tool. It does not provide a production inference pipeline, a model serving API, or data preprocessing for real-world datasets. Teams that want to deploy a time series model in production will need to extract the model implementation and build the surrounding infrastructure themselves.

Another practical constraint is the leaderboard itself. The top-three rankings visible in the README are based on results collected through March 2024. Time series research moves quickly, and newer architectures published after that date are not reflected. The maintainers noted in April 2026 that many benchmarks may no longer be meaningful for evaluating progress in current research. This does not mean the baseline implementations are wrong: they remain correct. It means that a result showing a new model beating the March 2024 leaderboard does not demonstrate state-of-the-art performance by current standards.

The pins strict version numbers for all dependencies including , , and . Teams running the library alongside other Python packages that depend on different versions of these libraries will encounter conflicts that are not automatically resolvable.

Alternatives and TSLib's Position in the Ecosystem

The Darts library is a Python alternative that covers forecasting and anomaly detection with a consistent API across both classical and deep learning models. Darts targets practitioners more than researchers: it provides higher-level abstractions, built-in backtesting utilities, and a more production-oriented design. TSLib provides lower-level model implementations designed for fair benchmarking comparisons, not convenient end-to-end pipelines.

Sklearn's time series tools handle classical methods such as ARIMA-style features and classification, but lack the deep learning models that TSLib is built around. For researchers whose primary goal is evaluating a new architecture against a controlled set of baselines on published benchmark datasets, TSLib remains a relevant starting point despite the reduced maintenance commitment. The recommendation is to cross-check TSLib's benchmark results against the 2024 survey paper on deep time series models referenced in the README before treating any specific leaderboard position as the current state of the art.

Editorial conclusion

TSLib is the right tool for researchers who need a reproducible baseline environment to evaluate their own time series model against published work, or who want to run the existing models on their own datasets without reimplementing them. It is not the right choice for production deployments or for teams that need ongoing feature additions: the maintainers stated in April 2026 that they will no longer actively add new features and recommended seeking newer benchmarks. The correct first step before adopting TSLib is checking which benchmark datasets and tasks are relevant to the actual problem, since the maintainers also noted that many benchmarks may no longer be meaningful for evaluating progress in current research.

Frequently asked questions

What Python library can I use for time series forecasting deep learning research?

TSLib (Time Series Library) from THUML provides implementations of many deep learning forecasting models including iTransformer, TimeMixer, TimeXer, and TimesNet, with Docker-based setup and benchmark scripts. Note that maintainers announced in April 2026 they will no longer actively add new features.

Is TSLib still maintained?

In April 2026, the maintainers announced that due to limited bandwidth they will not be actively adding new features. The baseline model implementations remain correct, but they recommend seeking newer benchmarks for current research comparisons.

What tasks does TSLib support beyond forecasting?

TSLib covers five tasks: long-term forecasting, short-term forecasting, imputation, anomaly detection, and classification. Each task has its own experiment script and leaderboard entry in the README.

Official sources

  1. Issues
  2. License: MIT
  3. README
  4. thuml/Time-Series-Library on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/thuml-time-series-library.svg)](https://hysenlabs.com/projects/thuml-time-series-library)