The Forecasting Company

t0-beta ONNX INT8

This is a first-party INT8-weight, FP32-compute ONNX export of t0-beta, the second public iteration of the probabilistic time-series forecasting foundation model from The Forecasting Company. It runs with ONNX Runtime, including ONNX Runtime Web's WASM and WebGPU providers.

It supports grouped univariate and multivariate targets, known-future covariates, and dynamic context lengths and forecast horizons.

Model family: t0-beta (PyTorch/MLX) · ONNX INT8 · ONNX FP16

You can also use t0 on Retrocast, our platform for forecasting on your own data and comparing open-weight models.

t0 forecasting French national electricity demand in Retrocast

An illustration of t0 in Retrocast, from the source model card. Data: Enedis open data.

Model details

Field Value
Base model t0-beta
Architecture Decoder-style patch transformer, approximately 256M parameters
Layers / embedding size 24 / 1024
Patch size 32 observations
Native quantiles 21 levels, from 0.01 to 0.99
Weight storage / computation INT8 / FP32
Interface Grouped targets and known-future covariates
ONNX opset 20
License Apache-2.0

The 96 transformer projection matrices use per-channel signed INT8 weights. Six input/output projection matrices remain FP32 to preserve the extreme quantiles. Compact weights reduce download size; expanded runtime weights and calculations use FP32, so this is not a proportional reduction in runtime memory.

What changes from t0-alpha?

Beta returns 21 native quantiles instead of five. The median is index 10, not alpha's index 2. The ordered levels are:

0.01, 0.05, 0.10, 0.15, 0.20, 0.25, 0.30, 0.35, 0.40, 0.45, 0.50,
0.55, 0.60, 0.65, 0.70, 0.75, 0.80, 0.85, 0.90, 0.95, 0.99

The graph includes beta's normalization: scaler_eps=0.01 and scaler_eps_mode=std_clamp. Pass raw observations; do not apply alpha's normalization outside the graph. All native quantiles are returned; arbitrary quantile interpolation and autoregressive rollout are not included in this export.

Intended use

This derivative is intended for local probabilistic forecasting in browsers, on CPUs and with the tested WebGPU configuration, including known-future covariates. It has been validated for numerical consistency and browser execution. Evaluate forecast accuracy and calibration on your own historical backtests and validate execution on the hardware you plan to use.

For the full forecasting API, including quantile interpolation, longer-horizon rollout and fine-tuning, use t0-beta with tfc-t0>=0.5.0. The source repository also supports MLX inference. These ONNX files do not require PyTorch or tfc-t0 at inference time. Forecasts are probabilistic estimates.

Artifact

Artifact Download size Purpose
t0-beta-grouped-int8.onnx 269.1 MB INT8 weights, FP32 compute

Exported from the pinned beta checkpoint revision. Artifact SHA-256: 2c517869aac22518c1e04a35386a739d2656490574a40ea9a31187f4f115ac9b. File hashes are recorded in manifest.json.

Graph contract

Input/output Type Shape Notes
target_context float32 [target_rows, context] NaN marks missing observations
target_group_ids int32 [target_rows] Rows with the same id attend jointly
future_covariate_context float32 [covariate_rows, context] Historical portion of known-future covariates
future_covariate_future float32 [covariate_rows, compute_horizon] Values available over the forecast horizon
future_covariate_group_ids int32 [covariate_rows] Associates covariates with target groups
quantiles float32 [target_rows, compute_horizon, 21] Native quantile forecasts

Group ids need not be contiguous. Give target and covariate rows the same id when they belong to the same multivariate series; different groups remain independent. Historical-only covariates can be supplied as additional target rows in the same group; the graph also forecasts those rows.

With no known-future covariates, pass arrays with zero covariate rows. Keep the second dimension of future_covariate_future: it still selects the horizon.

The graph accepts contexts within its exported 1–8192 observation range and left-pads them internally to the 32-step patch grid. Use NaN for missing observations. It has no separate public padding-mask input.

The compute horizon is selected by the width of future_covariate_future and must be a positive multiple of 32, up to 1024. For a 50-step forecast, pass width 64 and retain the first 50 outputs. Quantile outputs are float32 for both storage precisions.

Quickstart

pip install numpy "onnxruntime==1.29.0" huggingface_hub
hf auth login  # authenticate with an authorized account for private repositories

The example downloads this repository's artifact and runs on CPU:

import math

import numpy as np
import onnxruntime as ort
from huggingface_hub import hf_hub_download

model_path = hf_hub_download(
    repo_id="theforecastingcompany/t0-beta-onnx-int8",
    filename="t0-beta-grouped-int8.onnx",
)
session = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])

horizon = 50
compute_horizon = math.ceil(horizon / 32) * 32  # 64
history = (10 + np.sin(np.arange(97) / 6)).astype(np.float32)
target_context = history[None, :]
feeds = {
    "target_context": target_context,
    "target_group_ids": np.array([0], dtype=np.int32),
    "future_covariate_context": np.empty((0, history.size), dtype=np.float32),
    "future_covariate_future": np.empty((0, compute_horizon), dtype=np.float32),
    "future_covariate_group_ids": np.empty((0,), dtype=np.int32),
}
quantiles = session.run(["quantiles"], feeds)[0]
forecast = quantiles[:, :horizon, :]  # [1, 50, 21]
median = forecast[..., 10]           # [1, 50]
print(forecast.shape, median.shape)

Forecasting with covariates

The following continues the example above. Two target rows share a group, so they are forecast jointly. A calendar covariate belongs to that same group and is supplied over both history and the full compute horizon.

targets = np.concatenate([target_context, target_context * 1.2], axis=0)
calendar = np.sin(2 * np.pi * np.arange(history.size + compute_horizon) / 7)
calendar = calendar.astype(np.float32)[None, :]
with_covariates = {
    "target_context": targets,
    "target_group_ids": np.array([7, 7], dtype=np.int32),
    "future_covariate_context": calendar[:, :history.size],
    "future_covariate_future": calendar[:, history.size:],
    "future_covariate_group_ids": np.array([7], dtype=np.int32),
}
forecast_with_covariates = session.run(["quantiles"], with_covariates)[0][:, :horizon, :]
print(forecast_with_covariates.shape)  # [2, 50, 21]

Only use covariates available at the forecast origin, such as calendar features, planned promotions or weather forecasts. Unknown entries may be marked with NaN; do not substitute later observed target values.

Browser runtime

Use ONNX Runtime Web 1.29.0 and this repository's webgpu-options.js. Download the model and helper, then serve both through your application. The helper is specific to this artifact: it places affected mask operations on WASM and allows constant weight expansion to be folded, while matrix operations run on WebGPU.

import * as ort from "onnxruntime-web/webgpu";
import { webgpuOptions } from "./webgpu-options.js";

ort.env.wasm.numThreads = 1;
const response = await fetch("./t0-beta-grouped-int8.onnx");
if (!response.ok) throw new Error(`Model download failed: ${response.status}`);
const modelBytes = await response.arrayBuffer();
const session = await ort.InferenceSession.create(modelBytes, webgpuOptions);

Feed tensors using the names, dtypes and shapes in the graph contract above. For WASM-only execution, create the session with { executionProviders: ["wasm"] }. Use WASM when WebGPU is unavailable.

Evaluation and validation

Source-model benchmarks

The pinned t0-beta model card reports the following results for the original checkpoint:

Benchmark Metric t0-beta
GIFT-Eval CRPS ↓ 0.4738
GIFT-Eval MASE ↓ 0.6865
fev-bench Skill score ↑ 46.37

These are source-model results. GIFT-Eval and fev-bench have not been run on this ONNX derivative; its conversion checks below measure numerical drift.

This ONNX artifact

Native validation passed 54 synthetic series/context/horizon cases against unmodified PyTorch, with finite, ordered outputs. Across these cases, the worst per-series mean drift was 0.2271% and the worst point drift was 9.393%. Drift is absolute error divided by the reference series' full forecast range across the horizon and all quantiles, not relative error on an individual prediction. The gates were 2% mean and 10% point drift.

Browser validation passed 12 cases for this exact artifact: six fixtures each on single-thread WASM and WebGPU, with ONNX Runtime Web 1.29.0, Chromium 152 and Apple Metal 3. Fixtures cover contexts 1, 33, 97, 512 and 8192 and horizons 32, 64 and 1024. Browser outputs matched native CPU outputs at rtol=0.001, atol=0.001, with no non-finite values or quantile crossings. Other hardware has not been validated. Recorded timings include first-use compilation and are not warm-inference benchmarks.

INT8 can introduce more drift in extreme quantiles. The FP16 sibling provides a closer numerical match in these checks.

Acknowledgements

t0-beta continues the t0-alpha model family. The underlying model builds on ideas from Toto, Chronos-2 and TiRex. Thanks also to Siddharth7113/tsfm-onnx for the Apache-2.0 ONNX export work that informed parts of this pipeline. See NOTICE for code-level attributions.

Citation

@misc{tfc-t0,
  title  = {t0: A time-series forecasting foundation model},
  author = {The Forecasting Company},
  year   = {2026},
  url    = {https://huggingface.co/theforecastingcompany/t0-beta},
}

License and contact

Apache-2.0. See LICENSE and NOTICE. For issues and bug reports, use the tfc-t0 issue tracker.

Downloads last month
7
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for theforecastingcompany/t0-beta-onnx-int8

Quantized
(2)
this model

Collection including theforecastingcompany/t0-beta-onnx-int8