theforecastingcompany/t0-alpha-onnx-int8

Model

0

stars

2

commits

2

linked in READMEs

Sep 4, 2026

updated

browser
cpu
edge
forecasting
foundation-models
int8
known-future-covariates
local-inference
multivariate
onnx
onnxruntime
onnxruntime-web
open-weights
pretrained-models
probabilistic-forecasting
quantized
t0-alpha
time-series
time-series-forecasting
transformer
wasm
Browse cluster: Time Series Forecasting with Transformers

README

The Forecasting Company The Forecasting Company

t0-alpha ONNX INT8

This is a first-party, dynamically quantized INT8 ONNX export of t0-alpha. It runs with ONNX Runtime, including ONNX Runtime Web's WASM execution provider.

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

The graph supports dynamic context lengths and forecast horizons, grouped targets, and known-future covariates. It powers Finish This Chart, our in-browser forecasting game.

Intended use

This size-optimized derivative has been tested for export parity and browser execution, but not as broadly as the full model. For production or consequential use, we recommend t0-alpha. Provided as-is.

Artifact

ArtifactSizePurpose
t0-alpha-grouped-int8.onnx107.2 MBRecommended portable graph

Graph contract

Input/outputTypeShapeNotes
target_contextfloat32[target_rows, context]Use NaN for missing observations
target_group_idsint32[target_rows]Rows with the same id attend jointly
future_covariate_contextfloat32[covariate_rows, context]Historical portion of known-future covariates
future_covariate_futurefloat32[covariate_rows, compute_horizon]Values known over the forecast horizon
future_covariate_group_idsint32[covariate_rows]Associates each covariate with a target group
quantilesfloat32[target_rows, compute_horizon, 5]Levels 0.1, 0.25, 0.5, 0.75, 0.9

The graph uses ONNX opset 20 and dynamic per-channel signed INT8 weight quantization. It has been exported and tested for context lengths from 1 to 4096, 1 to 64 target rows, 0 to 64 known-future covariate rows, and compute horizons from 32 to 1024.

The graph determines its compute horizon from the width of future_covariate_future, which must be a multiple of 32. To request 50 steps, for example, pass a width of 64 and keep the first 50 outputs. Context length is independently flexible: the graph left-pads it to a patch boundary internally. The graph does not include autoregressive rollout beyond 1024 steps.

Group ids need not be contiguous. Give target and covariate rows the same id when they belong to the same multivariate series. If no known-future covariates are available, pass covariate arrays with zero rows; the horizon dimension is still retained.

import math

import numpy as np
import onnxruntime as ort

target_context = np.asarray([1.0, 1.3, 1.2, 1.7, 2.1], dtype=np.float32)[None, :]
target_group_ids = np.asarray([0], dtype=np.int32)
horizon = 24
compute_horizon = math.ceil(horizon / 32) * 32
future_covariate_context = np.empty((0, target_context.shape[1]), dtype=np.float32)
future_covariate_future = np.empty((0, compute_horizon), dtype=np.float32)
future_covariate_group_ids = np.empty((0,), dtype=np.int32)

session = ort.InferenceSession("t0-alpha-grouped-int8.onnx")
quantiles = session.run(
    None,
    {
        "target_context": target_context,
        "target_group_ids": target_group_ids,
        "future_covariate_context": future_covariate_context,
        "future_covariate_future": future_covariate_future,
        "future_covariate_group_ids": future_covariate_group_ids,
    },
)[0]
forecast = quantiles[:, :horizon, :]

Validation status

The FP32 graph matched model.predict() within 0.002% of forecast spread across the tested envelope. INT8 forecasts remained finite with ordered quantiles, with mean drift typically 0.5–1.6% of the PyTorch forecast spread and roughly 2–3% for the longest contexts.

With ONNX Runtime Web 1.22.0's WASM provider, the shape used by Finish This Chart ran in roughly 38 ms after warm-up in a one-thread reference harness. Runtime varies with context length, horizon, and row count.

Acknowledgements

Thanks to Siddharth7113/tsfm-onnx for their Apache-2.0 ONNX export work, which informed parts of this export.

License

Apache-2.0. See LICENSE.

Contributors

JF
jodles

1 commits

theforecastingcompany/t0-alpha-onnx-int8

Model

0

stars

2

commits

2

linked in READMEs

Sep 4, 2026

updated

browser
cpu
edge
forecasting
foundation-models
int8
known-future-covariates
local-inference
multivariate
onnx
onnxruntime
onnxruntime-web
open-weights
pretrained-models
probabilistic-forecasting
quantized
t0-alpha
time-series
time-series-forecasting
transformer
wasm
Browse cluster: Time Series Forecasting with Transformers

README

The Forecasting Company The Forecasting Company

t0-alpha ONNX INT8

This is a first-party, dynamically quantized INT8 ONNX export of t0-alpha. It runs with ONNX Runtime, including ONNX Runtime Web's WASM execution provider.

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

The graph supports dynamic context lengths and forecast horizons, grouped targets, and known-future covariates. It powers Finish This Chart, our in-browser forecasting game.

Intended use

This size-optimized derivative has been tested for export parity and browser execution, but not as broadly as the full model. For production or consequential use, we recommend t0-alpha. Provided as-is.

Artifact

ArtifactSizePurpose
t0-alpha-grouped-int8.onnx107.2 MBRecommended portable graph

Graph contract

Input/outputTypeShapeNotes
target_contextfloat32[target_rows, context]Use NaN for missing observations
target_group_idsint32[target_rows]Rows with the same id attend jointly
future_covariate_contextfloat32[covariate_rows, context]Historical portion of known-future covariates
future_covariate_futurefloat32[covariate_rows, compute_horizon]Values known over the forecast horizon
future_covariate_group_idsint32[covariate_rows]Associates each covariate with a target group
quantilesfloat32[target_rows, compute_horizon, 5]Levels 0.1, 0.25, 0.5, 0.75, 0.9

The graph uses ONNX opset 20 and dynamic per-channel signed INT8 weight quantization. It has been exported and tested for context lengths from 1 to 4096, 1 to 64 target rows, 0 to 64 known-future covariate rows, and compute horizons from 32 to 1024.

The graph determines its compute horizon from the width of future_covariate_future, which must be a multiple of 32. To request 50 steps, for example, pass a width of 64 and keep the first 50 outputs. Context length is independently flexible: the graph left-pads it to a patch boundary internally. The graph does not include autoregressive rollout beyond 1024 steps.

Group ids need not be contiguous. Give target and covariate rows the same id when they belong to the same multivariate series. If no known-future covariates are available, pass covariate arrays with zero rows; the horizon dimension is still retained.

import math

import numpy as np
import onnxruntime as ort

target_context = np.asarray([1.0, 1.3, 1.2, 1.7, 2.1], dtype=np.float32)[None, :]
target_group_ids = np.asarray([0], dtype=np.int32)
horizon = 24
compute_horizon = math.ceil(horizon / 32) * 32
future_covariate_context = np.empty((0, target_context.shape[1]), dtype=np.float32)
future_covariate_future = np.empty((0, compute_horizon), dtype=np.float32)
future_covariate_group_ids = np.empty((0,), dtype=np.int32)

session = ort.InferenceSession("t0-alpha-grouped-int8.onnx")
quantiles = session.run(
    None,
    {
        "target_context": target_context,
        "target_group_ids": target_group_ids,
        "future_covariate_context": future_covariate_context,
        "future_covariate_future": future_covariate_future,
        "future_covariate_group_ids": future_covariate_group_ids,
    },
)[0]
forecast = quantiles[:, :horizon, :]

Validation status

The FP32 graph matched model.predict() within 0.002% of forecast spread across the tested envelope. INT8 forecasts remained finite with ordered quantiles, with mean drift typically 0.5–1.6% of the PyTorch forecast spread and roughly 2–3% for the longest contexts.

With ONNX Runtime Web 1.22.0's WASM provider, the shape used by Finish This Chart ran in roughly 38 ms after warm-up in a one-thread reference harness. Runtime varies with context length, horizon, and row count.

Acknowledgements

Thanks to Siddharth7113/tsfm-onnx for their Apache-2.0 ONNX export work, which informed parts of this export.

License

Apache-2.0. See LICENSE.

Contributors

JF
jodles

1 commits