1A · Linux / macOS shell
python3 -m venv .venv source .venv/bin/activate python -m pip install --upgrade pip python -m pip install git+https://github.com/mistralai/timestral.git
MISTRAL AI · TIME-SERIES FORECASTING
Mistral AI’s first time-series model family forecasts numerical observations rather than generating chat responses. Four sizes, from 5M to 209M parameters, support zero-shot probabilistic forecasting on CPU or GPU.
An explanation of official sources, not an independent benchmark. Installation examples are reference instructions and have not been executed by this site.
Released: · Sources checked:
Start with 5M to learn the input and output format, then validate larger checkpoints on your own held-out data. The recommendations below are starting points, not measured rankings for your workload.
| Model | FP32 weight files | Where to start |
|---|---|---|
| Timestral-5M | 21 MB | Learn the API or explore a modest CPU workload. |
| Timestral-28M | 111 MB | Evaluate a larger model while keeping the footprint small. |
| Timestral-123M | 490 MB | Test a middle ground between resource use and accuracy. |
| Timestral-209M | 837 MB | Evaluate the flagship checkpoint behind the comparison below. |
Shared support: univariate or multivariate targets, past-only and known-future covariates, and 21 output quantiles. Context is capped at 32,768 historical time steps, not text tokens. One prediction block covers up to 1,024 future steps; longer horizons feed predicted medians back into subsequent blocks.
File size is a download/storage figure. Runtime RAM or VRAM also depends on tensor buffers, context length, batch size and the number of variables; no minimum-memory guarantee is implied.
The published design is a causal patch-based Transformer. For 209M, the model card lists 24 layers and a 768-dimensional embedding. The flow below explains inference, not a complete reconstruction of training.
Supply regularly spaced targets and optional covariates. Mark missing observations with NaN.
Values and missing-value indicators are embedded together, preserving the order of time.
Attention relates history over time and across variables. Covariates can inform targets without reading target rows.
Decoupled Horizon Forecasting uses separate prediction tokens to read the encoded context and produce ordered quantiles.
Past covariates cover the history. Known-future covariates also cover the requested forecast horizon, such as planned operating schedules. Future target observations are not known-future covariates. Categorical inputs use numeric category codes; the library handles target encoding where applicable.
The median is the 0.5 quantile. The 0.1 and 0.9 quantiles form a nominal central 80% prediction interval, not a guarantee that 80% of your future observations will fall inside it. Check calibration on a held-out time period.
The model card still lists the technical report as coming soon at the verification date. Architecture details here come from the README and model card; undisclosed training details are not inferred.
Mistral reports leading results at launch among pretrained zero-shot forecasting models. This table reproduces the comparison in its 209M model card, with the original model names and metric labels. It is a dated snapshot, not a live leaderboard.
| Benchmark · metric | Timestral-209M | t0-gamma | TimesFM-3 | Toto-2.0-2.5B | Chronos-2 |
|---|---|---|---|---|---|
| GIFT-Eval · MASE ↓ | 0.658 | 0.661 | 0.667 | 0.696 | 0.698 |
| GIFT-Eval · CRPS ↓ | 0.446 | 0.452 | 0.456 | 0.476 | 0.485 |
| TIME · MASE ↓ | 0.626 | 0.637 | 0.640 | 0.642 | 0.662 |
| TIME · CRPS ↓ | 0.522 | 0.534 | 0.536 | 0.539 | 0.556 |
| fev-bench · SQL skill score ↑ | 50.39 | 49.42 | 48.99 | 44.42 | 47.28 |
| fev-bench · MASE skill score ↑ | 39.49 | 37.99 | 37.82 | 32.54 | 35.50 |
Source-label difference: the release article labels a GIFT-Eval probability chart WQL, while the model-card table labels its row CRPS. We retain CRPS for the values shown here and do not assume the two labels describe an identical calculation. Arrows indicate whether lower or higher is better.
Mean Absolute Scaled Error compares absolute forecast error with a naive reference scale. Lower is better. These GIFT-Eval and TIME figures are aggregate results, not percentages of correct predictions.
Continuous Ranked Probability Score evaluates a predicted distribution against observations. Lower is better; inspect the benchmark definition and aggregation before comparing across datasets.
Scaled Quantile Loss skill score reports improvement relative to a reference forecast. Higher is better. A score of 50.39 is not 50.39% prediction accuracy. The MASE skill-score row also uses higher-is-better scoring.
The README specifies forecaster defaults and history up to 32,768 steps: GIFT-Eval uses 97 configurations with past numeric covariates; TIME uses 98 tasks without covariates; fev-bench uses 100 tasks with past and known covariates, including encoded categories.
These aggregate results do not establish a winner for every sensor, demand series or business horizon. Evaluate the same forecast origin, horizon, covariates and error metric on your own holdout period; exclude future information from history.
The release article includes a narrow CPU example. It is useful for understanding model-size tradeoffs, but is not a production latency commitment.
| Model | Reported latency | Reported conditions |
|---|---|---|
| Timestral-5M | 10 ms | Server CPU, 8 threads; 3 weeks of 15-minute history; forecast 1 day ahead. |
| Timestral-209M | 140 ms | Server CPU, 8 threads; 3 weeks of 15-minute history; forecast 1 day ahead. |
The article does not identify an exact CPU SKU or a complete timing protocol. Cold downloads, model loading, I/O and your variable count can change end-to-end time. Do not turn these numbers into a general speedup claim.
Local inference consumes your CPU/GPU time, RAM, electricity and operations effort. Downloadable weights are subject to their license. This guide has not verified a public Timestral-specific hosted API price or endpoint; no per-token or per-forecast selling price is inferred from the benchmark.
Requirements: Python 3.10 or newer, PyTorch 2.4 or newer, Git and access to the package and model hosts. A GPU is optional. The Windows example chooses Python 3.12; use an installed supported version.
Reference instructions only: this site has not installed Timestral, downloaded weights or run these forecasts. First use needs network access to fetch dependencies and the selected checkpoint.
python3 -m venv .venv source .venv/bin/activate python -m pip install --upgrade pip python -m pip install git+https://github.com/mistralai/timestral.git
py -3.12 -m venv .venv .\.venv\Scripts\Activate.ps1 python -m pip install --upgrade pip python -m pip install git+https://github.com/mistralai/timestral.git
Choose one environment setup, not both. The python3 command must resolve to Python ≥ 3.10. Installation from Git follows the official README and resolves current dependencies; it is not a frozen environment. For reproducibility, the repository also provides uv.lock and uv sync --frozen. CPU-only PyTorch builds can be selected through the official PyTorch installer.
import numpy as np
from timestral import TimestralForecaster
model = TimestralForecaster.from_pretrained(
"mistralai/Timestral-5M", device="cpu"
)
rng = np.random.default_rng(42)
context = rng.standard_normal(1000).cumsum()
forecast = model.forecast(context, prediction_length=96)
median = forecast.median
lower = forecast.quantile(0.1)
upper = forecast.quantile(0.9)
print("shape:", tuple(median.shape)) # (1, 1, 96)
print("first median:", median[0, 0, 0].item())
print("first interval:", lower[0, 0, 0].item(), upper[0, 0, 0].item())python forecast.py
Expected interface shape, not a captured test result: median has shape (1, 1, 96), representing one series, one variable and 96 future steps. The random walk is synthetic demonstration data; its predictions do not establish model quality.
To evaluate the flagship, replace the model ID with mistralai/Timestral-209M. A supported CUDA environment can use device="cuda". Check memory and compare on held-out data before increasing context, variables or batch size.
Prepare one value column with a header. Each row is exactly one time step, already sorted from oldest to newest. The short sample illustrates the file format only; use meaningful historical coverage for a real evaluation.
value 100 103 "" 108 110
import csv
import numpy as np
from timestral import TimestralForecaster
# series.csv: one header named "value"; oldest observation first.
# Each row represents one equally spaced time step; blank = missing.
with open("series.csv", newline="", encoding="utf-8-sig") as stream:
rows = list(csv.DictReader(stream))
context = np.array([
float(row["value"]) if row["value"].strip() else np.nan
for row in rows
], dtype=np.float32)
if context.size == 0 or not np.isfinite(context).any():
raise ValueError("Provide at least one finite observation")
if np.isinf(context).any():
raise ValueError("Use blank cells for missing values, not infinity")
model = TimestralForecaster.from_pretrained(
"mistralai/Timestral-5M", device="cpu"
)
result = model.forecast(context, prediction_length=96)
values = result.median[0, 0].cpu().numpy()
np.savetxt("forecast.csv", values, delimiter=",", header="median", comments="")Blank cells become NaN; retain rows for missing time slots. The script does not parse timestamps, sort, deduplicate or resample data. Do those steps before exporting the single column, and define its sampling interval. The output has 96 median values; assign future timestamps using that interval.
For multivariate input use (B, V, T): batch, variables, history. Past numeric covariates use (B, C, T); known-future covariates use (B, C, T + H), where H is prediction_length. A single target series is not an instruction to treat unrelated sensors as independent batch rows.
Model loading normally downloads config.json and model.safetensors to the Hugging Face cache. A complete cache or local directory lets you load the model without a Hub request.
from timestral import TimestralForecaster
# First load online to populate the Hugging Face cache:
model = TimestralForecaster.from_pretrained(
"mistralai/Timestral-5M", device="cpu"
)
# Later, load the same cached checkpoint without a network lookup:
cached = TimestralForecaster.from_pretrained(
"mistralai/Timestral-5M", device="cpu", local_files_only=True
)
# Alternative: directory containing config.json and model.safetensors.
local = TimestralForecaster.from_pretrained(
"/path/to/Timestral-5M", device="cpu", local_files_only=True
)Use the cached or local branch after preparing its files; the three loads above are alternatives for illustrating the lifecycle, not a required sequence in every script. Replace the placeholder path, or use a Windows path such as r"D:\models\Timestral-5M". local_files_only=True cannot recover missing files. Packages must also be installed before going offline.
Check python --version and python -m pip show torch inside the activated environment. Confirm Python ≥ 3.10, torch ≥ 2.4 and Git availability. A CUDA device also needs a compatible PyTorch build and driver; begin with CPU to separate these issues.
Check network access, available disk space and the exact case-sensitive model ID. An offline cache must contain the selected revision. A local folder must contain both config.json and model.safetensors; a filename alone is not a checkpoint directory.
Targets accept (T,), (B, T) or (B, V, T). Align all series on a common sampling interval, use NaN for missing values and provide T + H steps for known-future covariates. Do not put observations from the test horizon into the input history.
Start with 5M, a smaller batch and fewer variables; shorten history only if that fits the task. Measure downloads and loading separately from inference. Weight-file size does not include runtime activations or library overhead.
The inference code is Apache 2.0; the model weights are Modified MIT, not ordinary MIT. The 209M weight license withholds rights when your company’s (or employer’s) global consolidated revenue exceeded US$20 million in the preceding month, and directs affected users to Mistral for a commercial license. Retain required notices and review the license for the exact checkpoint you use.
Follow the original sources for updates. Benchmark numbers, interfaces, availability and license wording can change; the snapshot date below applies to this guide.