Skip to main content

Open weights time-series foundation model from Google Research.

Project description

Disclaimer

This is a personal fork of timesfm, maintained to support custom changes for timecopilot and publish pypi wheels at timecopilot-timesfm. It may diverge from upstream.

Credits

This project is a fork of by Original Author(s).
All credit for the original code belongs to them. This fork is maintained independently to support TimeCopilot-specific changes.

TimesFM

TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.

This open version is not an officially supported Google product.

Latest Model Version: TimesFM 2.5

Archived Model Versions:

  • 1.0 and 2.0: relevant code archived in the sub directory v1. You can pip install timesfm==1.3.0 to install an older version of this package to load them.

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 frequency indicator.
  • has a couple of new forecasting flags.

Along with the model upgrade we have also upgraded the inference API. This repo will be under construction over the next few weeks to

  1. add support for an upcoming Flax version of the model (faster inference).
  2. add back covariate support.
  3. populate more docstrings, docs and notebook.

Install

TODO(siriuz42): Package timesfm==2.0.0 and upload to PyPI .

Run

git clone https://github.com/google-research/timesfm.git
cd timesfm
pip install -e .

Code Example

import torch
import numpy as np
import timesfm

torch.set_float32_matmul_precision("high")

model = timesfm.TimesFM_2p5_200M_torch.from_pretrained("google/timesfm-2.5-200m-pytorch")

model.compile(
    timesfm.ForecastConfig(
        max_context=1024,
        max_horizon=256,
        normalize_inputs=True,
        use_continuous_quantile_head=True,
        force_flip_invariance=True,
        infer_is_positive=True,
        fix_quantile_crossing=True,
    )
)
point_forecast, quantile_forecast = model.forecast(
    horizon=12,
    inputs=[
        np.linspace(0, 1, 100),
        np.sin(np.linspace(0, 20, 67)),
    ],  # Two dummy inputs
)
point_forecast.shape  # (2, 12)
quantile_forecast.shape  # (2, 12, 10): mean, then 10th to 90th quantiles.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

timecopilot_timesfm-0.3.0.tar.gz (61.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

timecopilot_timesfm-0.3.0-py3-none-any.whl (89.3 kB view details)

Uploaded Python 3

File details

Details for the file timecopilot_timesfm-0.3.0.tar.gz.

File metadata

  • Download URL: timecopilot_timesfm-0.3.0.tar.gz
  • Upload date:
  • Size: 61.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for timecopilot_timesfm-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e0d2608cc30b4d010027f0aca7e74874cd289d2d31dd19d08e4397c017124e7a
MD5 e8422885003b6856a3d58f558481dffe
BLAKE2b-256 b64e2ed6fb5533862d858861cb3e1060c085f40f58d64937d5e9523f0d2e9c20

See more details on using hashes here.

File details

Details for the file timecopilot_timesfm-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: timecopilot_timesfm-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 89.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for timecopilot_timesfm-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98c3c11532957dc2102a989c1457a73fcb6616059a5b0dd6c1a8c2260dd05dc0
MD5 546cd6848dc1466632e36fd34edbc13d
BLAKE2b-256 ca9535e8ba2f2416fb8afc32290eb727beb70c276e685f3d93936f8484586da1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page