google-research/timesfm
TimesFM
TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.
- Paper: A decoder-only foundation model for time-series forecasting, ICML 2024.
- (NEW!) TimesFM 3.0 Checkpoint:
google/timesfm-3.0-pytorch. - Checkpoints (up to 2.5): TimesFM Hugging Face Collection.
- Google Research blog (New blog post for TimesFM 3.0 coming soon!).
- TimesFM in Google 1P Products:
- BigQuery ML: Enterprise level SQL queries for scalability and reliability.
- Google Sheets: For your daily spreadsheet.
- Vertex Model Garden: Dockerized endpoint for agentic calling.
This open version is not an officially supported Google product.
Latest Model Version: TimesFM 3.0
Archived Model Versions:
- 2.5: relevant code under
src/timesfm. - 1.0 and 2.0: relevant code archived in the subdirectory
v1. You canpip install timesfm==1.3.0to install an older version of this package to load them.
Update — August 2026
TimesFM 3.0 is out!
TimesFM 3.0 introduces native multivariate time-series forecasting, flexible covariate support (both past-only and past-and-future covariates), superior zero-shot generalist capabilities, and top performance across all three major time-series foundation model benchmarks.
Key Highlights:
- Native Multivariate & Univariate Forecasting with Covariates: Seamlessly forecast multi-channel multivariate series as well as individual univariate series, with native support for past-only and past-and-future dynamic covariates without per-task tuning.
- Top Benchmark Performance:
- 🥇 fev-bench: Rank #1 overall across 100 diverse real-world forecasting tasks.
- 🥇 TIME Benchmark: Rank #1 overall across 50 domain datasets and 98 evaluation tasks.
- 🥇 GIFT-Eval: Rank #1 among all foundation models.
License notice for pretrained weights
Important: The TimesFM source code in this repository is licensed under Apache-2.0, and model weights up to version 2.5 remain Apache-2.0. However, for the time being, TimesFM 3.0 pretrained weights are distributed under the separate
timesfm-non-commercial-license-v1.0license and are restricted to non-commercial, non-production use. Commercial or production use of the default pretrained weights is not permitted.
Update - July 2, 2026
Updated PyPI to timesfm=2.0.2. See
Install.
Update - Apr. 9, 2026
Added fine-tuning example using HuggingFace Transformers + PEFT (LoRA) — see
timesfm-forecasting/examples/finetuning/.
Also added unit tests (tests/) and incorporated several community fixes.
Shoutout to @kashif and @darkpowerxo.
Update - Mar. 19, 2026
Huge shoutout to @borealBytes for adding the support for AGENTS! TimesFM SKILL.md is out.
Update - Oct. 29, 2025
Added back the covariate support through XReg for TimesFM 2.5.
Update - Sept. 15, 2025
TimesFM 2.5 is out!
Comparing to TimesFM 2.0, this new 2.5 model:
- uses 200M parameters, down from 500M.
- supports up to 16k context length, up from 2048.
- supports continuous quantile forecast up to 1k horizon via an optional 30M quantile head.
- gets rid of the
frequencyindicator. - has a couple of new forecasting flags.
Since the Sept. 2025 launch, the following improvements have been completed for TimesFM 2.5:
- ✅ Flax version of the model for faster inference.
- ✅ Covariate support via XReg (see Oct. 2025 update).
- ✅ Documentation, examples, and agent skill (see
timesfm-forecasting/). - ✅ Fine-tuning example with LoRA via HuggingFace Transformers + PEFT (see
timesfm-forecasting/examples/finetuning/). - ✅ Unit tests for core layers, configs, and utilities (see
tests/).
Install
From PyPI
|
|
Local Install
-
Clone the repository:
1 2git clone https://github.com/google-research/timesfm.git cd timesfm -
Create a virtual environment and install with PyTorch:
1 2 3 4 5 6# Using uv uv venv source .venv/bin/activate # Install the package in editable mode with torch uv pip install -e .[torch]
Code Examples: TimesFM 3.0
1. Univariate Forecasting (Variable Lengths)
Pass a batch of 1D NumPy arrays of different context lengths to forecast univariate time series:
|
|
2. Multivariate Forecasting with Covariates
Pass a 2D array of shape (num_variates, context_length) along with optional
past-only and past-and-future covariates:
|
|