Skip to main content
FoundationForecast FoundationForecast
The API for the time series foundation era · Forecast · Cross-validation · Anomaly detection
CI PyPI versions license Join Discord

Why?

Forecasting and time series have entered their foundation era. But, just like in the LLM space, different models bring different inductive biases and perform differently across domains, datasets, and even horizons.

The world already uses different LLMs for different use cases. We're seeing the same thing in forecasting: there is no single model that dominates everywhere. Results change with the data distribution and forecasting horizon, as we've seen in Impermanent and other benchmarks such as GIFT-Eval and FEV.

At the same time, every lab also ships its own API, dependencies, data conventions, and learning curve. That fragmentation makes foundation models hard to compare fairly, and even harder to use together in production.

FoundationForecast removes that friction: one FoundationForecast class, one data format, and the same methods: forecast, cross_validation, and detect_anomalies, across time series foundation models. ✨

Developed with 💙 by the TimeCopilot crew.


Quick example

import pandas as pd
from foundationforecast import FoundationForecast
from foundationforecast.models import Chronos, Toto

df = pd.read_csv(
    "https://timecopilot.s3.amazonaws.com/public/data/air_passengers.csv",
)

ff = FoundationForecast(models=[Chronos(), Toto(context_length=256)])

fcst_df = ff.forecast(df, h=12, freq="MS", level=[90])
cv_df = ff.cross_validation(df, h=12, freq="MS", level=[90])
anomalies_df = ff.detect_anomalies(df, freq="MS", level=99)

Your DataFrame needs three columns: unique_id, ds, and y. For best results, ensure ds is a proper datetime dtype (e.g., pass parse_dates=["ds"] when reading) or an ISO-8601 string so sorting is correct; cross-validation/anomaly detection will also convert ds to datetime internally where needed.


Highlights

  • 🎯 Reproducible by design. FoundationForecast implementations are regression-tested against official GIFT-Eval submissions to ensure they continue to reproduce their benchmark behavior. CI automatically re-runs experiments/gift-eval on Modal GPU and verifies MASE and CRPS against Hugging Face reference CSVs for every change.
  • 🚀 GPU-native. Automatically runs on GPU when available, without model-specific device configuration.

Supported models

Every model supports forecast, cross-validation, and anomaly detection through the same API. Intervals means prediction intervals via level or quantile forecasts. Finetuning marks models that can adapt to your data at inference time. License is the weight/checkpoint license on the default Hugging Face repo (or provider terms for hosted APIs). See the note below for production use.

Pass any Hugging Face repo_id (or local checkpoint path) supported by the underlying model class.

Model Forecast CV Anomalies Intervals Finetuning License
Chronos ✓ ✓ ✓ ✓ ✓ Apache-2.0
FlowState ✓ ✓ ✓ ✓ Apache-2.0
Moirai ✓ ✓ ✓ ✓ CC-BY-NC-4.0
PatchTST-FM ✓ ✓ ✓ ✓ CC-BY-NC-SA-4.0
Sundial ✓ ✓ ✓ ✓ Apache-2.0
T0 ✓ ✓ ✓ ✓ Apache-2.0†
TabPFN ✓ ✓ ✓ ✓ TabPFN NC‡
Tafsut ✓ ✓ ✓ ✓ MIT
TiRex ✓ ✓ ✓ ✓ Community / Apache-2.0
TimeGPT ✓ ✓ ✓ ✓ ✓ Nixtla API§
TimesFM ✓ ✓ ✓ ✓ Apache-2.0
Toto ✓ ✓ ✓ ✓ Apache-2.0

Licenses verified against Hugging Face model cards. Check the model card for your repo_id when in doubt.

What this means for production
  • Apache-2.0, MIT: generally fine for commercial production (retain notices; T0† is also gated on Hugging Face: accept terms and set HF_TOKEN).
  • CC-BY-NC-4.0 (Moirai), CC-BY-NC-SA-4.0 (PatchTST-FM): non-commercial only; not for revenue-generating production without a separate agreement from the rights holder.
  • TimesFM 3.0: weights for google/timesfm-3.0-pytorch are non-commercial; TimesFM 1.0–2.5 checkpoints remain Apache-2.0.
  • TabPFN NC‡: TabPFN-2.6+ weights are non-commercial; production requires a Prior Labs commercial license or API. First use also requires accepting terms at ux.priorlabs.ai (TABPFN_TOKEN).
  • Community / Apache-2.0 (TiRex): TiRex 1.0 uses the NXAI Community License (commercial limits for large enterprises); TiRex 2.0 is Apache-2.0.
  • Nixtla API§: hosted service via NIXTLA_API_KEY; production under Nixtla terms/pricing, not open weights.

FoundationForecast itself is Apache-2.0 regardless of which model you plug in.

Some models require specific Python versions (e.g. FlowState 3.11-3.13, TabPFN < 3.13). See the Model Hub for details and default checkpoints.

Example checkpoints & API model IDs
  • Chronos: amazon/chronos-t5-{tiny,mini,small,base,large}, amazon/chronos-bolt-{tiny,mini,small,base}, amazon/chronos-2
  • FlowState: ibm-research/flowstate, ibm-granite/granite-timeseries-flowstate-r1
  • Moirai: Salesforce/moirai-{1.0,1.1,2.0}-R-{small,base,large}, Salesforce/moirai-moe-1.0-R-*
  • PatchTST-FM: ibm-research/patchtst-fm-r1
  • Sundial: thuml/sundial-base-128m
  • T0: theforecastingcompany/t0-alpha
  • TabPFN: tabpfn-local, tabpfn-client
  • Tafsut: Tafsut-FM/tafsut-univariate-base
  • TiRex: NX-AI/TiRex, NX-AI/TiRex-2
  • TimeGPT: pass model= to TimeGPT(), e.g. timegpt-1, timegpt-1-long-horizon, timegpt-2-mini, timegpt-2, timegpt-2-pro
  • TimesFM: google/timesfm-{1.0-200m,2.0-500m,2.5-200m,3.0}-pytorch (3.0 weights are non-commercial)
  • Toto: Datadog/Toto-Open-Base-1.0, Datadog/Toto-2.0-{4m,22m,313m,1B,2.5B}

Installation

Recommended: uv installs fast, locks dependencies reproducibly, and matches how this repo is developed and tested (especially useful with heavy ML stacks like torch and transformers).

uv add foundationforecast

Or with pip:

pip install foundationforecast

Requires Python 3.10+. Some models have additional version requirements; see the Model Hub.

Optional plotting support:

uv add "foundationforecast[plot]"
# or: pip install "foundationforecast[plot]"

Relationship to TimeCopilot

FoundationForecast TimeCopilot
Foundation models (Chronos, Moirai, …) ✓ ✓
Unified forecast / CV / anomaly API ✓ ✓
Statistical & ML baselines ✓
LLM agent & natural-language queries ✓
Ensembles & distributed inference ✓

Use FoundationForecast when you only need foundation models. Use TimeCopilot for the full forecasting agent.


Citation

To reference the software package:

@software{foundationforecast,
  title = {FoundationForecast: The API for time series foundation models},
  author = {Garza, Azul and Rosillo, Renée},
  year = {2026},
  url = {https://github.com/TimeCopilot/foundationforecast},
  license = {Apache-2.0},
}

Community

Questions, bugs, and contributions:

Developed across Salamanca · Mexico City · San Francisco.


License

FoundationForecast is licensed under Apache License 2.0. You may use, modify, and deploy the library in production, including commercial applications.

Model weights and hosted APIs have separate licenses. See the License column and production note in Supported models above.

Release files for foundationforecast 0.1.4

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

Source distribution (sdist)

Source distribution for foundationforecast 0.1.4
File Size Uploaded
foundationforecast-0.1.4.tar.gz 3.2 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for foundationforecast 0.1.4
File Interpreter ABI Platform
foundationforecast-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 3.3 MB

Release files / foundationforecast-0.1.4.tar.gz

Download URL foundationforecast-0.1.4.tar.gz
Size 3.2 MB
Tags Source
SHA-256 checksum
How to use checksums
6c5e8323ef5d3dde31fb0575faf68a0781d7ecea94ac38f8f80c655ad8291b98
BLAKE2b-256 checksum
How to use checksums
8f553477590a6d8b8996b716af9dc28fde8a09ae0a23635440e5a3dfd0767106
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / foundationforecast-0.1.4-py3-none-any.whl

Download URL foundationforecast-0.1.4-py3-none-any.whl
Size 65.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8174b3782b552fb86065e711b8b40387f6c3cba3445b0dd8a732c40b256bece8
BLAKE2b-256 checksum
How to use checksums
a56fc7026df85f088cf84390becfcec78e81a829cde20b2dc795bfa3e3e02e90
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

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