Skip to content

t0-gamma zero-shot forecaster

SolarCast's second TSFM is theforecastingcompany/t0-gamma, selected before implementation in the landscape review. This adapter uses only historical national PV, without fitting, weather, capacity, Elia forecasts, engineered features or test-period adaptation. The shared forecasting contracts, backtester and common-support evaluator remain unchanged. Technical integration and the controlled zero-shot comparison are documented separately.

Verified upstream contract

Rechecked on 14 November 2026 against the official repository, PyPI metadata, model card, native prediction implementation and PyTorch implementation. The checkpoint/revision is unchanged from the TSFM landscape review:

theforecastingcompany/t0-gamma
fef67abad3eed4f227c7b536a6e8ee4e9ab1080d

The current package is tfc-t0 0.6.1, requiring Python >=3.11, NumPy >=1.26 and Hugging Face Hub >=1. Its PyTorch extra requires Torch >=2.4, einops >=0.7, rotary-embedding-torch >=0.8 and safetensors >=0.4. This agrees with the TSFM landscape review; older search-index/model-card examples showing a lower installation floor should not override current package metadata. No material checkpoint/API change required changing the selected candidate. The gamma config's scaling and XPos conventions must be loaded rather than borrowing alpha defaults.

Gamma is a decoder-style patch transformer (~256M parameters, 32-step patches) with causal time-axis and variate-axis attention and native causal mean/std plus arcsinh scaling. Chronos-2 uses an encoder-only architecture (~120M parameters). Both have native quantiles and optional covariates; this track withholds covariates and uses raw native P50 for both. These are capability differences, not accuracy claims. The gamma weight artifact is 1,022,492,908 bytes; download size is not a measurement of process RAM or peak device memory.

License and distribution

Both code LICENSE and the actual gamma weight LICENSE are Apache-2.0. Preserve applicable attribution and NOTICE requirements. SolarCast neither bundles nor redistributes weights. Download/cache lookup uses the official Hub mechanism with an explicit revision, then loads the local snapshot with no second unpinned network lookup.

Installation and use

For the released package, use python -m pip install "solarcast-belgium[t0]". For source development, install from this repository:

python -m pip install -e ".[t0]"
# Development checks:
python -m pip install -e ".[dev,t0]"
# Independent alternative for Candidate #1:
python -m pip install -e ".[dev,chronos]"

The t0 extra adds tfc-t0[torch]>=0.6.1,<0.7. It does not require Chronos or Transformers. Shared transitive Torch/Hub dependencies are resolved by pip, without duplicated framework requirements in SolarCast metadata. Installing ".[dev,t0,chronos]" is supported in the tested environment; no combined tsfm extra is needed. Select a suitable CPU/CUDA wheel using the official PyTorch instructions.

from solarcast.models.t0 import T0Config, T0Forecaster

model = T0Forecaster(T0Config(context_length=1344, device="cpu"))
model.load()  # Optional warm-up; first predict also loads.
forecast = model.predict(context)  # Existing ForecastContext.

import solarcast, data, backtesting, evaluation and adapter module imports do not import Torch, t0 or Chronos. Constructing the forecaster checks optional imports and gives the correct installation hint if missing; it does not fetch weights. A successful load() is reused across origins. Loading failures retain their causes and may be retried. Metadata records stable model_id="t0", exact checkpoint/revision, library version, context cap, device, dtype and adjustments.

Context, frequency and missingness

Input is one NumPy float32 batch shaped [1, elapsed context slots] from the copied ForecastContext PV history. Only completed eligible intervals supplied by that context are accessible. Optional context.features is ignored. No dataset lookup, fitted custom scaler or future covariate path exists in this adapter.

The maximum context defaults to 1344 elapsed 15-minute slots. A common 7D cap is 672. SolarCast allows integer caps 1–8192 as a resource guard; 8192 is not a verified gamma-specific hard maximum. Upstream validates context length against input width and handles patch padding internally, without publishing a gamma-specific hard context cap in the checked config. Broader long-context performance is unverified; do not interpret the guard as evidence that every context length is equally useful.

Keep the same history selection/window as Chronos for a common-context experiment. The issue-anchored 14D window with 30-minute safety lag supplies 1342 slots, not 1344; the adapter cannot reach outside that window to obtain two older rows. It keeps starts >= cutoff minus the cap, then constructs a regular grid from the earliest retained supplied row through cutoff exclusive. Shorter supplied history stays shorter: there is no backward extension or silent retrieval.

The array API is frequency agnostic: adjacency represents 15 elapsed minutes because SolarCast validates timestamps and reconstructs the regular UTC grid. No frequency token, hourly resampling or local-naive timestamps are used. Brussels time is used only by the common target policy.

Explicit nulls, absent interior rows and trailing gaps stay NaN. Upstream reads these as MISSING observations, distinct from its internal PAD cells. No explicit mask is needed for this single univariate array. Leading supplied missing slots are preserved too: trim_leading_missing=False. There is no interpolation, forward-fill, zero-fill or custom normalization. Native preprocessing handles missing values and scaling. Empty/out-of-window/all-NaN history and observations overflowing float32 fail clearly before loading. One finite observation is the adapter's minimum, not a claim of adequate forecasting information.

Forecast lengths, point output and raw behavior

The model can directly request arbitrary positive horizons through 1024 steps per pass. Upstream supports autoregressive rollout beyond this; SolarCast deliberately limits this first adapter to a single block. The full bridge, not only the target count, must fit that limit. Unsupported requests fail; SolarCast does not pad, interpolate or duplicate outputs.

For issue 11:00 Brussels and cutoff 10:30, the model starts forecasting at cutoff:

Next Brussels day Requested targets Complete rollout
Spring DST 92 146
Normal 96 150
Autumn DST 100 154

The adapter selects exact requested UTC timestamps from the complete rollout, including sparse requested target sets. Forecast issue time and MW units follow the common contract. Gaps never shift the forecast anchor backward.

predict(..., quantile_levels=[0.5]) returns native P50 in a quantile tensor shaped [1, rollout, 1]. SolarCast validates shape and finite floating output over the entire bridge, then extracts that quantile. It does not select a statistic using test errors. Native 21 quantiles, interpolation and tail extrapolation could support future probabilistic work; the adapter exposes only deterministic P50.

All optional forecast adjustments are explicitly disabled: trim_leading_missing, symmetric_averaging, clip_nonnegative, snap_integers, and drop_constant_covariates. The last flag is irrelevant without covariates but is recorded explicitly. No negative clipping, nighttime zeroing or integer rounding is applied. Native predict runs in torch.inference_mode; the adapter also calls eval() and disables parameter gradients. No fit/fine-tuning occurs.

Timing, devices and failures

Explicit devices are cpu, cuda or cuda:N. CPU float32 is the default; CUDA requests fail clearly when CUDA is unavailable, with no silent fallback. Upstream uses ordinary PyTorch device paths and separately provides MLX for Apple silicon; SolarCast does not expose MLX or invent an automatic cross-framework device layer. Upstream packaging lists Linux/macOS, not an explicit Windows support promise.

Hub cache resolution/download and local construction/device transfer are timed separately. Per-call inference includes the native call and CPU output transfer, with device synchronization before/after, matching Chronos's timing scope. It excludes input-grid preparation, download, loading, and process startup/imports. last_inference records slot/missing counts and complete/requested horizon sizes, and resets before each attempt to avoid stale success diagnostics.

Errors include issue/cutoff/context/rollout information and preserve the cause. The unchanged backtester with on_error="continue" retains failed-origin rows; the evaluator reports availability and scores common support. No model-specific engine branch or metric was introduced. Instances assume sequential use.

Tests and actual Windows CPU findings

Offline tests mock only the native boundary and exercise production preprocessing, P50 conversion, raw negatives, one-time loading, explicit limits, short/unusable contexts, missing slots, sparse requests and all three DST day sizes. A future sentinel is excluded at the first origin and becomes eligible only at a later origin. The real backtester/evaluator tests preserve failures and common support. Normal tests never download weights:

python -m pytest
python -m pytest tests/test_t0.py tests/test_chronos.py -q
python -m pytest tests/test_t0.py -k "canary or dependency or imports" -q
python -m ruff check .
python -m ruff format --check .
python -m mypy

The real test is opt-in and checks four finite CPU targets with interior and trailing NaNs in a representative synthetic PV history:

$env:SOLARCAST_T0_INTEGRATION = "1"
try { python -m pytest tests/test_t0_integration.py -m integration -q } finally { Remove-Item Env:SOLARCAST_T0_INTEGRATION }

Verified on Windows 11 build 26200, Intel64 Family 6 Model 142, four Torch CPU threads, Python 3.12.4, tfc-t0 0.6.1, Torch 2.15.0+cpu, NumPy 2.5.4, pandas 3.1.1 and Hub 2.4.0. Installing the extra in the existing isolated .venv/chronos-smoke environment reused Torch/Hub and added small runtime packages; no compiler, WSL, administrator change or OS-specific workaround was needed. The actual installation command was .\.venv\chronos-smoke\Scripts\python.exe -m pip install -e ".[dev,t0,chronos]". The native opt-in test passed in 38.18 seconds including initial download/load; that is not inference-only timing. Anonymous Hub and symlink-fallback warnings did not prevent execution. The base .venv remains independent of TSFM extras.

An explicitly local-data smoke used the existing normalized Elia June snapshot:

.\.venv\chronos-smoke\Scripts\python.exe examples/forecast_t0.py --input-csv data/elia_benchmark_v1/20250601T0000Z_20250701T0000Z.csv --issue 2025-06-16T11:00:00+02:00 --local-files-only --output-dir artifacts/smoke/t0_cpu

The input hash is 41d2bc8cd8eb9ca2366bdc94fca02536a1efe5be1e23809e76cd11f19e189a03. The new ignored output directory contains smoke.json, short_forecast.csv, predictions.csv, origins.csv and evaluation.csv. There were two successful origins, 192/192 finite/scorable predictions, zero failures, and 1342 observed slots with no missingness at each origin. Each 96-target day used 150 rollout steps. The four-target short forecast used seven steps. No new Elia data were retrieved and no final comparative benchmark was run.

Cached resolution took 0.0108 seconds; local model loading took 3.119 seconds; short inference took 0.304 seconds; day-ahead calls took 0.319/0.315 seconds. These single-run observations are technical smoke evidence, not speed or accuracy rankings. The default example without --input-csv uses synthetic data and says so. Existing output directories cannot be overwritten. Both example entry points share smoke mechanics; both adapters share only small UTC context/bridge helpers.

Final verification: the base environment's complete offline suite passed 332 tests, with the two native integration tests skipped by default. In the combined-runtime environment, 58 adapter tests passed (30 t0, 28 Chronos), and the explicitly enabled two native tests passed together in 14.03 seconds. The canary/dependency/import subset passed six tests, with 52 deselected. Ruff passed, 68 Python files passed format checking, strict mypy passed 39 source/test files and all three smoke example files, both environments passed pip check, and wheel/sdist building succeeded. Base Torch/t0/Chronos remained absent while the separate LightGBM installation remained present.

Candidate #1's refactored example was also run on the same two June origins into artifacts/smoke/chronos_after_t0, yielding 192/192 finite/scorable outputs and zero failures. This is regression evidence, not a model comparison. Hash checks confirmed all 24 recorded the history-only LightGBM experiment source files, its configuration, and all 34 recorded generated artifacts remain unchanged. Source/artifact checksums identify the original verification state.

Assumptions and limitations

This track assumes regular quarter-hour history, native P50 and sequential local inference. Historical publication/revision vintages and Elia pretraining exclusion remain unresolved. A safety lag does not establish an operational information set. Gamma's hard context ceiling and full training-corpus details remain unverified. No native GPU/MLX, real-model DST, peak RAM/VRAM or broad Python-version validation was performed. Offline DST tests and the documented native horizon establish alignment, not forecast quality. Native missing-value acceptance does not imply useful predictions from sparse history. Common-context comparisons, all-model accuracy results belong to the controlled zero-shot experiment; any native-context comparison requires a separate disclosed study.

Public smoke acquisition policy

python examples/forecast_t0.py uses synthetic PV and real cached weights. Install .[t0] first. Weight downloads now require --allow-download; --local-files-only remains accepted. This example change does not alter adapter defaults or any frozen inference. See the example catalog.